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

ENH: exit with error if registration shrink factors, convergence, smo… #1571

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Examples/antsRegistrationTemplateHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,24 @@ DoRegistration(typename ParserType::Pointer & parser)
return EXIT_FAILURE;
}

// Check that we have the same number of required args for each transform:
// smoothing sigmas, shrink factors, and convergence
unsigned int numSmoothingSigmaFunctions = smoothingSigmasOption->GetNumberOfFunctions();
unsigned int numShrinkFactorFunctions = shrinkFactorsOption->GetNumberOfFunctions();
unsigned int numConvergenceFunctions = convergenceOption->GetNumberOfFunctions();

if (numSmoothingSigmaFunctions != numShrinkFactorFunctions ||
numShrinkFactorFunctions != numConvergenceFunctions ||
numConvergenceFunctions != numberOfTransforms)
{
if (verbose)
{
std::cerr << "ERROR: smoothing sigmas, shrink factors, and convergence options must be set "
<< "once for each transform." << std::endl;
}
return EXIT_FAILURE;
}

std::vector<std::vector<unsigned int>> iterationList;
std::vector<std::vector<RealType>> restrictDeformationWeightsList;
std::vector<RealType> convergenceThresholdList;
Expand Down