<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear Friends,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>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</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>I have written code as follows.</FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR> vtkImageReader
*reader=vtkImageReader::New();<BR> reader->ReleaseDataFlagOff();<BR> reader->SetDataByteOrderToLittleEndian();<BR> reader->SetDataExtent(0,255,0,255,1,93);<BR> reader->SetFilePrefix("c:\\dicomfiles\\download\\");<BR> reader->SetFilePattern("%s%d.raw");<BR> reader->SetDataMask(0x7fff);</DIV>
<DIV> </DIV>
<DIV><BR> vtkImageClip *clip =
vtkImageClip::New();<BR> clip->SetInput(reader->GetOutput());<BR> clip->SetOutputWholeExtent(10,10,0,255,0,92);<BR> clip->ClipDataOn();<BR> clip->ReleaseDataFlagOff();</DIV>
<DIV> </DIV>
<DIV> vtkImageViewer
*viewer=vtkImageViewer::New();<BR> viewer->SetInput(clip->GetOutput());<BR> viewer->SetZSlice(10);<BR> viewer->SetColorWindow(1000);<BR> viewer->SetColorLevel(500);<BR> viewer->Render(); </DIV>
<DIV> </DIV>
<DIV><BR>Thanking you,<BR>Regards,<BR>Ramakrishna<BR></FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=amy.henderson@kitware.com href="mailto:amy.henderson@kitware.com">Amy
Henderson</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=affable@hd2.dot.net.in
href="mailto:affable@hd2.dot.net.in">cspl</A> ; <A
title=vtkusers@public.kitware.com
href="mailto:vtkusers@public.kitware.com">vtkusers@public.kitware.com</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, July 17, 2002 6:35
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [vtkusers] Extracting a
Slice from a volume in different orientation</DIV>
<DIV><BR></DIV>At 06:21 PM 7/17/2002 +0530, cspl wrote:<BR>
<BLOCKQUOTE class=cite cite type="cite"><FONT face=arial size=2>Dear
Friends,</FONT><BR> <BR><FONT face=arial size=2>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.</FONT><BR> <BR><FONT face=arial size=2>Thanking
you,</FONT><BR> <BR><FONT face=arial
size=2>Regards,<BR>Ramakrishna</FONT></BLOCKQUOTE><BR>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).<BR><BR>-
Amy<BR></BLOCKQUOTE></BODY></HTML>