[ITK] ImageRegistrationMethodv4 behavior question

Timothee Evain tevain at telecom-paristech.fr
Thu Sep 8 10:38:12 EDT 2016


Hi,

1) Both solutions sound acceptable to me. It depends on the purpose of the SetMetricSamplingPercentage method. If it's only a lazy-way setup, I think at least documentation should underline the risk of overwriting. In the other hand, since it was the only one among all the parameters per level to have such method, I was expecting a parameter which supersede the per-level one, which should be remembered. If the first case prevail, I think that having only the SetMetricSamplingPercentagePerLevel method but overloaded with a one-scalar version would be clearer.

2)Yes, I'm using one instance of ImageRegistrationMethodv4 to make a pipeline of registration (rigid->affine->Bspline), and I was using a dense sampling to tune parameters of later ones after the rigid phase with sparse sampling. That how I noticed that the m_UseFixedSampledPointSet is always "true" if the sampling strategy is different from None. So the option to use dense sampling is in fact controlled by the sampling strategy parameter, not the boolean as stated in the software guide. The fact that the strategy is checked before the boolean in the pipeline troubles me.

Tim

----- Mail original -----
De: "Bradley Lowekamp (NIH/NLM/LHC) [C]" <blowekamp at mail.nih.gov>
À: "Timothee Evain" <tevain at telecom-paristech.fr>
Cc: "Matt McCormick" <matt.mccormick at kitware.com>, community at itk.org
Envoyé: Jeudi 8 Septembre 2016 14:55:57
Objet: Re: [ITK] ImageRegistrationMethodv4 behavior question

Hello,

In my opinion these interactions should be added to the documentation as opposed to changing the behavior to what your initial exceptions where.

1)  SetNumberOfLevel - Currently the implementation resets the AdaptorsPerLevel, ShrinkFactorsPerDimension, SmoothingSigmasPerLevel, and SamplingPercentagePerLevel to their default when the NumberOfLevels changes. This seems like consistent to me and logical. The the NumberOfLevels needs to be set before the others parameters. Having multiple variables refer to the same attribute as in your patch can very quickly lead to undocumented and inconsistent behavior. Documenting the current behavior is best. A comment can be added to the PerDimension attributes that the NumberOfLevels should be set first.

2) You are talking about running the ImageRegistrationMethodv4::Update method multiple time on a single instance with different parameters? And side effects from doing that? Or are you talking about just using the parameter settings and not getting your expected behavior? I think a small compilable example or annotation of the code would help.

HTH,
Brad



> On Sep 8, 2016, at 4:55 AM, Timothee Evain <tevain at telecom-paristech.fr> wrote:
> 
> I have stumbled on another curious thing that may be a bug also.
> When users set explicitely to not use the sparse sampling with the SetUseFixedSampledPointSet(false) on metric (as shown in the software guide), if the sampling strategy is different of NONE, the option is forcefully set to true when the ImageRegistrationMethodv4 call SetMetricSamplePoints() during the InitializeRegistrationAtEachLevel. This arise when doing first a sparse sampling registration then a dense one.
> If sampling strategy is mandatory when we use the sparse sampling, to me it shouldn't impact when using dense sampling.
> 
> Tim 
> 
> 
> 
> 
> ----- Mail original -----
> De: "Matt McCormick" <matt.mccormick at kitware.com>
> À: "Timothee Evain" <tevain at telecom-paristech.fr>
> Cc: community at itk.org
> Envoyé: Mercredi 7 Septembre 2016 22:24:22
> Objet: Re: [ITK] ImageRegistrationMethodv4 behavior question
> 
> Hi Tim,
> 
> It sounds like a bug. Do you have patch in mind?
> 
> Thanks,
> Matt
> 
> On Wed, Sep 7, 2016 at 1:05 PM, Timothee Evain
> <tevain at telecom-paristech.fr> wrote:
>> Hi folks,
>> 
>> It's more a dev consideration, but I've been tricked by the SetNumberOfLevels & SetMetricSamplingPercentage methods from the ImageRegistrationMethodv4.
>> The former is overwriting any previously set parameters for SmoothingSigmas and ShrinkFactors but also for the SamplingPercentage.
>> If I was expecting it for the two first, as we can only set them per levels via arrays, I was expecting the sampling percentage to be stored since we can set it for all levels via the SetMetricSamplingPercentage method (which in fact is only a wrap around the "per levels" one).
>> Thus you cannot set the sampling percentage before setting levels. Is that the intended behavior ? That wasn't really clear to me.
>> 
>> Tim
>> _______________________________________________
>> Community mailing list
>> Community at itk.org
>> http://public.kitware.com/mailman/listinfo/community
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community



More information about the Community mailing list