[vtkusers] SetCutPlane not working in vtkImageResliceMapper

Debjit Ghosh dghosh at chla.usc.edu
Tue Oct 16 14:24:50 EDT 2012


Thanks for the explanation David. I tried it and works the way that you said it would. However, it messes up what I was trying to do. Allow me to explain and your suggestions are very valuable.



I need to extract slices from a given volume as per a position and orientation of a cut plane and display the image on the center of the screen - just like we would see on the screen in ultrasonography as we move the probe around.



Have I been going about the wrong way using the ImageResliceMapper? Or is there a simpler way of going about it?



Thanks.


From: David Gobbi [via VTK] [mailto:ml-node+s1045678n5716657h21 at n5.nabble.com]
Sent: Monday, October 15, 2012 1:58 PM
To: Ghosh, Debjit
Subject: Re: SetCutPlane not working in vtkImageResliceMapper

Just a short addendum to my last email, that might make the
SliceFacesCamera option easier to understand.

When SliceFacesCamera and SliceAtFocalPoint are on, the
vtkImageResliceMapper will automatically set the SlicePlane
to the focal plane.  The "focal plane" is the plane that faces
the camera and passes through the focal point.  In other words,
setting the camera's FocalPoint sets the "Origin" of the slice
plane, and moving the camera's Position relative to the focal
point controls the "Normal" of the slice plane.  The slice is
always facing the camera.

 - David

On Mon, Oct 15, 2012 at 2:23 PM, David Gobbi <[hidden email]</user/SendEmail.jtp?type=node&node=5716657&i=0>> wrote:

> Hi Debjit,
>
> If you want to "slap it to the screen" then you need to use
> SliceFacesCameraOn instead of using the vtkPlane to control the
> slicing.
>
> With SliceFacesCameraOn, you can control the slicing by changing the
> pose of the camera (i.e. by changing the Position, FocalPoint, and
> ViewUp).  With SliceFacesCameraOn, you cannot change the slicing with
> the vtkPlane (because SliceFacesCameraOn overrides the vtkPlane).
> However, from what you are trying to do, it sounds like
> SliceFacesCameraOn + camera positioning is a much better way for you
> to control the slicing than with the vtkPlane.
>
>  - David
>
>
> On Mon, Oct 15, 2012 at 11:56 AM, Debjit Ghosh <[hidden email]</user/SendEmail.jtp?type=node&node=5716657&i=1>> wrote:
>> Thank you very much. You are right!
>>
>>
>>
>> So I turned SliceFacesCamera Off and it SetSlicePlane with a vtkPlane
>> object. Now, though the corresponding slice has been extracted, there are
>> two issues that I face, that I would appreciate your advice on, immensely.
>>
>>
>>
>> - The image is getting visualized as a plane slanted in 3D space which I had
>> to move with Shift + LeftMousePressed to align - How do I slap it onto the
>> screen so it is straight?
>>
>> - I was updating the normal in a Timer and incrementing it to test whether I
>> can do this dynamically and it took effect only the first time
>>
>>
>>
>> Perhaps it's due to my lack of experience in 3D slicing but these are the
>> updates that I have tried calling:
>>
>>
>>
>>                TimerEvent()
>>
>>                {
>>
>>                                              vtkSmartPointer<vtkPlane>
>> slicePlane = vtkSmartPointer<vtkPlane>::New();
>>
>>                                              slicePlane =
>> resliceMapper->GetSlicePlane();
>>
>>                                              slicePlane->Print(std::cout);
>>
>>                                              x+=0.01; y +=0.01; z+=0.01;
>>
>>                                              slicePlane->SetNormal(x, y, z);
>>
>>                                              slicePlane->SetOrigin(103.5,
>> 111.5, 175.5);
>>
>>
>> resliceMapper->SetSlicePlane(slicePlane);
>>
>>
>>
>>                                              resliceMapper->Modified();
>>
>>                                              imageSlice->Render(renderer);
>>
>>
>>
>>                                              renderer->ResetCamera();
>>
>>                                              interactor->Modified();
>>
>>                                              interactor->Render();
>>
>>                }
>>
>>
>>
>> Basically, I have tried all the possible updates that I could :| But in
>> vain. Could you please advise which update needs to be called?
>>
>>
>>
>> Thank you!
>>
>>
>>
>>
>>
>> From: David Gobbi [via VTK] [mailto:ml-node+[hidden email]]
>>
>> Sent: Friday, October 12, 2012 5:23 PM
>> To: Ghosh, Debjit
>> Subject: Re: SetCutPlane not working in vtkImageResliceMapper
>>
>>
>>
>> Hi Debjit,
>>
>> You probably have SliceFacesCamera turned on for the mapper.  This
>> will override any plane that you set manually.
>>
>> If you are using SliceFacesCamera and SliceAtFocalPoint, then the way
>> to change the slice is by changing the camera's position and focal
>> point.
>>
>>  - David
>>
>>
>> On Fri, Oct 12, 2012 at 6:01 PM, Debjit Ghosh <[hidden email]> wrote:
>>> I have been facing an issue where I called the SetSlicePlane(vtkPlane*)
>>> with
>>> a normal and/or an origin but the visualization didn't change. I had
>>> called
>>> the interactor->Render(), called the Modified() on the ImageResliceMapper
>>> but neither made the difference.
>>>
>>> It would be great if someone could tell me what I am missing here.
_______________________________________________
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-tp5716627p5716657.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-tp5716627p5716672.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/20121016/9ea235a4/attachment.htm>


More information about the vtkusers mailing list