Hi,<br><br>You should include the exact error message you are getting so that people can help.<br><br>I&#39;m not very familiar with building custom apps using paraview so I won&#39;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&#39;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 = &quot;RTData&quot;<br>
rep.Representation = &quot;<span class="il">Volume</span>&quot;<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">&lt;<a href="mailto:aolowoye@umail.iu.edu">aolowoye@umail.iu.edu</a>&gt;</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&#39;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&#39;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&#39;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-&gt;getObjectBuilder();<br>    pqServer* 
server = ob-&gt;createServer(<div>pqServerResource(&quot;builtin:&quot;));<br><br>   
 // create a graphics window and put it in our main window<br>    
this-&gt;RenderView = qobject_cast&lt;pqRenderView*&gt;(ob-&gt;createView(pqRenderView::renderViewType(),
 server));<br>
    this-&gt;setCentralWidget(this-&gt;RenderView-&gt;getWidget());<br><br>   
 // create source and elevation filter<br>    pqPipelineSource* source;<br>   
 pqPipelineSource* elevation;<br><br>    source = 
ob-&gt;createSource(&quot;sources&quot;, &quot;SphereSource&quot;, 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-&gt;getProxy())-&gt;UpdatePipeline();<br>
<br>    QStringList files;<br>    files.push_back(&quot;../brain.vtk&quot;);<br><br>   
 pqPipelineSource *reader;<br>    pqObjectBuilder *builder = 
core-&gt;getObjectBuilder();<br>    reader = 
builder-&gt;createReader(QString(&quot;internal_sources&quot;), 
QString(&quot;legacyreader&quot;), files, server);<br>
<br><br>    pqDataRepresentation *repr = 
ob-&gt;createDataRepresentation(reader-&gt;getOutputPort(0), 
this-&gt;RenderView);<br><br>    if(repr){<br>         <br>        
vtkSMPropertyHelper(repr-&gt;getProxy(), &quot;Representation&quot;).Set(vtkSMPVRepresentationProxy::VOLUME);<br>
       <br>        pqDisplayPolicy pqDisplayP = 
core-&gt;getDisplayPolicy();<br>        repr-&gt;getProxy()-&gt;UpdateVTKObjects();<br><br>   
 }<br><br>    //elevation = ob-&gt;createFilter(&quot;filters&quot;, 
&quot;ElevationFilter&quot;, source);<br>
<br>    // put the elevation in the window<br>    //ob-&gt;createDataRepresentation(elevation-&gt;getOutputPort(0),
 this-&gt;RenderView);<br><br>    // zoom to sphere<br>    
this-&gt;RenderView-&gt;resetCamera();<br>    // make sure we 
update<br>
    this-&gt;RenderView-&gt;render();<br>  }<br><br>  
QPointer&lt;pqRenderView&gt; 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>