[vtkusers] 3D Slicing | vtkImageResliceMapper | No motion of cutplane in one of 3 axes (yaw)
Debjit Ghosh
dghosh at chla.usc.edu
Wed Jan 15 14:26:21 EST 2014
I have been using the vtkImageResliceMapper to slice through a 3D volume
using the following logic (thanks to David Gobbi) where I am able to slice
in 2 out of 3 axes only. When I change the orientation of the slice in the
yaw direction there is no movement of the cut plane. I am not sure what I am
doing incorrectly here or whether this is a limitation of the system.
Here is the code snippet which implements the slicing using the camera and I
wonder if it has to do with the default_norm that I have set to [0,0,1]:
matrix_= imageslice->GetMatrix();
matrix_->MultiplyPoint(default_viewup, this->view_up);
//matrix is a 3x3 rotation matrix which defines the orientation of the
cutplane
matrix->MultiplyPoint(this->default_norm, this->normal);
double focalPt[] = {0,0,0};
double centerofvol[] = {dimX/2, dimY/2, dimZ/2}; double origin[] = {dimX/2,
dimY/2, 0};
vtkSmartPointer<vtkPlane> plane = vtkSmartPointer<vtkPlane>::New();
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(this->view_up);
cam->SetWindowCenter(win_center_x, win_center_y);
--
View this message in context: http://vtk.1045678.n5.nabble.com/3D-Slicing-vtkImageResliceMapper-No-motion-of-cutplane-in-one-of-3-axes-yaw-tp5725426.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list