Each slice is a single file, all of &#39;em in a sequence but got them like image1, image2.... image79... so u mean I need to save &#39;m like image.1 image.2... and so??<div><br><br><div class="gmail_quote">2012/9/25 Bill Lorensen <span dir="ltr">&lt;<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">1) Are all slices in one file?<div>    If so, SetFileDimensionality=3</div><div>    SetFileName to the name of the single file. DO NOT use //, instead use /</div>
<div>2) Is each slice in it&#39;s own file? c:/A/B/foo.1 c:/A/B/foo.2 ...</div>
<div>   SetFilePrefix to c:/A/B/foo.</div><div><br></div><div><br></div><div><div><div class="h5">On Tue, Sep 25, 2012 at 12:37 AM, Rodrigo Lovera <span dir="ltr">&lt;<a href="mailto:lobo.theslayer@gmail.com" target="_blank">lobo.theslayer@gmail.com</a>&gt;</span> wrote:</div>
</div><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">Hello everyone,<div><br></div><div>I&#39;ve been reading and testing vtk examples in c++ in order to get into it, but i&#39;m getting stucked in some problem, how do correctly read a series of jpg slices and use them for volume rendering. I&#39;ve trying to read the directory containing the data but it gives errors, it&#39;s like if it were asking for a file like &quot;something.1&quot; instead of waiting for the jpg data set. I&#39;ve been reading some papers where they use the jpegreader for that but can&#39;t get it to work. Any help or advice &#39;ll ve much appreciate.</div>


<div><br></div><div>The errors i&#39;m getting are the following</div><div><br></div><div><div>ERROR: In C:\Users\RODRIGO LOVERA\Documents\PUCP\Tesis\VTK 5.10\VTK\IO\vtkJPEGReader.cxx, line 93</div><div>vtkJPEGReader (035651B0): Unable to open file C://VTK5.10//DATA//MatlabTest//JPG//.1</div>


<div><br></div><div>ERROR: In C:\Users\RODRIGO LOVERA\Documents\PUCP\Tesis\VTK 5.10\VTK\VolumeRendering\vtkVolumeRayCastMapper.cxx, line 326</div><div>vtkVolumeRayCastMapper (03574310): Cannot volume render data of type short, only unsigned char or unsigned short.</div>


<div><br></div><div>ERROR: In C:\Users\RODRIGO LOVERA\Documents\PUCP\Tesis\VTK 5.10\VTK\VolumeRendering\vtkVolumeRayCastMapper.cxx, line 326</div><div>vtkVolumeRayCastMapper (03574310): Cannot volume render data of type short, only unsigned char or unsigned short.</div>


<div><br></div><div>ERROR: In C:\Users\RODRIGO LOVERA\Documents\PUCP\Tesis\VTK 5.10\VTK\VolumeRendering\vtkVolumeRayCastMapper.cxx, line 326</div><div>vtkVolumeRayCastMapper (03574310): Cannot volume render data of type short, only unsigned char or unsigned short.</div>


</div><div><br></div><div>and the code i&#39;m trying to run is these:</div><div><br></div><div><div>int main()</div><div>{</div><div><span style="white-space:pre-wrap">        </span>vtkRenderer *aRender = vtkRenderer::New();</div>


<div><span style="white-space:pre-wrap">        </span>vtkRenderWindow *renWin = vtkRenderWindow::New();</div><div><span style="white-space:pre-wrap">                </span>renWin-&gt;AddRenderer(aRender);</div>
<div><span style="white-space:pre-wrap">        </span>vtkRenderWindowInteractor *iRen = vtkRenderWindowInteractor::New();</div><div><span style="white-space:pre-wrap">                </span>iRen-&gt;SetRenderWindow(renWin);</div>
<div><span style="white-space:pre-wrap">                </span></div><div><span style="white-space:pre-wrap">                </span>vtkJPEGReader *jpegReader = vtkJPEGReader::New();</div><div><span style="white-space:pre-wrap">                </span>jpegReader-&gt;SetDataByteOrderToLittleEndian();</div>


<div>//<span style="white-space:pre-wrap">                </span>jpegReader-&gt;SetFilePattern(&quot;&quot;);</div><div><span style="white-space:pre-wrap">                </span>jpegReader-&gt;SetFilePrefix(&quot;C://VTK5.10//DATA//MatlabTest//JPG//&quot;);</div>


<div><span style="white-space:pre-wrap">                </span>jpegReader-&gt;SetDataExtent(0, 1280, 0, 1024, 1, 11);</div><div><span style="white-space:pre-wrap">                </span>jpegReader-&gt;SetDataSpacing(3.2, 3.2, 20);</div>
<div><span style="white-space:pre-wrap">                </span>jpegReader-&gt;SetDataOrigin(0, 0, 0);</div><div><span style="white-space:pre-wrap">                </span></div><div><span style="white-space:pre-wrap">        </span></div>
<div><span style="white-space:pre-wrap">                </span>vtkPiecewiseFunction *opacityTransferFunction = vtkPiecewiseFunction::New();</div><div><span style="white-space:pre-wrap">                </span>opacityTransferFunction-&gt;AddPoint(0, 0.0);</div>


<div><span style="white-space:pre-wrap">                </span>opacityTransferFunction-&gt;AddSegment(30, 0.0, 100, 0.9);</div><div><span style="white-space:pre-wrap">                </span>opacityTransferFunction-&gt;AddPoint(110, 2.0);</div>
<div><span style="white-space:pre-wrap">                </span>opacityTransferFunction-&gt;ClampingOn();</div><div><span style="white-space:pre-wrap">                </span></div><div><span style="white-space:pre-wrap">                </span>vtkVolumeProperty *volumeProperty = vtkVolumeProperty::New();</div>


<div><span style="white-space:pre-wrap">                </span>volumeProperty-&gt;SetScalarOpacity(opacityTransferFunction);</div><div><span style="white-space:pre-wrap">                </span>volumeProperty-&gt;ShadeOn();</div>
<div><span style="white-space:pre-wrap">                </span>volumeProperty-&gt;SetInterpolationTypeToLinear();</div><div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">                </span>vtkVolumeRayCastCompositeFunction *compositeFunction = vtkVolumeRayCastCompositeFunction::New();</div>


<div><span style="white-space:pre-wrap">                </span>vtkVolumeRayCastMapper *volumeMapper = vtkVolumeRayCastMapper::New();</div><div><span style="white-space:pre-wrap">                </span>volumeMapper-&gt;SetVolumeRayCastFunction(compositeFunction);</div>


<div><span style="white-space:pre-wrap">                </span>volumeMapper-&gt;SetInput(jpegReader-&gt;GetOutput());</div><div><br></div><div><span style="white-space:pre-wrap">                </span>vtkVolume *volume = vtkVolume::New();</div>
<div><span style="white-space:pre-wrap">                </span>volume-&gt;SetMapper(volumeMapper);</div><div><span style="white-space:pre-wrap">                </span>volume-&gt;SetProperty(volumeProperty);</div><div>
     </div><div><span style="white-space:pre-wrap">                </span>vtkCamera *camera = vtkCamera::New();</div><div><span style="white-space:pre-wrap">                </span>camera-&gt;SetViewUp(0,0,1);</div>
<div>        camera-&gt;SetPosition(0,2,0);</div><div><span style="white-space:pre-wrap">                </span>camera-&gt;SetFocalPoint(0,0,0);</div><div><span style="white-space:pre-wrap">                </span>camera-&gt;Dolly(0.8);</div>
<div><br></div><div> <span style="white-space:pre-wrap">                </span>aRender-&gt;AddVolume(volume);</div><div><span style="white-space:pre-wrap">                </span>aRender-&gt;SetBackground(0.5, 0.5, 0.5);</div>
<div><br></div><div><span style="white-space:pre-wrap">                </span>renWin-&gt;SetSize(600, 600);</div><div><span style="white-space:pre-wrap">                </span>renWin-&gt;Render();</div><div><br></div>
<div><span style="white-space:pre-wrap">                </span>iRen-&gt;Initialize();</div><div><span style="white-space:pre-wrap">                </span>iRen-&gt;Start();</div><div><br></div><div><br></div><div><span style="white-space:pre-wrap">                </span>return 0;</div>


<div><span style="white-space:pre-wrap">                </span></div><div>}</div></div><div><br></div><div>Thx in advance.</div><span><font color="#888888"><div><div><br></div>-- <br><b><font face="&#39;comic sans ms&#39;, sans-serif" color="#000066">Rodrigo Lovera</font></b><br>



</div>
</font></span><br></div></div>_______________________________________________<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 VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br>Unpaid intern in BillsBasement at noware dot com<br><br>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><b><font face="&#39;comic sans ms&#39;, sans-serif" color="#000066">Rodrigo aka WarHearT</font></b><br>
</div>