<div dir="ltr"><br><div class="gmail_quote"><br><div dir="ltr"><div>Dear all, </div><div><br></div><div>I´m José Antonio Pérez, assistant professor in the Univ. of Seville. </div><div>Last week I downloaded the code provided by you from "<a href="http://www.insight-journal.org/browse/publication/780" target="_blank">http://www.insight-journal.org/browse/publication/780</a>" implementing <span style="color:rgb(51,102,255);font-family:arial,helvetica,sans-serif;font-size:16px;font-weight:bold;line-height:22.3104000091553px;text-align:center">RGB Image Color Space Transformations</span>. </div><div>The code separate an image into its three components in different color spaces. </div><div><br></div><div>I have the following problem:</div><div><br></div><div>1.- I have tried to compose a 3D image using the three LAB components obtained using the provided code. But I´ve been unable. </div><div>These are some lines of my code (not all of them):</div><div><br></div><div><div>   const   unsigned int   Dimension3 = 2;</div><div>   typedef itk::RGBPixel<unsigned char> RGBPixelType;</div><div>   typedef unsigned char  SimplePixelType3;</div><div><br></div><div>   typedef itk::Image< SimplePixelType3, Dimension3> CharImageType;</div><div>   typedef itk::Image<RGBPixelType, Dimension3> RGBImageType;</div></div><div><br></div><div><br></div><div><div><span style="white-space:pre-wrap">    </span>typedef itk::ComposeRGBImageFilter<CharImageType> ComposeRGBType15;</div><div><span style="white-space:pre-wrap">        </span>ComposeRGBType15::Pointer rgb16 = ComposeRGBType15::New();</div></div><div><br></div><div><p class="MsoNormal">typedef <span style="font-size:10pt;font-family:'Courier New'">itk::VectorIndexSelectionCastImageFilter<RGBToLabAdaptorType10, CharImageType> VectorCastFilterType12;<span style="color:green"></span></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:'Courier New'">      </span><span lang="EN-GB" style="font-size:10pt;font-family:'Courier New'">VectorCastFilterType12::Pointer vectorCastFilter13 = VectorCastFilterType12::New();</span></p><p class="MsoNormal"><span lang="EN-GB" style="font-size:10pt;font-family:'Courier New'">  vectorCastFilter13->SetIndex(0);</span></p><p class="MsoNormal"><span lang="EN-GB" style="font-size:10pt;font-family:'Courier New'">  vectorCastFilter13->SetInput(rgbToLabAdaptor10);</span></p><p class="MsoNormal"><span lang="EN-GB" style="font-size:10pt;font-family:'Courier New'"> </span></p><p class="MsoNormal"><span lang="EN-GB" style="font-size:10pt;font-family:'Courier New'">      vectorCastFilter13->SetInput(rgbToLabAdaptor10);</span></p><p class="MsoNormal"><span lang="EN-GB" style="font-size:10pt;font-family:'Courier New'">     </span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:'Courier New'">      vectorCastFilter13->SetIndex(0);</span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:'Courier New'">      rgb16->SetInput1(vectorCastFilter13->GetOutput()); <span style="color:green"></span></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:'Courier New'">      vectorCastFilter13->SetIndex(1);</span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:'Courier New'">      rgb16->SetInput2(vectorCastFilter13->GetOutput());</span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:'Courier New'">      vectorCastFilter13->SetIndex(2);</span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:'Courier New'">rgb16->SetInput3(vectorCastFilter13->GetOutput());</span><br></p><p class="MsoNormal"><span style="font-size:10pt;font-family:'Courier New'"><br></span></p><p class="MsoNormal"><font face="Courier New"> RGBWriterType::Pointer writer15 = RGBWriterType::New();</font></p><p class="MsoNormal"><font face="Courier New"><br></font></p><p class="MsoNormal"><span style="font-family:'Courier New'"> writer15->SetFileName(imageOutname);</span><br></p><p class="MsoNormal"><font face="Courier New"> writer15->SetInput( rgb16->GetOutput() );</font></p><p class="MsoNormal"></p><p class="MsoNormal"><font face="Courier New"> writer15->Update();</font></p></div><div><br></div><div><br></div><div><br></div><div>The problem is that I get a 3D gray scale image with the gray image contained in <span style="font-family:'Courier New';font-size:13px">vectorCastFilter13->SetIndex(2);</span></div><div><span style="font-family:'Courier New';font-size:13px">Would you know how can I combine the three components LAB within a color image? What am I doing wrong? The only way I managed to do it correctly was creating three different </span><span style="font-family:'Courier New';font-size:13px">vectorCastFilters and selecting a different index for each one, and then combining them inside rgb16, but that implies three computations of the LAB transformation.</span></div><div><span style="font-family:'Courier New';font-size:13px"><br></span></div><div><span style="font-family:'Courier New';font-size:13px">I would very much appreciate your help.</span></div><div><span style="font-family:'Courier New';font-size:13px"><br></span></div><div><span style="font-family:'Courier New';font-size:13px">Yours faithfully, </span></div><span class="HOEnZb"><font color="#888888"><div><span style="font-family:'Courier New';font-size:13px">Jose-Antonio</span></div><div><br></div></font></span></div></div><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div>------------------------------------------------------</div>
<div>JOSE ANTONIO PÉREZ CARRASCO</div>
<div>Dpto de Teoría de la Señal y Comunicaciones</div>
<div>Escuela Superior de Ingenieros</div>
<div>Universidad de Sevilla,</div>
<div>tfno: +34954487333</div>
<div>email: <a href="mailto:jperez2@us.es" target="_blank">jperez2@us.es</a></div>
<div><a href="mailto:jcarrasco79@gmail.com" target="_blank">jcarrasco79@gmail.com</a></div></div>
</div>