[Insight-developers] Possible bugs in ImageToImage metric with threads

Luis Ibanez luis.ibanez at kitware.com
Mon Mar 7 01:39:44 EST 2011


Hi Hans,

Yes, the code in the ImageToImageMetric is overdue for a
spring clean up.

One way to refactor this particular side of the code is to
adopt what Brian has proposed for the image registration
refactoring: a reference sampling process.

This will take the processes of sampling pixels, out of the
image metric and into a separate helper class.

It will also enable users to sample the points using a grid
(or any other strategy) from a space different from the
Fixed image and the Moving image grids.


It will also be great to remove from the metrics all the code
that makes them aware of specific transforms (e.g. the
BSpline Transform).



     Luis


----------------------------------------------------------------------------
On Sun, Mar 6, 2011 at 7:27 PM, Johnson, Hans J <hans-johnson at uiowa.edu> wrote:
> Hello all,
> I can not make heads nor tails of the ImageToImageMetric samples selection
> methods.  It looks like this is a class that has experienced extreme scope
> creep over the years in an attempt to be uber flexible with respect to
> samples selections.
> How do all the following options interact with each other?
> SetUseFixedImageSamplesIntensityThreshold
> SetFixedImageRegion
> SetUseAllPixels
> SetUseSequentialSampling
> SetFixedImageSamplesIntensityThreshold
> SetUseFixedImageIndexes
> SetFixedImageIndexes
> SetNumberOfFixedImageSamples
> SetFixedImageMask
> SetMovingImageMask
>
> In my particular case, what is the correct behavior when requesting 1e6
> samples from when the FixedImageMask is set and the MovingImageMask is set,
> but the intersection of the fixed and moving masks only contains 1e5
> samples?  Since the threading work distribution is based on the
> "m_NumberOfFixedImageSamples" and that has several related variables
> (this->m_NumberOfPixelsCounted +=
> m_ThreaderNumberOfMovingImageSamples[threadID];)  , and based on the mask
> overlapping the numberOfSamples seems to dynamically update, it could be the
> cause of the failing test cases.  I've spent several hours trying to trace
> through this mess trying to determine if there really is a problem, but I
> can not narrow it down.
> Ultimately, all permutations of this result in some sort of iteration over
> some subset of the fixed image indexes.  If we decoupled the various "fixed
> image iterator generation schemes" from the ImageToImageMetric, we could
> greatly simplify the interrelationships AND allow for other sample
> selections schemes to be added through that consistent interface.
> I'd like to get some feedback on this proposal before I spend more time
> trying to identify ways to simplify this.
> Hans
>
>
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is covered by the
> Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential
> and may be legally privileged.  If you are not the intended recipient, you
> are hereby notified that any retention, dissemination, distribution, or
> copying of this communication is strictly prohibited.  Please reply to the
> sender that you have received the message in error, then delete it.  Thank
> you.
> ________________________________
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.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
>
>


More information about the Insight-developers mailing list