[vtkusers] vtkImageReslice produce wrong output dimension?

TrackVis Admin trackvis at gmail.com
Fri May 31 13:10:15 EDT 2013


Hi all,

I've been trying to use vtkImageReslice to display a 3D image volume as
image slice. Here is what I did:

    vtkImageReslice* reslice = vtkImageReslice::New();
    reslice->SetInput( image_data );
    reslice->BorderOn();
    reslice->AutoCropOutputOn();

    // This sets us to extract slices.
    reslice->SetOutputDimensionality( 2 );

    // This will change depending what orienation we're in.
    reslice->SetResliceAxesDirectionCosines( 1, 0, 0,
        0, 1, 0,
        0, 0, 1 );

    // Image to colors using color table.
    vtkImageMapToColors* colormap = vtkImageMapToColors::New();
    colormap->SetLookupTable( some_lookup_table );
    colormap->SetInputConnection( reslice->GetOutputPort() );

    vtkImageActor* actor = vtkImageActor::New();
    actor->SetInput( colormap->GetOutput() );

Everything appears to be fine until I applied it on a single slice volume.
For example, if the input volume has dimension of 128x128x1. I would expect
it show a thin line on X or Y plane with dimension of 128x1. However, I see
nothing! If I use a volume of 128x128x2, I only see 1 line of pixels on X
or Y plane, where I expect to see 2 lines (128 x 2). Did I do anything
wrong? Why does it look like that 1 slice of the data is missing?

Thank you!
RP
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130531/9440a49c/attachment.htm>


More information about the vtkusers mailing list