[Insight-developers] Changing ImageRegionMultidimensionalSplitter

Bradley Lowekamp blowekamp at mail.nih.gov
Wed Aug 12 10:12:48 EDT 2009


Hello,

I am looking for agreement that this will be a good solution, with  
acceptable backwards compatibility.

Looking into the following bug:
http://www.itk.org/Bug/view.php?id=8524

I discovered the methods do not meet the documentation. And that the  
general approach to multi-dimensional splitting can not meet the  
requirements of the documentation. This class is designed to work with  
the StreamingImageFilter, and is currently not functional under many  
conditions.

To illustrate one of the problem consider the case where the Region to  
be split is [100,100,1] and the requested number of splits is 100:
http://www.cdash.org/CDash/viewCoverageFile.php?buildid=400312&fileid=10857899

When the number of splits is reduced we will not get the same number  
of splits for the two methods. These are the lines not covered.


   /** How many pieces can the specifed region be split? A given region
    * cannot always be divided into the requested number of pieces.  For
    * instance, if the numberOfPieces exceeds the number of pixels along
    * a certain dimensions, then some splits will not be possible. This
    * method returns a number less than or equal to the requested number
    * of pieces.  */
   virtual unsigned int GetNumberOfSplits(const RegionType &region,
                                          unsigned int requestedNumber);

   /** Get a region definition that represents the ith piece a  
specified region.
    * The "numberOfPieces" specified should be less than or equal to  
what
    * GetNumberOfSplits() returns. */
   virtual RegionType GetSplit(unsigned int i, unsigned int  
numberOfPieces,
                               const RegionType &region);


-Proposed Solution-

1) Change Documentation

   /** Get a region definition that represents the ith piece a  
specified region.
    * The "numberOfPieces" specified must be equal to what
    * GetNumberOfSplits() returns. */
   virtual RegionType GetSplit(unsigned int i, unsigned int  
numberOfPieces,
                               const RegionType &region);

2) New algorithm for Multi-dimensional splitting

Instead of taking the nth root and shrinking the splits in each  
dimension, the new approach will be:

iteratively split the dimension who's splitted region is the largest.  
This will be reproducible between the two methods.


Any problems with this solution?

Thanks,
Brad


========================================================
Bradley Lowekamp
Lockheed Martin Contractor for
Office of High Performance Computing and Communications
National Library of Medicine
blowekamp at mail.nih.gov


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090812/fad5f56a/attachment.htm>


More information about the Insight-developers mailing list