[Insight-users] check boundary Iterator...

Miller, James V (Research) millerjv at crd.ge.com
Fri Dec 3 09:44:02 EST 2004


Lagaffe,

NeighborhoodIterators provide an alternative SetPixel/GetPixel API for 
these types of operations

  virtual PixelType GetPixel(const unsigned i, bool& IsInBounds) const;
  virtual void SetPixel(const unsigned i, const PixelType &v,
                        bool  &status);

This version of GetPixel(), not only returns the pixel value but whether
the value is an true image pixel or a boundary condition value. This API
is available in ITK 1.8 and later.

This version of SetPixel(), tells you whether the SetPixel() operation
succeeded.  SetPixel() will only succeed if the location is a true
image pixel.  If the location is a boundary pixel, then SetPixel() will
fail (and won't actually set the pixel). This API is available in ITK 1.2
and later.

Jim


-----Original Message-----
From: Mr Gaffe [mailto:lagaffe74130 at yahoo.fr]
Sent: Friday, December 03, 2004 7:44 AM
To: ITK mailing
Subject: [Insight-users] check boundary Iterator...


hello,

I would like to know how can I check when I am out of
my image when I use a: "NeighborhoodIterator".
Since boundary condition are set to on by default, I
would like to know when it is happen because I don't
want to add this index ...

this is the global idea of my program:

      it.SetLocation (piIndex); // valid index, 
      for (unsigned i = 0; i < it.Size (); i++)
	{

	  w = it.GetPixel (i);
	  qiIndex = piIndex + it.GetOffset (i);

=> Problem: qiIndex can be outside my Image, so I
would like something like:
if (it.boundaryCondition==OK)
       qiIndex = piIndex + it.GetOffset (i);
else
   // do nothing


thanks for help,

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