<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><!--StartFragment--><p class="MsoNormal">Hi David,<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">Sorry for the late reply... We are now ready to step into
this problem. <o:p></o:p></p><p class="MsoNormal">We have N images
corresponding to N channels.<o:p></o:p></p><p class="MsoNormal">Our first idea was to do:</p><p class="MsoNormal">===========================================================</p>
<pre style="line-height:14.4pt;vertical-align:top"><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px;">Image 1-------> </span></font><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px;"><b>vtkImageMapToColors</b>----><o:p></o:p></span></font></pre><p class="MsoNormal">LUT 1 -------> |<o:p></o:p></p><p class="MsoNormal"> |<o:p></o:p></p>
<pre style="line-height:14.4pt;vertical-align:top"><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px;">Image 2-------> </span></font><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px;"><b>vtkImageMapToColors</b>---->|---></span></font><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px;"> <b>vtkImageBlend</b>?<o:p></o:p></span></font></pre><p class="MsoNormal">LUT 2 -------> | <b>vtkImageAppendComponent</b>?</p><p class="MsoNormal"> |<o:p></o:p></p><p class="MsoNormal"> |<o:p></o:p></p><p class="MsoNormal">… |<o:p></o:p></p><p class="MsoNormal"> |<o:p></o:p></p>
<pre style="line-height:14.4pt;vertical-align:top"><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px;">Image N-------> </span></font><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px;"><b>vtkImageMapToColors</b>---><o:p></o:p></span></font></pre><p class="MsoNormal">LUT N -------><o:p></o:p></p><p class="MsoNormal"><o:p> </o:p>===========================================================</p><p class="MsoNormal">However your suggestion
seems very interesting and more efficient.<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p>=========================================================== </p><p class="MsoNormal">LUT 1------><o:p></o:p></p><p class="MsoNormal">LUT 2------> <b>SetLookupTableForChannel</b>()?-->
1 LUT ------><o:p></o:p></p><p class="MsoNormal">… |<o:p></o:p></p><p class="MsoNormal">LUT N-----> |----> <b>vtkImageMapToColors</b><o:p></o:p></p><p class="MsoNormal"> |<o:p></o:p></p><p class="MsoNormal">Image 1--------> |<o:p></o:p></p><p class="MsoNormal">Image 2--------> <b>vtkImageBlend</b>?-------------------> 1 Image --><o:p></o:p></p><p class="MsoNormal">… <b>vtkImageAppendComponent</b>?<o:p></o:p></p><p class="MsoNormal">Image N-------></p><p class="MsoNormal">===========================================================</p><div>Is it what you suggested or did I misunderstand you?</div><p class="MsoNormal">You advised to implement
<b>SetLookupTableForChannel</b>() in <b>vtkScalarsToRGB</b> but I’m concerned
if it is the good place for it to be.<o:p></o:p></p><p class="MsoNormal">Shouldn’t we create a new class similarly as <b>vtkLogLookupTable</b>,
called <b>vtkMultiLookupTable?</b> (open to any suggestion), which inherits from
<b>vtkLookupTable</b>?<o:p></o:p></p><p class="MsoNormal">Would you recommend us to use <b>vtkImageBlend</b> or
<b>vtkImageAppendComponent</b>?<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">Thanks!<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">Nicolas<o:p></o:p></p><p class="MsoNormal"><span style="font-family:Courier"><o:p> </o:p></span></p><p class="MsoNormal"><span style="font-family:Courier"><o:p> </o:p></span></p>
<!--EndFragment-->
<div><div>On Mar 1, 2011, at 1:20 PM, David Gobbi wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>I've pushed my vtkScalarsToColors changes to VTK's git master,<br>so it is best if you start from there and then push your changes<br>to gerrit or just email a patch to the list.<br><br> - David<br><br><br>On Tue, Mar 1, 2011 at 11:11 AM, Arnaud GELAS<br><<a href="mailto:arnaud_gelas@hms.harvard.edu">arnaud_gelas@hms.harvard.edu</a>> wrote:<br><blockquote type="cite">David,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">This is something we would need anyway for our project.<br></blockquote><blockquote type="cite">So we would be happy to contribute such a feature to VTK!<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Where is it developed?<br></blockquote><blockquote type="cite">on your github's fork? which branch?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Thanks,<br></blockquote><blockquote type="cite">Arnaud<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On 03/01/2011 11:10 AM, David Gobbi wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Yes, the thought has crossed my mind... I've had to work with<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">multi-channel images in the past.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">These methods could be added to vtkScalarsToColors:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> SetVectorModeToIndependent()<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> SetLookupTableForChannel(vtkScalarsToColors *colors, int channel)<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">When in this Independent mode, each component could be mapped through<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">one of the "child" lookup tables. The colors from each channel would<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">then be summed and clamped.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">If you are willing to add a feature like this, I'll gladly help to get<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">it integrated.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> - David<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">On Tue, Mar 1, 2011 at 8:27 AM, Arnaud GELAS<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><<a href="mailto:arnaud_gelas@hms.harvard.edu">arnaud_gelas@hms.harvard.edu</a>> wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">David,<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Currently, in the field of microscopy we can have up to 32 channels<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">(components) images, and for each channel we have an associated color.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">(Although, most of the time people use less than 6 channels.)<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Do you think it would be possible to make a more general mode for such<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">color<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">spaces?<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Arnaud<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">On 02/28/2011 12:39 PM, David Gobbi wrote:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Hi All,<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I'm in the process of adding more VectorModes to vtkScalarsToColors.<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Right now it supports:<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> Component - map one vector component through the table<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> Magnitude - map the vector magnitude through the table<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">However, I have to deal with multi-component data that is already<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">color data. When I apply a vtkLookupTable, I want it to automatically<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">treat multi-component data as color data, and only apply the lookup<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">when it receives single-component data. So I've added the following<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">vector mode:<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> RGBColors - if input is multi-component, convert to unsigned char<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Mathieu has already requested modes for YCbCr and other color<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">spaces, which vtkScalarsToColors could convert on-the-fly to<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">RGB. To me, it makes sense to have all the conversions handled<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">in vtkScalarsToColors so that they can be shared by the Imaging<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">and Graphics pipelines.<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Any comments/questions?<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> - David<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">_______________________________________________<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Powered by <a href="http://www.kitware.com">www.kitware.com</a><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Visit other Kitware open-source projects at<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Follow this link to subscribe/unsubscribe:<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><a href="http://www.vtk.org/mailman/listinfo/vtk-developers">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote></div></blockquote></div><br></body></html>