hi all,<div><br></div><div>I would appreciate if someone can give me some insight on how to use vtkImageReslice in a proper way. I believe vtkImageReslice has all the functionality for what I need to do but I have hard time figuring out how to use it properly.</div>
<div><br></div><div>Objective: extract a sub-region of a known 2D geometry on an oblique plane that slices through a 3D volume, and save the output as an 2D image of certain size (in pixel) for image-processing.</div><div>
<br></div><div>What I can do now: extract the entire oblique slice using the following code in python:</div>
<div><br></div><div><div><br></div><div>CTReslice = vtk.vtkImageReslice()</div><div>CTReslice.SetInputConnection( CTReader.GetOutputPort() )</div><div>CTReslice.SetOutputDimensionality( 2 )</div><div>CTReslice.SetInterpolationModeToLinear()</div>
<div>CTReslice.SetOutputSpacing( sx, sy, sz )</div></div><div><div>CTReslice.SetResliceAxes( Transform.GetMatrix() )</div><div><br></div><div><br></div><div>the Transform basically specifies the origin and the DirectionCosines (correct me if I am wrong) of which the oblique plane lies. This gave me the entire oblique slice of the CT volume. I could also specify the origin/point1/point2/normal of the oblique plane which gave me the same result as SetResliceAxes</div>
<div><br></div><div><br></div></div><div>What I like to do: extract a sub-image on the oblique plane with a known geometry (say, a 640x480 rectangular region). The geometry can be specified as polydata which by design lies on on the oblique plane.</div>
<div><br></div><div>
Questions:</div><div><br></div><div>- how is CTReslice.Getoutput() oriented about the normal of the oblique plane? Does a programmer has a control of that?</div><div><br></div><div>- Why is the GetOutputExtent() and GetOutputOrigin() not updated? According to the html documentation, the default output extent/origin is the input extend/origin permuted through the ResliceAxes, and yet when I look at these values they are (appeared to be) VTK_INT_MIN/MAX/VTK_DOUBLE_MAX</div>
<div><br></div><div>- I thought about the using vtkImageClip on CTReslice.GetOutput() but there will be situation in which the geometry that I want to clip the image lies *outside* of the extent of the input 3D volume. Will vtkImageClip still work property since it only makes the extent smaller?</div>
<div><br></div><div>I would really appreciate if someone can shed lights into this matter.</div><div><br></div><div>thanks in advance,</div><div><br></div>
<div><br></div><div><br></div>