[Insight-developers] ImageIterators : Suggested Patch: Exception

Gert Wollny gert at die.upm.es
Tue May 5 12:06:24 EDT 2009


On Tue, 2009-05-05 at 11:07 -0400, Luis Ibanez wrote:

>      http://public.kitware.com/Bug/view.php?id=8960
> 
> 
> We are suggesting the following fix to this problem:
> 
> Namely, to check the region argument of the iterator constructor
> against the BufferedRegion of the image, and throw an exception
> if the region is not fully inside of the image buffered region.

> 
> Does anyone see a problem with this patch ?
Isn't that a programming error that should better be checked by an
assertion - at least in a debug build? 

And while you're at it - the incoming image pointer is also not checked
to be != NULL. (Actually, I'm kind of surprised now that this is not a
SmartPointer)

Regards, 

Gert 




More information about the Insight-developers mailing list