[vtk-developers] New vector modes for vtkScalarsToColors

Nicolas Rannou Nicolas_Rannou at hms.harvard.edu
Thu Apr 28 11:36:14 EDT 2011


Hi David,

 

Sorry for the late reply... We are now ready to step into this problem.

We have N images corresponding to N channels.

Our first idea was to do:

===========================================================

Image 1-------> vtkImageMapToColors---->
LUT 1    ------->                                                    |

                                                                              |

Image 2-------> vtkImageMapToColors---->|---> vtkImageBlend?
LUT 2   ------->                                                    |       vtkImageAppendComponent?

                                                                             |

                                                                             |

…                                                                         |

                                                                             |

Image N-------> vtkImageMapToColors--->
LUT N    ------->

 ===========================================================

However your suggestion seems very interesting and more efficient.

 =========================================================== 

LUT 1------>

LUT 2------> SetLookupTableForChannel()?--> 1 LUT ------>

…                                                                                                       |

LUT N----->                                                                                       |----> vtkImageMapToColors

                                                                                                           |

Image 1-------->                                                                                |

Image 2--------> vtkImageBlend?-------------------> 1 Image -->

…                         vtkImageAppendComponent?

Image N------->

===========================================================

Is it what you suggested or did I misunderstand you?
You advised to implement SetLookupTableForChannel() in vtkScalarsToRGB but I’m concerned if it is the good place for it to be.

Shouldn’t we create a new class similarly as vtkLogLookupTable, called vtkMultiLookupTable? (open to any suggestion), which inherits from vtkLookupTable?

Would you recommend us to use vtkImageBlend or vtkImageAppendComponent?

 

Thanks!

 

Nicolas

 

 

On Mar 1, 2011, at 1:20 PM, David Gobbi wrote:

> I've pushed my vtkScalarsToColors changes to VTK's git master,
> so it is best if you start from there and then push your changes
> to gerrit or just email a patch to the list.
> 
> - David
> 
> 
> On Tue, Mar 1, 2011 at 11:11 AM, Arnaud GELAS
> <arnaud_gelas at hms.harvard.edu> wrote:
>> David,
>> 
>> This is something we would need anyway for our project.
>> So we would be happy to contribute such a feature to VTK!
>> 
>> Where is it developed?
>> on your github's fork? which branch?
>> 
>> Thanks,
>> Arnaud
>> 
>> On 03/01/2011 11:10 AM, David Gobbi wrote:
>>> 
>>> Yes, the thought has crossed my mind... I've had to work with
>>> multi-channel images in the past.
>>> 
>>> These methods could be added to vtkScalarsToColors:
>>>   SetVectorModeToIndependent()
>>>   SetLookupTableForChannel(vtkScalarsToColors *colors, int channel)
>>> 
>>> When in this Independent mode, each component could be mapped through
>>> one of the "child" lookup tables.  The colors from each channel would
>>> then be summed and clamped.
>>> 
>>> If you are willing to add a feature like this, I'll gladly help to get
>>> it integrated.
>>> 
>>>  - David
>>> 
>>> 
>>> On Tue, Mar 1, 2011 at 8:27 AM, Arnaud GELAS
>>> <arnaud_gelas at hms.harvard.edu>  wrote:
>>>> 
>>>> David,
>>>> 
>>>> Currently, in the field of microscopy we can have up to 32 channels
>>>> (components) images, and for each channel we have an associated color.
>>>> (Although, most of the time people use less than 6 channels.)
>>>> 
>>>> Do you think it would be possible to make a more general mode for such
>>>> color
>>>> spaces?
>>>> 
>>>> Arnaud
>>>> 
>>>> On 02/28/2011 12:39 PM, David Gobbi wrote:
>>>>> 
>>>>> Hi All,
>>>>> 
>>>>> I'm in the process of adding more VectorModes to vtkScalarsToColors.
>>>>> Right now it supports:
>>>>>   Component - map one vector component through the table
>>>>>   Magnitude - map the vector magnitude through the table
>>>>> 
>>>>> However, I have to deal with multi-component data that is already
>>>>> color data.  When I apply a vtkLookupTable, I want it to automatically
>>>>> treat multi-component data as color data, and only apply the lookup
>>>>> when it receives single-component data. So I've added the following
>>>>> vector mode:
>>>>>   RGBColors - if input is multi-component, convert to unsigned char
>>>>> 
>>>>> Mathieu has already requested modes for YCbCr and other color
>>>>> spaces, which vtkScalarsToColors could convert on-the-fly to
>>>>> RGB.  To me, it makes sense to have all the conversions handled
>>>>> in vtkScalarsToColors so that they can be shared by the Imaging
>>>>> and Graphics pipelines.
>>>>> 
>>>>> Any comments/questions?
>>>>> 
>>>>>  - David
>>>>> _______________________________________________
>>>>> Powered by www.kitware.com
>>>>> 
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>> 
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>>>> 
>>>> 
>> 
>> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20110428/80381d48/attachment.html>


More information about the vtk-developers mailing list