[vtk-developers] A new way to look at images

Dean Inglis dean.inglis at camris.ca
Thu Jan 27 10:09:54 EST 2011


Hi David

thanks for the update, now I'll just git pull instead of downloading.
Great that you got the clipping working on the reslice output!
Looks like you are making that possible with a stencil to mask out the 
reslice background?
I also added a vtkOutlineFilter pipeline to my tcl
example (attached) to show where the reslice output fits into the 3D data 
bounds.
Would it be relatively straightforward to write a mapper that incorporates
vtkImageProjection to do oblique MIPs simulated x-ray projections etc. ?  It 
might be interesting to just
have the plane normal adjustable with the camera focal point fixed at the 3D 
center of
the image volume.

Dean

----- Original Message ----- 
From: "David Gobbi" <david.gobbi at gmail.com>
To: "Dean Inglis" <dean.inglis at camris.ca>
Cc: "VTK Developers" <vtk-developers at vtk.org>
Sent: Wednesday, January 26, 2011 7:42 PM
Subject: Re: [vtk-developers] A new way to look at images


Hi Dean,

I've pushed some image rendering updates to my github account.
This update has two main improvements:

1) InteractorStyleImage has bindings for keys "X", "Y", and "Z" for
setting the orientation.  There are also methods so that you can
set exactly what orientations the "X", "Y", and "Z" stand for.

2) Opacity is fixed.  This also makes image blending possible.

The source can be downloaded from here, using the Download button:
http://github.com/dgobbi/VTK/tree/image-prop
Likewise, the changes can be pulled from git:
git://github.com/dgobbi/VTK.git branch image-prop

 - David

On Sat, Jan 22, 2011 at 8:52 AM, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi Dean,
>
> Thanks for the feedback! I'll add the tcl example to my branch.
>
> The background issue is what I'm working on right now. Early next
> week you should see an option for whether to fill the viewport (the
> current behavior) or to clip at the image bounds.
>
> For the interactor, I can add key bindings for "X", "Y", and "Z" to
> select the view direction. And "R" for re-centering the view.
>
> Did you notice that the example didn't need window/level observers?
> The new InteractorStyleImage automatically finds the "property" object
> and does the adjustment. With the old vtkImageActor, the users had to
> write window/level observers to adjust an external
> vtkImageMapToWindowLevelColors object.
>
> - David
>
> On Sat, Jan 22, 2011 at 8:15 AM, Dean Inglis <dean.inglis at camris.ca> 
> wrote:
>> Hi David,
>>
>> truly amazing! Very easy to scroll or oblique slice. I couldnt see
>> the colored background in the renderer: it seems like the new
>> vtkImage/Mapper
>> takes up the whole viewport? It would be nice to have a reset in the
>> interactor style
>> to reposition the image slice along one of the orthogonal data axes of a 
>> 3D
>> image,
>> but this should be easy to do with a callback.
>> Attached is the tcl version for anyone who wants it.
>>
>> Dean
>>
>> ----- Original Message -----
>> From: Will Schroeder
>> To: David Gobbi
>> Cc: VTK Developers
>> Sent: Saturday, January 22, 2011 9:32 AM
>> Subject: Re: [vtk-developers] A new way to look at images
>> David this is very clever and seems pretty intuitive to use (I did not
>> actually try it).
>> I think my initial (minor) concern is naming, while I think what you've 
>> come
>> up is pretty good I can see how a novice might get confused. Did you
>> consider something like "ImageResliceActor", "ResliceActor" or simply
>> "Reslice"?
>> W
>>
>>
>> On Fri, Jan 21, 2011 at 6:53 PM, David Gobbi <david.gobbi at gmail.com> 
>> wrote:
>>>
>>> Hi All,
>>>
>>> I've been experimenting with a new way of rendering 3D images in VTK.
>>> So far, it is working fairly well. Here is a rough description of the
>>> new VTK classes I've written:
>>>
>>> vtkImage - a new prop for image viewing, analogous to vtkVolume and
>>> vtkActor
>>> vtkImageProperty - holds the lookup table, window/level, etc.
>>> vtkImageMapper3D - a new mapper that does image reslicing and texturing
>>>
>>> Using these classes is very simple: just set up the camera, and the
>>> vtkImage object will automatically display the slice at the camera
>>> focal point. To show a different slice, just move the focal point so
>>> that it lies at a different position in the 3D image. To slice in a
>>> different orientation, rotate the camera around the focal point. In
>>> other words, the slicing is completely controlled by the camera. This
>>> makes everything work nicely with the VTK interactors, and also
>>> simplifies the intermixing of images and geometry.
>>>
>>> My reason for making this class is that I've seen plenty of users on
>>> the list who struggle with vtkImageReslice and with vtkImageViewer. I
>>> wanted to make it as easy to view an image in VTK as it is to view an
>>> actor. I have the code on my github account
>>> git://github.com/dgobbi/VTK.git in the branch "image-prop"
>>> http://github.com/dgobbi/VTK/tree/image-prop
>>>
>>> The code includes a modified vtkInteractorStyleImage class that has
>>> new interactions for rotating the camera with shift-leftbutton (for
>>> oblique slicing) and for adjusting the focal point with
>>> shift-middlebutton (for slicing through the image). There is also a
>>> python example in Examples/ImageProcessing/Python/ImageMapper3D.py.
>>> All of this is still preliminary development, but so far I haven't
>>> encountered any show-stopping bugs.
>>>
>>> Please let me know what you think. I'll try to make a wiki page with
>>> more details next week.
>>>
>>> - David 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ImageMapper3D.tcl
Type: application/octet-stream
Size: 1338 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20110127/b44e85cf/attachment-0001.obj>


More information about the vtk-developers mailing list