[Insight-developers] Changing ImageRegionMultidimensionalSplitter

Luis Ibanez luis.ibanez at kitware.com
Sat Aug 15 12:52:15 EDT 2009


I would vote for

a)  fixing the documentation. (which is backward compatible), and

b) if we need an alternative splitting algorithm:
    then refactor this  in ITK 4.0.


My 2 cents,


     Luis


--------------------------------------------------------------------------------

On Wed, Aug 12, 2009 at 10:12 AM, Bradley Lowekamp
<blowekamp at mail.nih.gov>wrote:

>
> 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
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090815/d5369a56/attachment.htm>


More information about the Insight-developers mailing list