[vtkusers] Sliced image position

Ale notinmyhead at gmail.com
Mon Jul 16 04:21:05 EDT 2012


Hello...

I think you just miss a reslice->Update() at the end of the pipeline...

Best regards,
Ale

Il giorno 13/lug/2012, alle ore 16.12, Jothybasu Selvaraj ha scritto:

> Hi guys,
> 
> I am trying to slice a vtkImaegData in axial, sag and coronal orientations.
> 
> I am using vtkImageReslice for doing this
> 
> I am using the below code for doing coronal slicing, but the image
> actor stays always at the origin instead of moving to the slices
> position.
> 
> I think I am doing something wrong with the matrices.
> 
> Can anyone point out what's wrong?
> 
> / Matrix for  sagittal
>       static double coronalElements[16] = {
>           1, 0,0, 0,
>           0, 0,1, 0,
>           0,-1, 0, 0,
>           0, 0, 0, 1 };
> 
> 
>      // Set the slice orientation
>        vtkSmartPointer<vtkMatrix4x4> resliceAxes =
>          vtkSmartPointer<vtkMatrix4x4>::New();
>        resliceAxes->DeepCopy(coronalElements);
>        resliceAxes->SetElement(0, 3,0 );
>        resliceAxes->SetElement(1, 3,sliceNo);
>        resliceAxes->SetElement(2, 3,0 );
> 
>        // Extract a slice in the desired orientation
>        vtkSmartPointer<vtkImageReslice> reslice =
>          vtkSmartPointer<vtkImageReslice>::New();
>        reslice->AddInput(imgData);
>        reslice->SetOutputDimensionality(2);
>        reslice->SetResliceAxes(resliceAxes);
>        reslice->SetInterpolationModeToCubic();
> 
> Thanks
> 
> -- 
> Jothybasu Selvaraj
> PhD Student
> University of Liverpool
> UK
> _______________________________________________
> 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://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list