[vtkusers] SetCutPlane not working in vtkImageResliceMapper
David Gobbi
david.gobbi at gmail.com
Mon Oct 15 16:23:47 EDT 2012
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 <dghosh at chla.usc.edu> 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
>
> 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-tp5716627p5716628.html
>
> To unsubscribe from SetCutPlane not working in vtkImageResliceMapper, click
> here.
> 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: RE: SetCutPlane not working in
> vtkImageResliceMapper
>
> 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