[Insight-users] [Insight-developers] Fastest way to label an array
Luis Ibanez
luis.ibanez at kitware.com
Tue Jun 30 11:37:18 EDT 2009
Hi Nicolas,
Could you please provide more context ?
Are you doing this with ITK images ?
Are you doing this with VTK images ?
What you call an "array" is it really a 2D image ?
or a 3D image ?
The relationship between the "array" and the
label map is not clearly described in your email.
...
At first sight, you seem to be trying to rewrite the
functionalities of the itkImageClassifierFilter...
Thanks for any clarifications,
Luis
----------------------------------------------------
On Mon, Jun 29, 2009 at 1:08 PM, Nicolas Rannou <nrannou at bwh.harvard.edu>wrote:
> Hi all,
>
> I'm currently trying to process an array, to create a label map associated
> to this array.
> The problem is that I want a fast processing and the method I use is too
> slow.
>
> What I do:
>
> /------------------------------------------------------------/
> for(i...){ // 2 for loops to go through the array
> for(j...){
> for(int k;k=0;k<nbOfLabels){ // A loop to test the value of the pixel to
> know to which label associate it
> if(ArrayToCreateTheLabelMap->GetScalarComponentAsDouble(i,j,...) > x &&
> ArrayToCreateTheLabelMap->GetScalarComponentAsDouble(i,j,...) < y){
> ArrayLabelMap->SetScalarComponentFromDouble(i,j) = k; //fill the label
> map
> }
> }
> }
> }
> /----------------------------------------------------------/
> Do you have any suggestion to increase the time of processing?
> Maybe should I use something else than Get/SetScalarComponent.
> 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?
> With 2 labels, the time of processing is ok but as soon as the number of
> label increases, it becomes too long.
>
> Thanks,
>
> Nicolas
> _______________________________________________
> 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 ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090630/3e2af3a5/attachment.htm>
More information about the Insight-users
mailing list