ANTsX / ANTs

Advanced Normalization Tools (ANTs)
Apache License 2.0
1.21k stars 381 forks source link

ENH: Check input for antsApplyTransforms matches dimensionality #1694

Closed cookpa closed 8 months ago

cookpa commented 8 months ago

This checks that scalar input to antsApplyTransforms is actually an N-dimensional scalar image, and if it's not, exit with error advising users to use the correct input flag with -e.

It's my opinion that it's wise to inform users of fatal errors even if they don't use --verbose, but if that's going to break anything I can hide the error message for non-verbose execution.

cookpa commented 8 months ago

Just noticed this elsewhere in the code. Might have to adapt the checks to only operate on actual files

  // BA - code below creates problems in ANTsR
  //  itk::ImageIOBase::Pointer imageIO = itk::ImageIOFactory::CreateImageIO(
  //                                                            filename.c_str(),
  //                                                            itk::ImageIOFactory::FileModeType::ReadMode );
  //  dimension = imageIO->GetNumberOfDimensions();