[vtkusers] Rendering of deformable volumentric data

David Gobbi david.gobbi at gmail.com
Tue Mar 15 09:40:44 EDT 2011


Hi Dirk,

The texture is just a grid of deformation vectors, so I imagine that you
can create it any way that you like.  My experience with cuda is close
to nil, so I don't know how one would go about mixing cuda with OpenGL.

But simply loading the texture from a C++ program is easy... use
glTexImage3D to create the texture, and glTexSubImage3D every time
you want to update it.  The texture should be RGB where R is X, G is Y,
and B is Z.  Or it could be RGBA where A is an extra scaling factor.

The difficult part is modifying the shaders for the volume rendering so
that they use it, but this should still be much easier than doing everything
from scratch with cuda.

Some of VTK's volume renderers can use multiple color transfer functions,
but I haven't tried it on the GPU volume mapper.

 -  David


On Tue, Mar 15, 2011 at 7:07 AM, Dirk Fortmeier
<fortmeier at imi.uni-luebeck.de> wrote:
> Hi David,
>
> but it should be possible to create this texture describing the
> deformation using cuda? Think I will do as you suggest.
> Here is something else: I think it is not possible to define several
> color transfer functions for a single volume (and selecting the transfer
> function by different labels for the volume), is this true?
>
> Regards,
>
> Dirk
>
> On Wed, 2011-03-09 at 06:53 -0700, David Gobbi wrote:
>> Hi Dirk,
>>
>> The only way to do this as fast as you would need, is to modify an
>> existing vtkVolumeMapper.  I would advise against CUDA since
>> VTK does not use CUDA, so you would have to start from scratch.
>> If you go with shaders, then you can use vtkGPUVolumeMapper
>> as a starting point and add a texture that describes the deformation.
>>
>>  - David
>>
>>
>> On Wed, Mar 9, 2011 at 2:21 AM, Dirk Fortmeier
>> <fortmeier at imi.uni-luebeck.de> wrote:
>> > Hi David,
>> >
>> > that worked as well :) Thanks. I see, this method really isn't as fast
>> > as I need it to be. Since I will only have to deform small parts of the
>> > image data and I need interactivity I probably will have to write some
>> > code, maybe some GPU code... Can I write CUDA Code for this or do I have
>> > to write a shader? Is there a way to work with vtkImageData on the GPU?
>> >
>> > Regards,
>> > Dirk
>> >
>> > On Tue, 2011-03-08 at 05:38 -0700, David Gobbi wrote:
>> >> You should be able to do this by calling Modified() on any of these:
>> >> vtkImageReslice, vtkGridTransform, or the vtkImageData.  You
>> >> probably won't achieve real interactive speeds, though.  For that
>> >> you would have to write a volume mapper that applies the deformation
>> >> as part of the ray cast operation.
>> >>
>> >>  - David
>> >>
>> >>
>> >> On Tue, Mar 8, 2011 at 4:31 AM, Dirk Fortmeier
>> >> <fortmeier at imi.uni-luebeck.de> wrote:
>> >> > Hi David,
>> >> >
>> >> > thanks for the reply, worked out of the box. Now I have the problem that
>> >> > changing the displacement grid interactively does not result in a newly
>> >> > deformed volume. How do I force the pipeline to update?
>> >> >
>> >> > Regards,
>> >> > Dirk
>> >> >
>> >> > On Mon, 2011-03-07 at 13:56 -0700, David Gobbi wrote:
>> >> >> Hi Dirk,
>> >> >>
>> >> >> The vtkGridTransform is can be used to deform a volume, and I have
>> >> >> also written a B-spline transform for VTK that you can find in the VTK
>> >> >> Journal.  You can deform the volume with vtkImageReslice (by setting
>> >> >> the ResliceTransform to a deformable transformation), and then pass the
>> >> >> output of vtkImageReslice to a volume mapper.
>> >> >>
>> >> >>  - David
>> >> >>
>> >> >>
>> >> >> On Mon, Mar 7, 2011 at 3:16 AM, Dirk Fortmeier
>> >> >> <fortmeier at imi.uni-luebeck.de> wrote:
>> >> >> > Hi all,
>> >> >> >
>> >> >> > is there already a way in vtk or vtk-edge to render deformed volumetric
>> >> >> > objects (using a lattice or a field of displacements for instance)? Did
>> >> >> > someone on the list tried to implement something like that?
>> >> >> >
>> >> >> > Regards,
>> >> >> > Dirk
>> >> >> > --
>> >> >> > Dirk Fortmeier <fortmeier at imi.uni-luebeck.de>, PhD Student
>> >> >> >
>> >> >> > Institute of Medical Informatics
>> >> >> > Graduate School for Computing in Medicine and Life Sciences
>> >> >> > University of Lübeck
>> >> >> >
>> >> >> > Building 64, 2F, Room 4
>> >> >> > Ratzeburger Allee 160
>> >> >> > 23538 Lübeck
>> >> >> > Germany
>> >> >> >
>> >> >> > Tel.:+49 (451) 500-5635
>> >> >> > Fax.:+49 (451) 500-5610
>> >> >> >
>> >> >> > _______________________________________________
>> >> >> > 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
>> >> >> >
>> >> >
>> >> > --
>> >> > Dirk Fortmeier <fortmeier at imi.uni-luebeck.de>, PhD Student
>> >> >
>> >> > Institute of Medical Informatics
>> >> > Graduate School for Computing in Medicine and Life Sciences
>> >> > University of Lübeck
>> >> >
>> >> > Building 64, 2F, Room 4
>> >> > Ratzeburger Allee 160
>> >> > 23538 Lübeck
>> >> > Germany
>> >> >
>> >> > Tel.:+49 (451) 500-5635
>> >> > Fax.:+49 (451) 500-5610
>> >> >
>> >> >
>> >
>> > --
>> > Dirk Fortmeier <fortmeier at imi.uni-luebeck.de>, PhD Student
>> >
>> > Institute of Medical Informatics
>> > Graduate School for Computing in Medicine and Life Sciences
>> > University of Lübeck
>> >
>> > Building 64, 2F, Room 4
>> > Ratzeburger Allee 160
>> > 23538 Lübeck
>> > Germany
>> >
>> > Tel.:+49 (451) 500-5635
>> > Fax.:+49 (451) 500-5610
>> >
>> >
>
> --
> Dirk Fortmeier <fortmeier at imi.uni-luebeck.de>, PhD Student
>
> Institute of Medical Informatics
> Graduate School for Computing in Medicine and Life Sciences
> University of Lübeck
>
> Building 64, 2F, Room 4
> Ratzeburger Allee 160
> 23538 Lübeck
> Germany
>
> Tel.:+49 (451) 500-5635
> Fax.:+49 (451) 500-5610
>
>



More information about the vtkusers mailing list