[vtkusers] SetCutPlane not working in vtkImageResliceMapper

Debjit Ghosh dghosh at chla.usc.edu
Wed Mar 27 20:41:15 EDT 2013


I am not sure I explained myself right.

I am currently slicing the volume by setting the camera's Position, Focal
Point and View Up. The normal of the plane is calculated by the sensor's
rotation matrix as follows:

double *default_norm = {0,0,-1};
double *normal;

matrix->MultiplyPoint(this->default_norm, normal);

//Calculate the focal point
double focalPt[3];
double centerofvol[] = {dimX/2, dimY/2, dimZ/2};
vtkSmartPointer<vtkPlane> plane = vtkSmartPointer<vtkPlane>::New();
plane->SetOrigin(dimX/2, dimY/2, 0);
plane->SetNormal(normal);
plane->ProjectPoint( centerofvol, focalPt ); 				

position[0] = focalPt[0] + distfromcam * this->normal[0];
position[1] = focalPt[1] + distfromcam * this->normal[1];
position[2] = focalPt[2] + distfromcam * this->normal[2];
				
cam->SetPosition(position);		//Orientation of the slice plane		
cam->SetFocalPoint(focalPt);	//Point at which my plane is fixed				
cam->SetViewUp(0,0,-1);	

This was working perfectly and I don't need to touch it at all except that,
the echocardiology demands that the volumes be rotated a certain way and
this I do using keyboard units sitting next to an echo expert. So let's say
at (30, 0, 180), the slices are now real as the echocardiogram would have
been and these values are going to be saved for future use. 

Until here the slicing works beautifully. But after I have set the slice's
orientation using RotateX, RotateY, RotateZ the problem starts where the
image is rotating around in the screen or is upside down or diagonal etc
based on the angles the slice has been rotated to.

----------------------------------

>From what you said, and based on what I did, there isn't an anatomical
vector as such to to project to a plane. I would need to find out the view
up vector from the new orientation of the volume and then plug it into the
camera settings in place of leaving it as {0,0,-1}. 

How would I find the view up vector based on the new orientation of the
volume to say (30, 0, 150) or something...?



--
View this message in context: http://vtk.1045678.n5.nabble.com/SetCutPlane-not-working-in-vtkImageResliceMapper-tp5716627p5719682.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list