Fwd: Re: [vtkusers] Extracting a Slice from a volume in different orientation

Amy Henderson amy.henderson at kitware.com
Wed Jul 17 12:54:19 EDT 2002


I think this was intended to go to the list, not just to me.

>X-Originating-IP: [129.100.98.63]
>From: "Yuan Jin" <yjin76 at hotmail.com>
>To: amy.henderson at kitware.com
>Bcc:
>Subject: Re: [vtkusers] Extracting a Slice from a volume in different 
>orientation
>Date: Wed, 17 Jul 2002 15:57:00 +0000
>X-OriginalArrivalTime: 17 Jul 2002 15:57:00.0637 (UTC) 
>FILETIME=[962320D0:01C22DAA]
>
>
>try:
>
>        resliceY = vtkImageReslice()
>        resliceY.SetInput(self.reader.GetOutput())
>        resliceY.InterpolateOn()
>
>        matrixY = vtkMatrix4x4()
>        matrixY.SetElement(0,0,0)
>        matrixY.SetElement(0,1,0)
>        matrixY.SetElement(0,2,-1)
>        matrixY.SetElement(2,0,1)
>        matrixY.SetElement(2,1,0)
>        matrixY.SetElement(2,2,0)
>
>        resliceY.SetResliceAxes(matrixY)
>        resliceY.SetOutputSpacing(1.0,1.0,1.0)
>
>        self.mapperY = vtkImageMapper()
>        self.mapperY.SetInput(resliceY.GetOutput())
>
>        self.mapperY.SetZSlice(50)
>
>        self.actorY = vtkActor2D()
>        self.actorY.SetMapper(self.mapperY)
>
>        self.renY.AddActor2D(self.actorY)
>
>
>
>>From: Amy Henderson <amy.henderson at kitware.com>
>>To: "cspl" <affable at hd2.dot.net.in>, <vtkusers at public.kitware.com>
>>Subject: Re: [vtkusers] Extracting a Slice from a volume in different
>>orientation
>>Date: Wed, 17 Jul 2002 09:05:34 -0400
>>
>>At 06:21 PM 7/17/2002 +0530, cspl wrote:
>>>Dear Friends,
>>>
>>>How to extract an Image from a volume in orientations
>>>sagital(height),coronal(volwidth),transverse(depth). Is there any suitable
>>>class or method in VTK.
>>>
>>>Thanking you,
>>>
>>>Regards,
>>>Ramakrishna
>>
>>Try using vtkImageClip.  Use the SetOutputWholeExtent method that takes 6
>>parameters (min and max in each of X, Y, and Z directions).  To extract a
>>slice in a particular direction, set the min and max values for that
>>dimension to be the same value (the slice number you want).  For example,
>>if your data has dimensions 128 x 128 x 30, and you want to extract slice
>>50 in X, call SetOutputWholeExtent(50, 50, 0, 127, 0, 29).
>>
>>- Amy
>
>
>
>
>_________________________________________________________________
>Chat with friends online, try MSN Messenger: http://messenger.msn.com






More information about the vtkusers mailing list