Skip to content

REFAC: don't duplicate code in Application::GetParameterImage

Victor Poughon requested to merge getparamimage into develop

Why are there two methods called Application::GetParameterImage, one templated on its return type and one not templated? The code between the two is partially duplicated. The only practical difference is that they call a different GetImage, one templated on its return type and the other not. But it's equivalent in the end because the non template GetImage calls GetImage<FloatVectorImageType>.

This diff is a proposal to fix but I wonder if there is some good reason to have a template method and a non-template one, where a default template argument would do the job? (@lhermitte)

I would also propose the same fix for InputImageParameter::GetImage, but there the situation is even less clear with 3 implementations: a non template, a specialization for ImageBaseType, and a template.

Merge request reports