[vtkusers] 3D-position of vtkImageReslice
Henning Meyer
tutmann at gmail.com
Mon Mar 29 13:53:27 EDT 2010
Hello,
another thing regarding this is bugging me:
When setting a large zoom factor by vtkImageReslice::SetResliceAxes -
the OutputExtent is not adjusted correctly - so a way to large image
is displayed (basically the whole image - with a huge size). What
would be the proper way to adjust the OutputExtent? Could this be seen
as a bug in vtkImageResclice?
Henning
2010/3/25 Xiaofeng Z <xf10036 at hotmail.com>:
> It took me a day to figure out:
>
> // first convert from display to world in the resliced coordinate
> vtkRenderer& rndr =
> *interactor->GetRenderWindow()->GetRenderers()->GetFirstRenderer();
> rndr.SetDisplayPoint(currPos[0], currPos[1], 0);
> rndr.DisplayToWorld();
> double point[4];
> rndr.GetWorldPoint(point);
> // the value in the third component is fake, why???
> point[2] = 0.0;
>
> // next, convert back to the original vtkImageData coordinate system
> vtkImageReslice* reslice = ImageReslice;
> reslice->GetOutput()->UpdateInformation();
> vtkImageData& slice = *reslice->GetOutput();
> vtkMatrix4x4 *matrix = reslice->GetResliceAxes();
> double center[4];
> matrix->MultiplyPoint(point, center);
>
>
> Hope this works!
>
> Xiaofeng Zhao
>
>
>
>> Date: Wed, 24 Mar 2010 16:09:57 -0400
>> From: tutmann at gmail.com
>> To: vtkusers at vtk.org
>> Subject: [vtkusers] 3D-position of vtkImageReslice
>>
>> Hello,
>>
>> I'm building an application based on ImageProcessing/Cxx/ImageSlicing.cxx.
>> Currently I'm on my way of writing my own interactor style in order to
>> have more flexible interaction freedom.
>>
>> Rotation, windowing and zoom works fine - but now I want to move my
>> Volume by dragging the mouse. The movement should be in sync with the
>> mouse motion.
>> Therefore I'd like to find out the real 3D-Position (in the volume) of
>> the EventPosition and the LastEventPosition.
>> But I don't know how to do that. The Display chain is like:
>>
>> vtkImageData -> vtkImageReslice -> vtkImageMapToColors ->
>> vtkImageActor -> vtkRenderer -> vtkViewPort
>>
>>
>> How can I find out the amount of translation that has to be applied to
>> the ResliceAxes-Matrix? (I already have the right direction - am just
>> missing the scaling value of the translation).
>>
>>
>> Thank you for your help!
>>
>> Henning
>> _______________________________________________
>> 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
>
> ________________________________
> Hotmail is redefining busy with tools for the New Busy. Get more from your
> inbox. Sign up now.
More information about the vtkusers
mailing list