[Insight-users] Iterator...

Miller, James V (Research) millerjv at crd.ge.com
Wed Nov 24 10:54:19 EST 2004


If you are doing random access of an image, I don't
think there will be much of a difference.

In general, calling SetPixel() on an image is slower than
using an iterator.  Most of an iterator's speed comes from
walking linearly in memory, avoiding most index mathematics.
But if you are doing random access within an image, then
the index mathmatics cannot be avoided.  So you may be 
better off using SetPixel().

Jim



-----Original Message-----
From: Mr Gaffe [mailto:lagaffe74130 at yahoo.fr]
Sent: Wednesday, November 24, 2004 4:08 AM
To: ITK mailing
Subject: [Insight-users] Iterator...


Hi all,

A simple question about Iterator..
I am doing a program which is quite similar to example
NeighborhoodIterator6.cxx (I need to access a new
random index position).
When I  find my future Index, I need to copy at this
position a value in the output image.
Do I need to create a new Iterator to copy this value
at this position ? or maybe can I directly do:
outImage->SetPixel(newIndex,myValue)

Both, solution works but I don't know what is the
fastest

many thanks
Lagaffe


	

	
		
Vous manquez d'espace pour stocker vos mails ? 
Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
Creez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Le nouveau Yahoo! Messenger est arrive ! Decouvrez toutes les nouveautes
pour dialoguer instantanement avec vos amis. A telecharger gratuitement sur
http://fr.messenger.yahoo.com
_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list