ENH: Add support for multiple metrics and regularization#1437
ENH: Add support for multiple metrics and regularization#1437Leirbag-gabrieL wants to merge 1 commit into
Conversation
|
Thank you very much @Leirbag-gabrieL Can you possibly make a minimal example of a registration that is made possible by your proposed fix? Ideally in the form of a library unit test, like this one: elastix/Core/Main/GTesting/itkElastixRegistrationMethodGTest.cxx Lines 3006 to 3048 in 0c0b19f But then, having something like Otherwise, a complete ("dummy") test set, including elastix parameter file, would also be of help to us. Again, preferably "minimal", so that it won't take much time to process. |
| using MovingImageDerivativeScalesType = FixedArray<double, Self::MovingImageDimension>; | ||
|
|
||
| /** Typedef for transform penalty metrics. */ | ||
| typedef TransformPenaltyTerm<TFixedImage> TransformMetricType; |
There was a problem hiding this comment.
Nowadays, we are using using, instead of typedef. But a coding style issue like that is not a show-stopper. I can adjust it afterwards. Also, I think I would move the definition of TransformMetricType into the function body of CombinationImageToImageMetric::SetMetric, as that seems to be the only place where it is needed.
|
|
||
| /** Typedef for transform penalty metrics. */ | ||
| typedef TransformPenaltyTerm<TFixedImage> TransformMetricType; | ||
| typedef typename TransformMetricType::Pointer TransformMetricPointer; |
There was a problem hiding this comment.
TransformMetricPointer is never used, so I think I would remove it. (No show-stopper for now.)
| TransformMetricType * testPtr2 = dynamic_cast<TransformMetricType *>(metric); | ||
|
|
||
| // Increase newly defined numberOfMetric counters | ||
| if (testPtr1) |
There was a problem hiding this comment.
I would make it:
if( dynamic_cast<PointSetMetricType *>(metric) )
And remove the local testPtr1 variable.
Similar for testPtr2, oldTestPtr1, oldTestPtr2. No show-stopper to me, though. Just a style thing.
Hi, apparently it was not possible to do a multi-image registration with a transform metric like this:
Now it is possible :)