[vtkusers] SetCutPlane not working in vtkImageResliceMapper

Debjit Ghosh dghosh at chla.usc.edu
Thu Mar 28 12:35:57 EDT 2013


Hi David,

I had been trying to do that where in I got the orientation from the vtkImageSlice (I wish it returned the orientation as a rotation matrix but I wrote the wiki convert Euler-Rotation matrix code) but now that you are speaking of the same solution, I think I would look into what I was doing again and perhaps there was something slightly off.

Thank you for your advice! I would take every word of it! :)

On Mar 28, 2013, at 8:47, "David Gobbi [via VTK]" <ml-node+s1045678n5719693h37 at n5.nabble.com<mailto:ml-node+s1045678n5719693h37 at n5.nabble.com>> wrote:

On Wed, Mar 27, 2013 at 6:41 PM, Debjit Ghosh <[hidden email]</user/SendEmail.jtp?type=node&node=5719693&i=0>> wrote:

> 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...?

If you already had a system where the view up vector was set correctly
before the rotation was applied, then can't you just apply the rotation to
vector you use as the view up vector?

I always think of these visualization problems by considering what
my degrees of freedom are, and what my constraints are.  As long as
I'm doing all my rotations with either matrices or quaternions, the math
works out nicely because everything is linear.  I almost never express
orientations as a series of x,y,z rotations because it makes the math
much more complicated...

 - David
_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers


________________________________
If you reply to this email, your message will be added to the discussion below:
http://vtk.1045678.n5.nabble.com/SetCutPlane-not-working-in-vtkImageResliceMapper-tp5716627p5719693.html
To unsubscribe from SetCutPlane not working in vtkImageResliceMapper, click here<http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5716627&code=ZGdob3NoQGNobGEudXNjLmVkdXw1NzE2NjI3fDEyODQ5NDU0MTA=>.
NAML<http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


---------------------------------------------------------------------
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, 
is for the sole use of the intended recipient(s) and may contain confidential
or legally privileged information. Any unauthorized review, use, disclosure
or distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of this original message.  

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





--
View this message in context: http://vtk.1045678.n5.nabble.com/SetCutPlane-not-working-in-vtkImageResliceMapper-tp5716627p5719696.html
Sent from the VTK - Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130328/fbf0af23/attachment.htm>


More information about the vtkusers mailing list