elastix icon indicating copy to clipboard operation
elastix copied to clipboard

Elastix should stop running (and fail) when initial transform is not supported

Open N-Dekker opened this issue 2 years ago • 0 comments

When an initial transform is not supported, elastix produces an error message as log output, saying something like:

Error: Transform(index 1) - This component is not installed!

However, it does not stop running the registration. Shouldn't it?

The error message comes from ComponentDatabase::GetCreator at: https://github.com/SuperElastix/elastix/blob/115d8e1c7b0b23973bfc919a2bf4768f32e4e843/Core/Install/elxComponentDatabase.cxx#L108-L109

But it then just returns nullptr, which is handled by TransformBase::ReadInitialTransformFromConfiguration to just do nothing: https://github.com/SuperElastix/elastix/blob/115d8e1c7b0b23973bfc919a2bf4768f32e4e843/Core/ComponentBaseClasses/elxTransformBase.hxx#L485-L492


For the record, back in 2004 (e.g., revision ab62f3deca0c4782de2cb5c8abd0c6d040f893f3) , TransformBase already handled a failure of ComponentDatabase::GetCreator by just doing nothing:

https://github.com/SuperElastix/elastix/blob/ab62f3deca0c4782de2cb5c8abd0c6d040f893f3/src/Core/ComponentBaseClasses/elxTransformBase.hxx#L342-L349

N-Dekker avatar Jul 20 '23 15:07 N-Dekker