Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
N-Dekker opened this issue Jul 20, 2023 · 0 comments
Assignees

Comments

@N-Dekker
Copy link
Member

N-Dekker commented Jul 20, 2023

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:

log::error(std::ostringstream{} << "Error: \n" << name << "(index " << i << ") - This component is not installed!");
return nullptr;

But it then just returns nullptr, which is handled by TransformBase::ReadInitialTransformFromConfiguration to just do nothing:

const PtrToCreator testcreator =
ElastixMain::GetComponentDatabase().GetCreator(initialTransformName, this->m_Elastix->GetDBIndex());
const itk::Object::Pointer initialTransform = (testcreator == nullptr) ? nullptr : testcreator();
const auto elx_initialTransform = dynamic_cast<Self *>(initialTransform.GetPointer());
/** Call the ReadFromFile method of the initialTransform. */
if (elx_initialTransform != nullptr)


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

testcreator = this->GetElastix()->GetComponentDatabase()->
GetCreator( InitialTransformName, m_Elastix->GetDBIndex() );
initialTransform = testcreator ? testcreator() : NULL;
Self * elx_initialTransform = dynamic_cast< Self * >( initialTransform.GetPointer() );
/** Call the ReadFromFile method of the initialTransform. */
if ( elx_initialTransform )

@N-Dekker N-Dekker changed the title Elastix should stop running (and fail) hen initial transform is not supported Elastix should stop running (and fail) when initial transform is not supported Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants