[vtkusers] 3D Slicing | vtkImageResliceMapper | No motion of cutplane in one of 3 axes (yaw)

Debjit Ghosh dghosh at chla.usc.edu
Wed Feb 19 18:56:10 EST 2014


Hi David,

Here is the link where I have uploaded the code:

https://www.dropbox.com/sh/jwcsoqyx52b08q3/JVLC4r01T9

If you are able to open the solution in your version of VS, great! If not, you should be able to run the executable from the Debug folder but you would need to move the data folder ("Patients") into the Debug folder.

And if neither of these work here is the link to a video I just uploaded where I have tried my best to show the issue: http://www.youtube.com/watch?v=EW7p4KZDdoM


Notes:

1. The following are the keyboard keys to increase/decrease the Euler angles for the program:
-------------------------------------------
Axes       Key         Increase/Decrease
-------------------------------------------
1             F             +
1             V             -

2             G            +
2             B             -

3             H            +
3             N            -
-------------------------------------------

2. By increasing or decreasing the Euler angles in each of three axes, you will notice that Axis #1 (roll), Axis #2 (pitch) works very well, but Axis #3 has no effect (yaw).

3. Just as a reminder the volume is in the shape of a cone and the tip of the cone is the origin of the slice plane


Regards,
Debjit

From: David Gobbi [via VTK] [mailto:ml-node+s1045678n5725936h70 at n5.nabble.com]
Sent: Friday, February 14, 2014 4:01 PM
To: Ghosh, Debjit
Subject: Re: 3D Slicing | vtkImageResliceMapper | No motion of cutplane in one of 3 axes (yaw)

What version of VS?  I've been working solely on OS X for a while,
so my Windows set-up is very old and very slow.  I have the express
editions of VS2008 and VS2005, but VS2003 is the latest version for
which I have the full commercial edition.

If you want, you can put everything on dropbox or google drive, I might
not be able to run the program but at least I could see the code.

  David

On Fri, Feb 14, 2014 at 4:14 PM, Debjit Ghosh <[hidden email]</user/SendEmail.jtp?type=node&node=5725936&i=0>> wrote:

> Hi David,
>
> In the meantime, I have recreated the problem, isolating it, using keyboard
> keys to increase/decrease the values of roll, pitch and yaw which controls
> the movement of the slice plane. Through this you would be able to see how I
> have used your class to slice through a 4D volume and how the slice plane
> works beautifully in the axes of roll, pitch but does nothing when changed
> in the axis of yaw.
>
> I would like to send you the code/executable along with the volumes for you
> to see what it all looks like if you could tell me how you would like me to
> send it to you.
>
> I have programmed it in VS. The volumes are in the order of 127MB.
>
> Hoping this would be a quick and easy way for you to take a look at the
> problem.
>
> Regards,
> Debjit
>
> On Feb 6, 2014, at 17:55, "David Gobbi [via VTK]" <[hidden email]> wrote:
>
> Hi Debjit,
>
> I've been too busy with work-related projects and haven't been able
> to keep up with the VTK lists lately.  If I have time this weekend, I'll
> read through the emails that you have sent and prepare a reply.
>
>   David
>
>
> On Thu, Feb 6, 2014 at 1:34 PM, Debjit Ghosh <[hidden email]> wrote:
>
>> Hi David,
>>
>>
>>
>> It struck me that perhaps by replying on the thread, you aren't receiving
>> the emails but I am sending them to myself. Please look at this link where
>> I
>> had responded with diagrams to make clear the axes that we were
>> discussing:
>>
>>
>>
>>
>> http://vtk.1045678.n5.nabble.com/3D-Slicing-vtkImageResliceMapper-No-motion-of-cutplane-in-one-of-3-axes-yaw-tp5725426p5725433.html
>>
>>
>>
>> Warm regards,
>>
>> Debjit
>>
>> From: Ghosh, Debjit
>> Sent: Wednesday, January 15, 2014 3:12 PM
>> To: David Gobbi [via VTK]
>>
>>
>> Subject: Re: 3D Slicing | vtkImageResliceMapper | No motion of cutplane in
>> one of 3 axes (yaw)
>>
>>
>>
>>
>>
>> So does this mean that your software has two views, one 3D view and one 2D
>> view?  Where the 2D view shows whatever the plane is slicing through in
>> the
>> 3D view?
>>
>>
>>
>> No it does not. The attached image was to merely show how the system
>> functions. There is the 3D volume the software reads, and only the 2D
>> slice
>> is rendered on the screen ie. the 2D slice is internally what the cut
>> plane
>> slices in the 3D volume.
>>
>>
>>
>> Now you have to explain exactly what axis the "yaw" angle rotates around.
>> In terms of 3D graphics, a "yaw" generally means rotation around the Y
>> axis
>> of the display coordinate system, i.e. around the vertical axis of the
>> camera.  Also, whenever you say "x axis", "y axis", or "z axis" make sure
>> you are clear about whether you are talking about the axes of the data set
>> vs. the axes of the camera vs. the axes of the sensor.  Please don't use
>> terms like "yaw out" because I have no idea what that is supposed to mean.
>>
>>
>>
>> Knowing the confusion of the usage of axes (sensor, camera or data) is why
>> I
>> created a representation of the 3 axes in the attached image and based on
>> that roll is in the Y axis, pitch is in Z and yaw is in X.
>>
>>
>>
>> Pardon my use of "yaw out". If the plane is centered at the tip of the
>> cone,
>> and the plane was to have a yaw motion, it would move like the dial of the
>> pendulum from the inside to the outside of the bounding box.
>>
>>
>>
>>
>>
>> On Wed, Jan 15, 2014 at 3:45 PM, Debjit Ghosh <[hidden email]> wrote:
>>
>> David,
>>
>>
>>
>> I definitely understand.
>>
>>
>>
>> I have attached an image to this email which depicts what I mean by cut
>> plane and what is produced by the positioning of the cut plane. Now, based
>> on the axes drawn in the image, Y would be the axis of Roll, Z would be
>> the
>> axes of Pitch and X would be the axes of Yaw. Now you can imagine the cut
>> plane which is positioned at the tip of the cone to be rolling, pitching
>> and
>> yawing.
>>
>>
>>
>> Now the orientation of the plane is controlled by a 6DOF sensor. So when
>> the
>> sensor rolls, the plane rolls and the image is rendered correspondingly.
>> Similar for pitch. Now when the sensor is yawed, the plane remains
>> stationary - that's the issue at hand. The plane needs to ideally leave
>> the
>> bounds of the box ie. yaw out. As far as pitch is concerned, I have
>> observed
>> the plane moves all the way to the top surface of the box.
>>
>>
>>
>> Does this make sense?
>>
>>
>>
>> From: David Gobbi [via VTK] [mailto:[hidden email][hidden email]]
>>
>> Sent: Wednesday, January 15, 2014 1:24 PM
>> To: Ghosh, Debjit
>> Subject: Re: 3D Slicing | vtkImageResliceMapper | No motion of cutplane in
>> one of 3 axes (yaw)
>>
>>
>>
>> Hi Debjit,
>>
>> Your question is of the sort that is very difficult to understand without
>> some
>> sort of visual aid.  Do you have any diagrams that illustrate exactly what
>> you want to achieve?  Do you have screenshots to demonstrate what the
>> system is doing right now?
>>
>>   David
>>
>> On Wed, Jan 15, 2014 at 12:26 PM, Debjit Ghosh <[hidden email]> wrote:
>>
>>
>>> 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);
_______________________________________________
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/3D-Slicing-vtkImageResliceMapper-No-motion-of-cutplane-in-one-of-3-axes-yaw-tp5725426p5725936.html
To unsubscribe from 3D Slicing | vtkImageResliceMapper | No motion of cutplane in one of 3 axes (yaw), click here<http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5725426&code=ZGdob3NoQGNobGEudXNjLmVkdXw1NzI1NDI2fDEyODQ5NDU0MTA=>.
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/3D-Slicing-vtkImageResliceMapper-No-motion-of-cutplane-in-one-of-3-axes-yaw-tp5725426p5726037.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/20140219/8a1a5b1b/attachment.html>


More information about the vtkusers mailing list