[vtkusers] Extracting a Slice from a volume in different orientation
cspl
affable at hd2.dot.net.in
Thu Jul 18 06:59:42 EDT 2002
Dear Friends,
How to extract a slice from volume in different orientation like sagital,axial,frontal.I am using vtkimageclip ,but I am not getting exact output.what should I do.If u know please give me suggestion
I have written code as follows.
vtkImageReader *reader=vtkImageReader::New();
reader->ReleaseDataFlagOff();
reader->SetDataByteOrderToLittleEndian();
reader->SetDataExtent(0,255,0,255,1,93);
reader->SetFilePrefix("c:\\dicomfiles\\download\\");
reader->SetFilePattern("%s%d.raw");
reader->SetDataMask(0x7fff);
vtkImageClip *clip = vtkImageClip::New();
clip->SetInput(reader->GetOutput());
clip->SetOutputWholeExtent(10,10,0,255,0,92);
clip->ClipDataOn();
clip->ReleaseDataFlagOff();
vtkImageViewer *viewer=vtkImageViewer::New();
viewer->SetInput(clip->GetOutput());
viewer->SetZSlice(10);
viewer->SetColorWindow(1000);
viewer->SetColorLevel(500);
viewer->Render();
Thanking you,
Regards,
Ramakrishna
----- Original Message -----
From: Amy Henderson
To: cspl ; vtkusers at public.kitware.com
Sent: Wednesday, July 17, 2002 6:35 PM
Subject: Re: [vtkusers] Extracting a Slice from a volume in different orientation
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020718/28adae95/attachment.htm>
More information about the vtkusers
mailing list