[vtkusers] vtkImageActor

Mike Gagnon mike at gagnon.com
Tue Sep 17 16:12:29 EDT 2013


Thanks again David,
I think my main issue is I'm only doing 2D stuff in this particular 
renderer.  I was hoping vtk could treat images in a 2D manner if desired.


On 9/17/2013 3:57 PM, David Gobbi wrote:
> Setting the DisplayExtent does not resize the image, it rather
> non-intuitively selects which slice of 3D image to display.  So it
> probably isn't the method you want.
>
> The UserMatrix can resize the image (you can use vtkTransform to build
> a matrix from rotations, scalings, translations, etc).  But depending
> on your application, that might not be what you want to do.  In VTK,
> there are generally two ways that you can change the displayed size or
> position of an object: you can change the position and zoom of the
> camera, or you can change the position and scale of the actor.  So
> before you move forward, consider which is better for your particular
> application.
>
> On Tue, Sep 17, 2013 at 1:22 PM, Mike Gagnon <mike at gagnon.com> wrote:
>> ok thanks I'll do that for its orientation.  But as for the image boundaries
>> and resizing the image, is the matrix also the best bet? I am hoping to
>> align the image perfectly with the bottom left of the renderer and was
>> thinking I could use vtkImageActor::SetDisplayExtent (not getting the right
>> results with that).
>>
>>
>>
>> On 9/17/2013 3:09 PM, David Gobbi wrote:
>>> On Tue, Sep 17, 2013 at 12:26 PM, Mike Gagnon <mike at gagnon.com> wrote:
>>>> Hi,
>>>>
>>>> I'd like to display a bitmap in my renderer - so I do the following:
>>>>
>>>>       m_pImageActor = vtkImageActor::New();
>>>>       m_pBMPReader = vtkBMPReader::New();
>>>>
>>>>       m_pBMPReader->SetFileName(strPath.c_str());
>>>>       m_pImageActor->SetInput(m_pBMPReader->GetOutput());
>>>>
>>>>       m_pRenderer->AddViewProp(m_pImageActor);
>>>>
>>>> The image is added, but I don't know what call I need to orient the image
>>>> and position it...  Can anyone help with this?
>>> I strongly recommend using the actor's SetUserMatrix() method.
>>>
>>>    David
>>
>> _______________________________________________
>> 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