<div dir="ltr"><div>Hi, </div><div><br></div><div>I posted the same issue on insight-users initially but then I thought it would be more relevant to developers mailing list. </div><div><br></div><div>I was observing an unexpected non-deterministic behavior while changing the order of completely unrelated registrations. In the following example, my test revealed that transform and transform' are not identical:</div><div><br></div><div>transform = Register(image1, image2);</div><div><br></div><div>vs.</div><div><br></div><div>transform-foo = Register(image-foo1, image-foo2);</div><div><div>transform' = Register(image1, image2);</div><div><br></div><div><br></div><div>I looked into the source of this non-deterministic behavior while making sure the metric sampling strategy has been set to Regular. </div><div>Eventually I found the cause of the problem in itkRegistrationParametersScale<wbr>Estimator class. In this class there are two functions SetScaleSamplingStrategy and SetStepScaleSamplingStrategy. In both the sampling strategy is chosen based on the Transformation type. For example if the transformation is of type displacement field or BSpline, it uses all of the samples. If transformation is any regular affine or rigid transformation (child of class MatrixOffsetTransformBase) it performs corner sampling. However, if the transformation is none of the known ones, it uses Random Sampling.</div><div><br></div><div>In my test I was using one level rigid transformation (v4). But here is were the problem happens:  in itkImageRegistrationMethodv4.h<wbr>xx the Metric transformation (MovingTransform) always set to a CompositeTransform! Therefore, ScaleEstimator cannot detect the transformation type and it always fall into "else" which is using Random Sampling! It does not matter if you do a multilevel registration or not. The transformation is always of type CompositeTransform.</div><div><br></div><div>By changing the sampling strategy in ScaleEstimator class from Random to a regular sampling, the non-deterministic behavior is gone and transform and transform' in the above example become identical.</div><div><br></div><div>I would appreciate if you let me know if I was correct about this issue and whether we can consider this a bug and hope to get it fixed for the upcoming versions.<br><br> Thanks a lot for your consideration in advance,<br> Sepide</div></div></div>