[vtkusers] append colour polydata triangle mesh to greyscale triangle mesh..

Karthik Krishnan karthik.krishnan at kitware.com
Mon Jun 7 03:52:45 EDT 2010


Your best bet is to separate the scalar ranges and use a custom lookup
table, as you've already pointed out below.

If you are familiar enough with creating your own classes in VTK, you could
go for a more elegant solution : Add a boolean data-array attribute
indicating if the data is grayscale or doppler. Then subclass from
vtkLookupTable, and override the method "MapScalarsThroughTable2" so as to
be able to set the appropriate color based on whether the grayscale bit is
set or not.   See vtkLookupTableWithEnabling as an example; it looks up an
"Enabled" array to gray-out output colors based on whether the given value
in EnabledArray is "0" or not.



On Sat, Jun 5, 2010 at 10:18 PM, Gordon Stevenson <
gordon.stevenson at lmh.ox.ac.uk> wrote:

> Hi,
>
> I have two meshes created by using vtkProbeFilter a segmentation of a 3D
> volume of an ultrasound volume, one with the greyscale data and one with the
> Doppler data, I'd like to combine the two meshes into one (the dimensions
> and spacings of the meshes are different), the only problem being that the
> scalar values for the two meshes are the same (unsigned char -> 0..255) .
> What would be the best solution to be able to create a mesh that has both
> greyscale values and color values?
>
> I thought of two methods -- nudging the color values above the current
> 0->255 range, and create a lookuptable or colortransferfunction that takes
> this into account.
>
> Some way of indicating the point is a color or greyscale point and coloring
> appropriately... although I'm not sure about how to implement this.
>
> Would the usergroup have any ideas or tips as how to get going?
>
> Any help would be appreciated,
>
> Gordon.
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100607/dd7fa538/attachment.htm>


More information about the vtkusers mailing list