Color and opacity mapping to a slice in VTK

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Color and opacity mapping to a slice in VTK

Marcus D. Hanwell-2
Hi,

The Tomviz project has had a request to add color and opacity mapping to slices through vtkImageData. The volume mapper does this quite nicely, and they would like to apply the same thing to slices which seems reasonable.

This seems like something that may have already been done before in VTK, has it? I couldn't find it, but in my mind it would extend what we currently do from RGB to RGBA for a texture in a plane (that is the only thing we are interested in at least). It is especially useful where you have a range of values that are effectively background, and we want that to be fully transparent so that the slice doesn't obscure contours, volume rendering, atoms, etc from a tomographic reconstruction.

Thanks for any input, if it doesn't exist yet we will look at the best way of adding it.

Thanks,

Marcus

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Color and opacity mapping to a slice in VTK

David Gobbi
Hi Marcus,

You could try using vtkDiscretizableColorTransferFunction instead of vtkColorTransferFunction.  It can do opacity mapping as well as color mapping, and you should be able to use it anywhere in the VTK imaging pipeline that a lookup table would normally be used.

 - David


On Fri, May 25, 2018 at 1:30 PM, Marcus D. Hanwell <[hidden email]> wrote:
Hi,

The Tomviz project has had a request to add color and opacity mapping to slices through vtkImageData. The volume mapper does this quite nicely, and they would like to apply the same thing to slices which seems reasonable.

This seems like something that may have already been done before in VTK, has it? I couldn't find it, but in my mind it would extend what we currently do from RGB to RGBA for a texture in a plane (that is the only thing we are interested in at least). It is especially useful where you have a range of values that are effectively background, and we want that to be fully transparent so that the slice doesn't obscure contours, volume rendering, atoms, etc from a tomographic reconstruction.

Thanks for any input, if it doesn't exist yet we will look at the best way of adding it.

Thanks,

Marcus


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Color and opacity mapping to a slice in VTK

Marcus D. Hanwell-2
Thanks David, we are already using it, and I had just missed the API to enable it on my first scan through. It looks great, and works really well, thank you for pointing it out!

On Fri, May 25, 2018 at 3:43 PM, David Gobbi <[hidden email]> wrote:
Hi Marcus,

You could try using vtkDiscretizableColorTransferFunction instead of vtkColorTransferFunction.  It can do opacity mapping as well as color mapping, and you should be able to use it anywhere in the VTK imaging pipeline that a lookup table would normally be used.

 - David


On Fri, May 25, 2018 at 1:30 PM, Marcus D. Hanwell <[hidden email]> wrote:
Hi,

The Tomviz project has had a request to add color and opacity mapping to slices through vtkImageData. The volume mapper does this quite nicely, and they would like to apply the same thing to slices which seems reasonable.

This seems like something that may have already been done before in VTK, has it? I couldn't find it, but in my mind it would extend what we currently do from RGB to RGBA for a texture in a plane (that is the only thing we are interested in at least). It is especially useful where you have a range of values that are effectively background, and we want that to be fully transparent so that the slice doesn't obscure contours, volume rendering, atoms, etc from a tomographic reconstruction.

Thanks for any input, if it doesn't exist yet we will look at the best way of adding it.

Thanks,

Marcus



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers