Each slice is a single file, all of 'em in a sequence but got them like image1, image2.... image79... so u mean I need to save 'm like image.1 image.2... and so??<div><br><br><div class="gmail_quote">2012/9/25 Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></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'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"><<a href="mailto:lobo.theslayer@gmail.com" target="_blank">lobo.theslayer@gmail.com</a>></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've been reading and testing vtk examples in c++ in order to get into it, but i'm getting stucked in some problem, how do correctly read a series of jpg slices and use them for volume rendering. I've trying to read the directory containing the data but it gives errors, it's like if it were asking for a file like "something.1" instead of waiting for the jpg data set. I've been reading some papers where they use the jpegreader for that but can't get it to work. Any help or advice 'll ve much appreciate.</div>
<div><br></div><div>The errors i'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'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->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->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->SetDataByteOrderToLittleEndian();</div>
<div>//<span style="white-space:pre-wrap">                </span>jpegReader->SetFilePattern("");</div><div><span style="white-space:pre-wrap">                </span>jpegReader->SetFilePrefix("C://VTK5.10//DATA//MatlabTest//JPG//");</div>
<div><span style="white-space:pre-wrap">                </span>jpegReader->SetDataExtent(0, 1280, 0, 1024, 1, 11);</div><div><span style="white-space:pre-wrap">                </span>jpegReader->SetDataSpacing(3.2, 3.2, 20);</div>
<div><span style="white-space:pre-wrap">                </span>jpegReader->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->AddPoint(0, 0.0);</div>
<div><span style="white-space:pre-wrap">                </span>opacityTransferFunction->AddSegment(30, 0.0, 100, 0.9);</div><div><span style="white-space:pre-wrap">                </span>opacityTransferFunction->AddPoint(110, 2.0);</div>
<div><span style="white-space:pre-wrap">                </span>opacityTransferFunction->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->SetScalarOpacity(opacityTransferFunction);</div><div><span style="white-space:pre-wrap">                </span>volumeProperty->ShadeOn();</div>
<div><span style="white-space:pre-wrap">                </span>volumeProperty->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->SetVolumeRayCastFunction(compositeFunction);</div>
<div><span style="white-space:pre-wrap">                </span>volumeMapper->SetInput(jpegReader->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->SetMapper(volumeMapper);</div><div><span style="white-space:pre-wrap">                </span>volume->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->SetViewUp(0,0,1);</div>
<div> camera->SetPosition(0,2,0);</div><div><span style="white-space:pre-wrap">                </span>camera->SetFocalPoint(0,0,0);</div><div><span style="white-space:pre-wrap">                </span>camera->Dolly(0.8);</div>
<div><br></div><div> <span style="white-space:pre-wrap">                </span>aRender->AddVolume(volume);</div><div><span style="white-space:pre-wrap">                </span>aRender->SetBackground(0.5, 0.5, 0.5);</div>
<div><br></div><div><span style="white-space:pre-wrap">                </span>renWin->SetSize(600, 600);</div><div><span style="white-space:pre-wrap">                </span>renWin->Render();</div><div><br></div>
<div><span style="white-space:pre-wrap">                </span>iRen->Initialize();</div><div><span style="white-space:pre-wrap">                </span>iRen->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="'comic sans ms', 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="'comic sans ms', sans-serif" color="#000066">Rodrigo aka WarHearT</font></b><br>
</div>