[Insight-users] Bug in itkImageRegion

Lorensen, William E (Research) lorensen at crd . ge . com
Wed, 4 Sep 2002 08:51:38 -0400


Koen,
Thanks for the bug report (and the fix!). I'm testing it now and the fix should be available in an
hour.

Bill


-----Original Message-----
From: Koen Van Leemput [mailto:koen.vanleemput@hus.fi]
Sent: Wednesday, September 04, 2002 2:55 AM
To: insight-users@public.kitware.com
Subject: [Insight-users] Bug in itkImageRegion


Hi all, 

I think there is a bug in itkImageRegion::IsInside(const 
ContinuousIndex<TCoordRepType,ImageDimension> &): indices outside a region 
are actually reported to fall inside. Here is some example code reproducing 
the error:

  typedef itk::ImageRegion<1>        RegionType;
  RegionType::IndexType    index = {0};
  RegionType::SizeType     size = {100};
  RegionType region(index, size);
  itk::ContinuousIndex<double, 1>  continuousIndex;
  continuousIndex[0] = 99.9;
  std::cout << region.IsInside( continuousIndex ) << std::endl;

In itkImageRegion::IsInside(const 
ContinuousIndex<TCoordRepType,ImageDimension> &), the test "if( index[i] >= 
bound )" should probably be replaced with "if ( index[i] > bound-1 )"

Cheers,

Koen


-- 
***************************************************************************** 
Koen Van Leemput, Ph.D.                email : koen.vanleemput@hus.fi 
Department of Radiology                  phone: +358 9 471 71331        
Helsinki University Central Hospital   mobile: +358 9 471 62300        
P.O. Box 340                                  fax:      +358 9 471 71342        
FIN-00029 HUS                                                                           
FINLAND                                                                                    
***************************************************************************** 

_______________________________________________
Insight-users mailing list
Insight-users@public.kitware.com
http://public.kitware.com/mailman/listinfo/insight-users