<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello Adebayo,<div><br></div><div>Sorry I'm not going to address your question directly (because I don't know the answer), but I wanted to make sure you know about other options that are available to you for building applications based on ParaView. Maybe you've thought all of this through already -- in that case please excuse me.</div><div><br></div><div>If you want or need the capabilities of ParaView to deal with large data sets, or if you want to just build upon other nice existing elements of ParaView, but you don't need all of its functionality, there is now a much easier way to build a simplified / customized version of ParaView through "branding". This wiki page describes the process:</div><div><br></div><div><a href="http://www.paraview.org/Wiki/Writing_Custom_Applications">http://www.paraview.org/Wiki/Writing_Custom_Applications</a></div><div><br></div><div>There are also six examples in {PVsource}/Examples/CustomApplications.</div><div><br></div><div>This way it is not difficult to get ParaView's basic functionality, and then add your own custom readers, filters, widgets, etc, through plugins. </div><div><br></div><div>If you don't need to scale your application to very large data sets, then personally I find it easier to build a custom application directly using VTK rather than building upon ParaView's libraries.</div><div><br></div><div>Take care,</div><div>-Eric</div><div><br></div><div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div>------------------------------------------------------</div><div>Eric E Monson</div><div>Duke Visualization Technology Group</div><div><span class="Apple-style-span" style="font-size: medium;"><br></span></div></span>
</div>
<br><div><div>On Jan 26, 2010, at 8:24 PM, pat marion wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi,<br><br>You should include the exact error message you are getting so that people can help.<br><br>I'm not very familiar with building custom apps using paraview so I won't be able to answer your question exactly... but to change the representation to volume you must create proxy objects for a lookup table and a piecewise function, then assign them to the representation's proxy properties LookupTable and ScalarOpacityFunction. <br>
<br>The best example I have is in python- a image-data source is created and the representation is set to volume, the scalar value 37 is set to the color red with an <span class="il">opacity</span> value of 0, and scalar value 270 is set to the color blue with <span class="il">opacity</span> value 0.5:<br>
<div class="im">
<br>
</div>Wavelet()<br>
rep = Show()<br>
rep.ColorArrayName = "RTData"<br>
rep.Representation = "<span class="il">Volume</span>"<br>
<br>
lut = CreateLookupTable()<br>
lut.RGBPoints = [37, 1, 0, 0, 270, 0, 0, 1]<br>
rep.LookupTable = lut<br>
<br>
func = CreatePiecewiseFunction()<br><div class="im">
func.Points = [37, 0, 270, 0.5]<br>
rep.ScalarOpacityFunction = func<br>
<br>
Render()</div><br><br>Goodluck!<br><br>Pat<br><br><div class="gmail_quote">On Tue, Jan 26, 2010 at 2:38 AM, Adebayo Olowoyeye <span dir="ltr"><<a href="mailto:aolowoye@umail.iu.edu">aolowoye@umail.iu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi all,<br> I am attempting to use paraview's library to visualize
medical volumes in an application I am building from scratch. The
program is written in C++. I am having a hard time finding adequate
documentation (forums and examples) that shows how to build an
application that uses paraview's library in C++. I have ran the example
program BasicApp.cxx and it works, but it uses a SphereSource. I am
loading dicom images or .vtk images. When I edit the code for
BasicApp.cxx to load .vtk files I get an error after setting the
representation to volume. From reading similar problems on forums, I
think the problem pertains to colormaps and scalars, but I cannot find
documentation on how to fix this in C++. I'm including my code below. I
may be over complicating this, but any help is appreciated.<br>
Thanks for your time!<br><br>using namespace std;<br><br>// our main
window<br>class MainWindow : public QMainWindow<br>{<br>public:<br>
MainWindow()<br> {<br> // automatically make a server connection<br>
pqApplicationCore* core = pqApplicationCore::instance();<br>
pqObjectBuilder* ob = core->getObjectBuilder();<br> pqServer*
server = ob->createServer(<div>pqServerResource("builtin:"));<br><br>
// create a graphics window and put it in our main window<br>
this->RenderView = qobject_cast<pqRenderView*>(ob->createView(pqRenderView::renderViewType(),
server));<br>
this->setCentralWidget(this->RenderView->getWidget());<br><br>
// create source and elevation filter<br> pqPipelineSource* source;<br>
pqPipelineSource* elevation;<br><br> source =
ob->createSource("sources", "SphereSource", server);<br>
// updating source so that when elevation filter is created, the
defaults<br> // are setup correctly using the correct data bounds
etc.<br> vtkSMSourceProxy::SafeDownCast(source->getProxy())->UpdatePipeline();<br>
<br> QStringList files;<br> files.push_back("../brain.vtk");<br><br>
pqPipelineSource *reader;<br> pqObjectBuilder *builder =
core->getObjectBuilder();<br> reader =
builder->createReader(QString("internal_sources"),
QString("legacyreader"), files, server);<br>
<br><br> pqDataRepresentation *repr =
ob->createDataRepresentation(reader->getOutputPort(0),
this->RenderView);<br><br> if(repr){<br> <br>
vtkSMPropertyHelper(repr->getProxy(), "Representation").Set(vtkSMPVRepresentationProxy::VOLUME);<br>
<br> pqDisplayPolicy pqDisplayP =
core->getDisplayPolicy();<br> repr->getProxy()->UpdateVTKObjects();<br><br>
}<br><br> //elevation = ob->createFilter("filters",
"ElevationFilter", source);<br>
<br> // put the elevation in the window<br> //ob->createDataRepresentation(elevation->getOutputPort(0),
this->RenderView);<br><br> // zoom to sphere<br>
this->RenderView->resetCamera();<br> // make sure we
update<br>
this->RenderView->render();<br> }<br><br>
QPointer<pqRenderView> RenderView;<br><br>};<br>...<br><br>
</div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br>
_______________________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a><br></blockquote></div><br></div></body></html>