[vtkusers] How to transform the GetOutput of vtkCutter to 2D image?

Stefan Bruckner stefan.bruckner at chello.at
Mon Feb 3 18:34:34 EST 2003


For extracting volume slices, vtkImageReslice is the approriate class.
It allows you to extract an arbitrary slice from a volume and has a
vtkImageData output. Just have a look at the documentation. Hope this
helps.

Sample code for slice in in x/y/z direction:

double position = 64.0; // Slice position
int axis = 0; // Axis

pImageReslice->SetResliceAxesOrigin(position);

if (axis == 0)
{
      pImageReslice->SetResliceAxesDirectionCosines(0.0,0.0,1.0,
                                                  0.0,1.0,0.0,
                                                  1.0,0.0,0.0);
}
else if (axis == 1)
{
      pImageReslice->SetResliceAxesDirectionCosines(1.0,0.0,0.0,
                                                  0.0,0.0,1.0,
                                                  0.0,1.0,0.0);
}
else if (axis == 2)
{
      pImageReslice->SetResliceAxesDirectionCosines(1.0,0.0,0.0,
                                                  0.0,1.0,0.0,
                                                  0.0,0.0,1.0);
}

--
Stefan Bruckner

Am Mon, 2003-02-03 um 18.13 schrieb Chunyan Jiang:
> 
> 
> 
> 
> Dear vtk-users,
> I use vtkCutter to slice a volume. And I want to show this slice as a 2D
> image. How can I transform vtkCutter->GetOutput() to a vtkImageData?
> 
> The following is my cut code:
>     vtkCutter *planeCut=vtkCutter::New();
>     planeCut->SetInput(VolumeData);
>     planeCut->SetCutFunction( ClipPlane);
> 
> 
> Thanks a lot!
> 
> Chunyan
> ***********************************************************************
> Chunyan Jiang, Dipl.-Inform.,
> Institut for Telematic
> Bahnhofstrasse 30-32, D-54292 Trier, Germany
> Phone: (+49) (0)651-97551-34
> Fax: (+49) (0)651-97551-12
> ***********************************************************************
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers





More information about the vtkusers mailing list