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

David Gobbi david.gobbi at gmail.com
Thu Dec 11 08:12:58 EST 2014


Hi Vincent,

The circumferencial spacing is incorrect, because that output dimension
is measured in radians and should have a total range of [0, 2*pi].

However, the image that you attached isn't what I expected so I think
something else is going wrong.  I'll try running this pipeline on my own
machine, but I probably won't be able to do so until the weekend.

 - David


On Wed, Dec 10, 2014 at 2:39 AM, Vincent32160 <vsh at magellium.fr> wrote:

> 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>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141211/4e22fb0e/attachment.html>


More information about the vtkusers mailing list