[vtkusers] Coordinates of VTKImagereslice

N.E. Mackenzie Mackay 9nem at qlink.queensu.ca
Thu May 27 11:10:10 EDT 2004


Hi,

	I am trying to cut through a 3D volume along a certain 2D plane. I am 
having a problem defining the cosines and origin for vtkImageReslice.

Right now I have a origin, normal and two points on the plane in world 
cordinates.  I almost positive these points are correct.  When I use 
these values for image reslice I do not end up with the correct slice:

	vtkImageReslice *slicer = vtkImageReslice::New();
	slicer->SetInput(v16->GetOutput());					// volume
	slicer->setResliceAxesDirectionCosines(point1, point2, normal);
	slicer->SetResliceAxesOrigin(origin);
	slicer->SetOutputDimensionality(2);

I tried multiplying point1, point2, normal and origin by the spacing 
for the volume to try and put them in the same space but still no 
positive results.  I Guess my question is:

	1. What is the coordinate frame vtkImageReslice works in?
	
	2. How does the direction cosines effect the slice that is being cut?
		Eg.  I am taking a 2d slice of a volume.  If I provided the identity 
matrix for the cosines and origin to vtkImageReslice what axis would 
the resulting reslice plane lie on( XY, YZ, XZ ect.)  I assume it's the 
XY plane but I am not sure.
	
	3. Does anyone have some sample code for setting a reslice of a 
specific 2d plane ( defined by a normal, 2 points and a origin)  
through a 3d volume?

If anyone who has some insight on this could please help me out I would 
be in there debt.  This problem has stupped me for quite some time and 
is a big road block.

Thanks you so much in advance,
Neilson
	




More information about the vtkusers mailing list