[vtkusers] Unwrap a cylinder of data using vtkCylindricalTransform and vtkImageReslice

Vincent32160 vsh at magellium.fr
Wed Dec 10 04:39:40 EST 2014


Hi,
I tried to set these three variables. Unfortunately what I got is a simple
slice.

Just to provide the context. 
The original data I am loading are 480 slices of 512x512 pixels with a
spacing of (0.117 ; 0.117; 0.3). In order to get squared voxel I set the
output spacing to (0.117 ; 0.117 ; 0.117) which means that I got a data
which is 512x512x1227 voxels.
When I apply the cylindrical transform to this data, I do not see any slice
with a dimension of 2*pi*radius with 0<radius <256.

Is the order I am setting each variable important?

I ran the code below to have an overview of the data after the cylindrical
transform. I set an output extent bigger than the original data to see if I
got unrolled cylinder plane. 

vtkCylindricalTransform * cylTransform = vtkCylindricalTransform::New();
	
vtkImageReslice * imageReslice = vtkImageReslice::New();
imageReslice->SetInputConnection(imageInfos->GetOutputPort());
imageReslice->SetOutputOrigin(0,0,0);
imageReslice->SetResliceTransform(cylTransform);
imageReslice->SetOutputDimensionality(3);
imageReslice->InterpolateOn();
double outputSpacing[3];
outputSpacing[0] = scale->GetOutput()->GetSpacing()[0]; // radius
outputSpacing[1] = scale->GetOutput()->GetSpacing()[1];; // circumferential
angle
outputSpacing[2] = scale->GetOutput()->GetSpacing()[0]; // longitudinal
sample spacings
imageReslice->SetOutputSpacing(outputSpacing);

int outputExtent[6]; // number of samples
outputExtent[0] = 0;
outputExtent[1] = 600;
outputExtent[2] = 0;
outputExtent[3] = 600;
outputExtent[4] = 0;
outputExtent[5] = 1400;
imageReslice->SetOutputExtent(outputExtent);
imageReslice->Update();

Result :
<http://vtk.1045678.n5.nabble.com/file/n5729771/extent.png> 




--
View this message in context: http://vtk.1045678.n5.nabble.com/Unwrapping-a-cylinder-of-data-using-vtkCylindricalTransform-and-vtkImageReslice-tp5729719p5729771.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list