AW: [vtkusers] How to transform the GetOutput of vtkCutter to 2Dimage?

Chunyan Jiang jiang at Telematik-Institut.de
Tue Feb 4 04:53:08 EST 2003


Stefan,
Thank you for your suggestion. I also plan to use vtkImageReslice to realize
it. However, I only have one plane including its normal and origin. I want
to use this plane to slice the volume. How should I set
SetResliceAxesDirectionCosines()? Is there some easy way to do it?


Chunyan


-----Ursprüngliche Nachricht-----
Von: Stefan Bruckner [mailto:stefan.bruckner at chello.at]
Gesendet: Dienstag, 4. Februar 2003 00:35
An: Chunyan Jiang
Cc: vtkusers at public.kitware.com
Betreff: Re: [vtkusers] How to transform the GetOutput of vtkCutter to
2Dimage?


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