<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey Adebayo,<div><br></div><div>(Please reply on list so everyone can contribute and learn together.)</div><div><br></div><div>If you go to the Paraview downloads page:</div><div><br></div><div><a href="http://www.paraview.org/paraview/resources/software.html">http://www.paraview.org/paraview/resources/software.html</a></div><div><br></div><div>Down near the bottom of the page there are instructions for downloading (checking out with CVS) the current development distribution (3.7). This will have the Custom Applications Examples folder in the source code, and it is this version that has the ability to build "branded" applications.</div><div><br></div><div>Let us know if you have any trouble,</div><div>-Eric</div><div><br></div><div><br></div><div><div><div>On Mar 2, 2010, at 12:36 AM, Adebayo Olowoyeye wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Thanks for the reply!!<br> The link helps a lot. I do not have the CustomApplications folder in the paraview version I've downloaded (current release). Can you point me in the right direction? <br>Thanks for your time!<br>
<br><br><div class="gmail_quote">On Wed, Jan 27, 2010 at 9:11 AM, Eric E. Monson <span dir="ltr"><<a href="mailto:emonson@cs.duke.edu">emonson@cs.duke.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="word-wrap: break-word;">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" target="_blank">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 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; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div>
------------------------------------------------------</div><div>Eric E Monson</div><div>Duke Visualization Technology Group</div><div><span style="font-size: medium;"><br></span></div></span>
</div><div><div></div><div class="h5">
<br><div><div>On Jan 26, 2010, at 8:24 PM, pat marion wrote:</div><br><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>opacity</span> value of 0, and scalar value 270 is set to the color blue with <span>opacity</span> value 0.5:<br>
<div>
<br>
</div>Wavelet()<br>
rep = Show()<br>
rep.ColorArrayName = "RTData"<br>
rep.Representation = "<span>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>
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" target="_blank">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/" 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>
</blockquote></div><br></div></div></div></div></blockquote></div><br>
</blockquote></div><br></div></body></html>