<br>Hi Nicolas,<br><br>Could you please provide more context ?<br><br>Are you doing this with ITK images ? <br><br>Are you doing this with VTK images ?<br><br><br>What you call an &quot;array&quot; is it really a 2D image ?<br>
or a 3D image ?<br><br><br>The relationship between the &quot;array&quot; and the<br>label map is not clearly described in your email.<br><br><br>...<br><br>At first sight, you seem to be trying to rewrite the <br>functionalities of the itkImageClassifierFilter...<br>
<br><br><br>    Thanks for any clarifications,<br><br><br>            Luis<br><br><br>----------------------------------------------------<br><div class="gmail_quote">On Mon, Jun 29, 2009 at 1:08 PM, Nicolas Rannou <span dir="ltr">&lt;<a href="mailto:nrannou@bwh.harvard.edu">nrannou@bwh.harvard.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi all,<br>
<br>
I&#39;m currently trying to process an array, to create a label map associated to this array.<br>
The problem is that I want a fast processing and the method I use is too slow.<br>
<br>
What I do:<br>
<br>
/------------------------------------------------------------/<br>
for(i...){ // 2 for loops to go through the array<br>
 for(j...){<br>
   for(int k;k=0;k&lt;nbOfLabels){ // A loop to test the value of the pixel to know to which label associate it<br>
     if(ArrayToCreateTheLabelMap-&gt;GetScalarComponentAsDouble(i,j,...) &gt; x &amp;&amp; ArrayToCreateTheLabelMap-&gt;GetScalarComponentAsDouble(i,j,...) &lt; y){<br>
      ArrayLabelMap-&gt;SetScalarComponentFromDouble(i,j) = k; //fill the label map<br>
     }<br>
   }<br>
 }<br>
}<br>
/----------------------------------------------------------/<br>
Do you have any suggestion to increase the time of processing?<br>
Maybe should I use something else than Get/SetScalarComponent.<br>
Is it possible to do a fast mapping, to say that all pixels (in the array or in a volume) between x and y should be egal to 1, between w and z egal to 2... instead of doing these loops?<br>
With 2 labels, the time of processing is ok but as soon as the number of label increases, it becomes too long.<br>
<br>
Thanks,<br>
<br>
Nicolas<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-developers" target="_blank">http://www.itk.org/mailman/listinfo/insight-developers</a><br>
</blockquote></div><br>