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

Vincent32160 vsh at magellium.fr
Fri Nov 7 09:29:34 EST 2014


I now have a tube of data. On the right, you see stencilFiltrer2, the result
of two vtkROIStencilSource (the first to remove the outer voxels and the
second the inner)
<http://vtk.1045678.n5.nabble.com/file/n5729402/output3.png> 

I try to use vtkCylindricalTransform and vtkImageReslice to unwrap the tube
and I don't get the result I want. Could you help?

//Image Reslice
vtkCylindricalTransform * cylTransform = vtkCylindricalTransform::New();

vtkImageReslice * imageReslice = vtkImageReslice::New();
imageReslice->SetInputConnection(stencilFilter2->GetOutputPort());
imageReslice->SetResliceTransform(cylTransform->GetInverse());
imageReslice->Update();

// Create volume
vtkSmartPointer<vtkPiecewiseFunction> outputOpacity =
	vtkSmartPointer<vtkPiecewiseFunction>::New();
outputOpacity->AddPoint(-1000, 1.0);
outputOpacity->AddPoint(3000, 0.0);

// Create volume mapper
vtkVolumeRayCastMapper * imageMapper3d = vtkVolumeRayCastMapper::New();
imageMapper3d->SetInputConnection(imageReslice->GetOutputPort());
imageMapper3d->SetVolumeRayCastFunction(rayCastFunction);

// Volume property
vtkSmartPointer<vtkVolumeProperty> outputVolumeProperty =
	vtkSmartPointer<vtkVolumeProperty>::New();
outputVolumeProperty->SetScalarOpacity(outputOpacity);
outputVolumeProperty->SetInterpolationTypeToLinear();
outputVolumeProperty->ShadeOn();

// Displayed volume
vtkSmartPointer<vtkVolume> extractedVol = vtkSmartPointer<vtkVolume>::New();
extractedVol->SetMapper(imageMapper3d);
extractedVol->SetProperty(outputVolumeProperty);

Thanks


David Gobbi wrote
> Hi Vincent,
> 
> Use an opacity transfer function that makes the black voxels transparent.
> 
> You can unwrap the tube by reslicing it through an inverse cylindrical
> transformation (e.g. vtkCylindricalTransform and vtkImageReslice).
> 
>  - David
> 
> On Thu, Nov 6, 2014 at 7:05 AM, Vincent32160 <

> vsh@

> > wrote:
> 
>> Thanks again David!
>>
>> As I want to keep a volume I chose solution 2.
>> I used a volume mapper and the result is pretty good.
>> The only problem is that I am not able to remove the black voxels around
>> the
>> cylinder. (See picture)
>> <http://vtk.1045678.n5.nabble.com/file/n5729393/output2.png>
>>
>> The next step of my approach is to be able to keep only the voxels on the
>> edges (meaning on a tube or hollow cylinder of 1-voxel thickness). And
>> after
>> that I would like to unfold the tube and have a flat surface of pixels.
>> Let me know if you think that it is better to create a new thread for
>> these
>> two next steps.
>>
>> Thanks for your help.
>>
>> Vincent
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://vtk.1045678.n5.nabble.com/Extract-a-tube-of-data-from-DICOM-series-data-tp5729381p5729393.html
>> Sent from the VTK - Users mailing list archive at Nabble.com.
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers





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


More information about the vtkusers mailing list