[vtkusers] Extract a tube of data from DICOM series data

Vincent32160 vsh at magellium.fr
Thu Nov 6 05:36:47 EST 2014


Thanks David.

I used the objects you pointed and it works but the image is like a contour
and looks to contains no data (black and white picture). Below is the code.

// Read all the DICOM files in the specified directory.
vtkSmartPointer<vtkDICOMImageReader> reader =
vtkSmartPointer<vtkDICOMImageReader>::New();
reader->SetDirectoryName(directory);
reader->Update();

// Change the kind of data we handle
vtkSmartPointer<vtkImageShiftScale> scale =
vtkSmartPointer<vtkImageShiftScale>::New();
scale->SetInputConnection(reader->GetOutputPort());
scale->SetOutputScalarTypeToUnsignedShort();
scale->Update();

vtkROIStencilSource * stencilSource = vtkROIStencilSource::New();
stencilSource->SetShapeToCylinderZ();
stencilSource->SetBounds(scale->GetOutput()->GetBounds());
stencilSource->SetInformationInput(scale->GetOutput());
stencilSource->Print(std::cout);
	
vtkImageStencil * stencilFilter = vtkImageStencil::New();
stencilFilter->SetInputConnection(scale->GetOutputPort());
stencilFilter->SetStencilConnection(stencilSource->GetOutputPort());
stencilFilter->Update();

vtkImageSliceMapper * imageMapper3d = vtkImageSliceMapper::New();
  imageMapper3d->SetInputConnection(stencilFilter->GetOutputPort());

vtkSmartPointer<vtkImageActor> extractedActor =
vtkSmartPointer<vtkImageActor>::New();
  extractedActor->SetMapper(imageMapper3d);

Here is the result:
<http://vtk.1045678.n5.nabble.com/file/n5729390/output.png> 
On the left the input volume data (from the DICOM series) and on the right
the display of extractedActor (cf code). I would like to get a part of the
input volume as a result and not a single black and white slice.

Thanks again.

Vincent




--
View this message in context: http://vtk.1045678.n5.nabble.com/Extract-a-tube-of-data-from-DICOM-series-data-tp5729381p5729390.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list