[vtkusers] SetCutPlane not working in vtkImageResliceMapper

David Gobbi david.gobbi at gmail.com
Sat Oct 20 00:29:36 EDT 2012


Hi Debjit,

You said previously that you were able to set up a plane (origin and
normal) that provided the slice that you needed.  So what you need to
do is set up the camera so that the camera's focal plane is that same
slice, with the focal point set so that the image is properly
centered.

If you are trying to control the camera by doing "Roll" and "Pitch"
you will find it almost impossible to precisely set up the camera so
that it gives your desired slice plane.  You should be setting up the
camera by setting the FocalPoint, Position, and ViewUp.  Think of
these three variables as setting up a plane.  Set the FocalPoint to
the center of the plane.  Set the Position to offset from the
FocalPoint along the plane normal, i.e.:

Position[0] = FocalPoint[0] + distance*normal[0];
Position[1] = FocalPoint[1] + distance*normal[1];
Position[2] = FocalPoint[2] + distance*normal[2];

The "distance" should probably be approximately 400 mm, you can just
call GetDistance() on the camera to use whatever distance it was
already set to.  Finally, set the ViewUp to be a vector parallel to
the slice plane that defines which direction is "up" on the computer
screen.  You'll probably want to leave the ViewUp for last.

It sounds like you were using the tip of the transducer as the
"origin" of your slice, and of course this is not the ideal FocalPoint
if you want the image to be centered.  The FocalPoint can be set to
any (x,y,z) point that lies on your slice of interest, but you really
want to use a point near the center of your volume.  Knowing the one
point on the slice (i.e. the transducer tip) and also knowing the
normal of your slice plane, you should be able to compute another
point on the slice that is close to the center of the volume.  Use
that computed point as the FocalPoint.

For example, let's say you already have a plane defined by "origin"
and "normal".  And let's say that the 3D center of you entire volume
is "center".  Then find the point on the plane that is closest to
"center", and use that as the FocalPoint of the camera.  The
vtkPlane::ProjectPoint() method can do this calculation for you.

If you have some small images, you can always post them to the list.
I generally like to keep the entire discussion on the list, and the
images would be part of the discussion.

 - David


On Fri, Oct 19, 2012 at 5:31 PM, Debjit Ghosh <dghosh at chla.usc.edu> wrote:
> Hi David,
>
> I am having a hard time doing what I need. Here is what I have done:
>
> 1.      I have fixed the focal point (dimX/2, dimY/2, 0) such that in the given
> volume which is a cone, it is at the tip of the cone, and the view up as
> [0,0,-1] so that the display is centered
>               a. But with this I have the problem where the visualization is
> falling in the lower half of the screen and not centered.
>
> 2.      When I am trying to move the position of the camera (I am quite sure at
> this point that I can slice through the image by keeping the focal point and
> the viewup constant and varying the position alone), I have no idea how I
> can roll and pitch my slice, through the image.
>
> To be clear about what I am trying to achieve, finally -> Given that I have
> a conical volume, I need to set the cut plane at the tip of the cone and I
> have a sensor which keeps spitting out the roll, pitch and yaw and as it
> does, I need to be able to slice through the image such that it looks as if
> the user is performing ultrasonography where the screen always shows the
> triangular image.
>
> Following your reply to the email, would it be possible for me to contact
> you directly? I would like to share some images with you which would make my
> question simpler to perceive.
>
> I appreciate your help very much knowing that you have tremendous experience
> in dealing with image volumes.
>
> Regards,
> Debjit
>
> Researcher
> Center for Fetal and Neonatal Medicine
> Virtual Pediatric Intensive Care Unit
> Children’s Hospital Los Angeles
> dghosh at chla.usc.edu | 312.451.6326
>
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/SetCutPlane-not-working-in-vtkImageResliceMapper-tp5716627p5716747.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by 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



More information about the vtkusers mailing list