<div dir="ltr">Hi Vincent,<div><br></div><div>Two notes:</div><div><br></div><div>1) you'll have to adjust the Window/Level, using e.g. these:</div><div>extractedActor->GetProperty()->SetColorWindow(4000.0);</div><div>extractedActor->GetProperty()->SetColorLevel(2000.0);<br></div><div><br></div><div>2) the vtkImageActor will only ever show one slice at a time,</div><div>if you want to show the whole volume you will have to use a</div><div>volume mapper.</div><div><br></div><div> - David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 6, 2014 at 3:36 AM, Vincent32160 <span dir="ltr"><<a href="mailto:vsh@magellium.fr" target="_blank">vsh@magellium.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks David.<br>
<br>
I used the objects you pointed and it works but the image is like a contour<br>
and looks to contains no data (black and white picture). Below is the code.<br>
<br>
// Read all the DICOM files in the specified directory.<br>
vtkSmartPointer<vtkDICOMImageReader> reader =<br>
vtkSmartPointer<vtkDICOMImageReader>::New();<br>
reader->SetDirectoryName(directory);<br>
reader->Update();<br>
<br>
// Change the kind of data we handle<br>
vtkSmartPointer<vtkImageShiftScale> scale =<br>
vtkSmartPointer<vtkImageShiftScale>::New();<br>
scale->SetInputConnection(reader->GetOutputPort());<br>
scale->SetOutputScalarTypeToUnsignedShort();<br>
scale->Update();<br>
<br>
vtkROIStencilSource * stencilSource = vtkROIStencilSource::New();<br>
stencilSource->SetShapeToCylinderZ();<br>
stencilSource->SetBounds(scale->GetOutput()->GetBounds());<br>
stencilSource->SetInformationInput(scale->GetOutput());<br>
stencilSource->Print(std::cout);<br>
<br>
vtkImageStencil * stencilFilter = vtkImageStencil::New();<br>
stencilFilter->SetInputConnection(scale->GetOutputPort());<br>
stencilFilter->SetStencilConnection(stencilSource->GetOutputPort());<br>
stencilFilter->Update();<br>
<br>
vtkImageSliceMapper * imageMapper3d = vtkImageSliceMapper::New();<br>
imageMapper3d->SetInputConnection(stencilFilter->GetOutputPort());<br>
<br>
vtkSmartPointer<vtkImageActor> extractedActor =<br>
vtkSmartPointer<vtkImageActor>::New();<br>
extractedActor->SetMapper(imageMapper3d);<br>
<br>
Here is the result:<br>
<<a href="http://vtk.1045678.n5.nabble.com/file/n5729390/output.png" target="_blank">http://vtk.1045678.n5.nabble.com/file/n5729390/output.png</a>><br>
On the left the input volume data (from the DICOM series) and on the right<br>
the display of extractedActor (cf code). I would like to get a part of the<br>
input volume as a result and not a single black and white slice.<br>
<br>
Thanks again.<br>
<br>
Vincent<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Extract-a-tube-of-data-from-DICOM-series-data-tp5729381p5729390.html" target="_blank">http://vtk.1045678.n5.nabble.com/Extract-a-tube-of-data-from-DICOM-series-data-tp5729381p5729390.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the VTK - Users mailing list archive at Nabble.com.<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 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://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>