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

BUG: ElastixRegistrationMethod shouldn't put "NoInitialTransform" in map #905

Conversation

N-Dekker
Copy link
Member

@N-Dekker N-Dekker commented Jun 2, 2023

ElastixRegistrationMethod should not set "NoInitialTransform" as parameter value of InitialTransformParametersFileName. The value "NoInitialTransform" might cause confusion, as the registration might still have an initial transform parameter file, specified by SetInitialTransformParameterFileName.


For the record, ElastixFilter (the predecessor of ElastixRegistrationMethod) started setting the value "NoInitialTransform" in the registration parameter map with pull request #50 commit 6a7f916, "ENH: Explicitly ignore InitialTransformParametersFileName set via parameter maps in ElastixFilter", merged on March 20, 2018:

// Initial transform parameter files are handled via arguments and enclosing loop, not InitialTransformParametersFileName
if( parameterMapVector[ i ].find( "InitialTransformParametersFileName" ) != parameterMapVector[ i ].end() )
{
parameterMapVector[ i ][ "InitialTransformParametersFileName" ] = ParameterValueVectorType( 1, "NoInitialTransform" );
}

FYI @kaspermarstal

Comment on lines 226 to 234
// An initial transform parameter file may be specified by m_InitialTransformParameterFileName, and passed via the
// argument map (specifically the "-t0" argument), but not via the registration parameter map.
if (parameterMap.count("InitialTransformParametersFileName") != 0)
{
elx::log::warn(
"The parameter map entry for \"InitialTransformParametersFileName\" is ignored. "
"`ElastixRegistrationMethod` only supports specifying an initial transform parameter file by calling "
"`SetInitialTransformParameterFileName`");
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed at the sprint. No need to produce a warning here, as agreed with Marius (@mstaring). The "InitialTransformParametersFileName" is not relevant for elastix registration parameter files, just ignore it. Konstantinos (@ntatsisk) asked to check if the "NoInitialTransform" wasn't there to avoid some warning/error log messages from elastix.

ElastixRegistrationMethod should not set "NoInitialTransform" as parameter value of `InitialTransformParametersFileName`. The value "NoInitialTransform" might cause confusion, as the registration might still have an initial transform parameter file, specified by `SetInitialTransformParameterFileName`.

With this commit, `ElastixRegistrationMethod` just ignores any such `InitialTransformParametersFileName` parameter, as suggested to me by Marius Staring, during the internal weekly sprint.
@N-Dekker N-Dekker force-pushed the ElastixRegistrationMethod-ignore-InitialTransformParametersFileName branch from e82e366 to aa1320c Compare June 5, 2023 14:24
@N-Dekker N-Dekker merged commit dc4ba50 into main Jun 5, 2023
@N-Dekker N-Dekker deleted the ElastixRegistrationMethod-ignore-InitialTransformParametersFileName branch June 5, 2023 15:09
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

Successfully merging this pull request may close these issues.

1 participant