diff --git a/Examples/ANTS.cxx b/Examples/ANTS.cxx index 870c8be90..2505f9a38 100644 --- a/Examples/ANTS.cxx +++ b/Examples/ANTS.cxx @@ -87,7 +87,7 @@ ANTSex(int argc, char * argv[]) { registration->RunRegistration(); } - catch (std::exception const & e) + catch (const std::exception const & e) { std::cerr << "Exception caught in ANTS: " << std::endl << e.what() << std::endl; return EXIT_FAILURE; @@ -163,12 +163,12 @@ ANTS(std::vector args, std::ostream * /*out_stream = nullptr*/) { dim = std::stoi(argv[1]); } - catch (std::invalid_argument & itkNotUsed(e)) + catch (const std::invalid_argument & itkNotUsed(e)) { // if no conversion could be performed // assume --help is requested } - catch (std::out_of_range & itkNotUsed(e)) + catch (const std::out_of_range & itkNotUsed(e)) { // if the converted value would fall out of the range of the result type // or if the underlying function (std::strtol or std::strtoull) sets errno diff --git a/Examples/ANTSUseDeformationFieldToGetAffineTransform.cxx b/Examples/ANTSUseDeformationFieldToGetAffineTransform.cxx index c58036a88..f1920985e 100644 --- a/Examples/ANTSUseDeformationFieldToGetAffineTransform.cxx +++ b/Examples/ANTSUseDeformationFieldToGetAffineTransform.cxx @@ -39,7 +39,7 @@ WriteAffineTransformFile(typename TransformType::Pointer & transform, const std: { transform_writer->Update(); } - catch (itk::ExceptionObject & itkNotUsed(err)) + catch (const itk::ExceptionObject & itkNotUsed(err)) { std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl << "Exception in writing transform file: " << std::endl diff --git a/Examples/ANTSUseLandmarkImagesToGetAffineTransform.cxx b/Examples/ANTSUseLandmarkImagesToGetAffineTransform.cxx index c625f02eb..a6c540f88 100644 --- a/Examples/ANTSUseLandmarkImagesToGetAffineTransform.cxx +++ b/Examples/ANTSUseLandmarkImagesToGetAffineTransform.cxx @@ -36,7 +36,7 @@ WriteAffineTransformFile(typename TransformType::Pointer & transform, const std: { transform_writer->Update(); } - catch (itk::ExceptionObject & itkNotUsed(err)) + catch (const itk::ExceptionObject & itkNotUsed(err)) { std::cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl << "Exception in writing transform file: " << std::endl diff --git a/Examples/Atropos.cxx b/Examples/Atropos.cxx index ebda1ba56..bc0d7ac63 100644 --- a/Examples/Atropos.cxx +++ b/Examples/Atropos.cxx @@ -994,7 +994,7 @@ AtroposSegmentation(itk::ants::CommandLineParser * parser) // segmenter->DebugOn(); segmenter->Update(); } - catch (itk::ExceptionObject & exp) + catch (const itk::ExceptionObject & exp) { if (verbose) { diff --git a/Examples/AverageTensorImages.cxx b/Examples/AverageTensorImages.cxx index 0ee715b1e..01688fb29 100644 --- a/Examples/AverageTensorImages.cxx +++ b/Examples/AverageTensorImages.cxx @@ -172,7 +172,7 @@ AverageTensorImages(std::vector args, std::ostream * /*out_stream = return EXIT_SUCCESS; } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cerr << "ExceptionObject caught !" << std::endl; std::cerr << err << std::endl; diff --git a/Examples/CheckTopology.cxx b/Examples/CheckTopology.cxx index 3681d68fa..974fdeb29 100644 --- a/Examples/CheckTopology.cxx +++ b/Examples/CheckTopology.cxx @@ -189,7 +189,7 @@ GetLargestComponent(typename TImage::Pointer image) { relabel->Update(); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cerr << "Relabel: exception caught !" << std::endl; std::cerr << excep << std::endl; diff --git a/Examples/ClusterImageStatistics.cxx b/Examples/ClusterImageStatistics.cxx index 46468f7d3..a70254880 100644 --- a/Examples/ClusterImageStatistics.cxx +++ b/Examples/ClusterImageStatistics.cxx @@ -117,7 +117,7 @@ ClusterStatistics(unsigned int argc, char * argv[]) { relabel->Update(); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cerr << "Relabel: exception caught !" << std::endl; std::cerr << excep << std::endl; diff --git a/Examples/ConformalMapping.cxx b/Examples/ConformalMapping.cxx index 690432796..05edc3c0b 100644 --- a/Examples/ConformalMapping.cxx +++ b/Examples/ConformalMapping.cxx @@ -190,7 +190,7 @@ MapToSphere(typename TImage::Pointer image, int fixdir, float e) { meshSource->Update(); } - catch (itk::ExceptionObject & exp) + catch (const itk::ExceptionObject & exp) { std::cout << "Exception thrown during Update() " << std::endl; std::cout << exp << std::endl; @@ -981,7 +981,7 @@ ConformalMapping(std::vector args, std::ostream * out_stream = null { readfilter->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cout << "Exception caught during reference file reading " << std::endl; std::cout << e << std::endl; @@ -1006,7 +1006,7 @@ ConformalMapping(std::vector args, std::ostream * out_stream = null { readfilter->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cout << "Exception caught during reference file reading " << std::endl; std::cout << e << std::endl; diff --git a/Examples/DenoiseImage.cxx b/Examples/DenoiseImage.cxx index 886788b67..fe5fc8045 100644 --- a/Examples/DenoiseImage.cxx +++ b/Examples/DenoiseImage.cxx @@ -294,7 +294,7 @@ Denoise(itk::ants::CommandLineParser * parser) // denoiser->DebugOn(); denoiser->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { if (verbose) { diff --git a/Examples/ImageCompare.cxx b/Examples/ImageCompare.cxx index c91c90aa8..3b364eb0b 100644 --- a/Examples/ImageCompare.cxx +++ b/Examples/ImageCompare.cxx @@ -157,7 +157,7 @@ RegressionTestImage(const char * testImageFilename, { baselineReader->UpdateLargestPossibleRegion(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cout << "Exception detected while reading " << baselineImageFilename << " : " << e.GetDescription(); return 1000; @@ -170,7 +170,7 @@ RegressionTestImage(const char * testImageFilename, { testReader->UpdateLargestPossibleRegion(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cout << "Exception detected while reading " << testImageFilename << " : " << e.GetDescription() << std::endl; return 1000; diff --git a/Examples/ImageMath_Templates.hxx b/Examples/ImageMath_Templates.hxx index f3381afdc..068033e77 100644 --- a/Examples/ImageMath_Templates.hxx +++ b/Examples/ImageMath_Templates.hxx @@ -260,7 +260,7 @@ FrobeniusNormOfMatrixDifference(int argc, char * argv[]) { transformReader1->Update(); } - catch (itk::ExceptionObject & /* excp */) + catch (const itk::ExceptionObject & /* excp */) { std::cout << "no transformation1 that can be read" << fn1 << std::endl; return 0; @@ -271,7 +271,7 @@ FrobeniusNormOfMatrixDifference(int argc, char * argv[]) { transformReader2->Update(); } - catch (itk::ExceptionObject & /* excp */) + catch (const itk::ExceptionObject & /* excp */) { std::cout << "no transformation2 that can be read" << fn2 << std::endl; return 0; @@ -485,7 +485,7 @@ GetLargestComponent(int argc, char * argv[]) { relabel->Update(); } - catch (itk::ExceptionObject & /* excep */) + catch (const itk::ExceptionObject & /* excep */) { // std::cout << "Relabel: exception caught !" << std::endl; // std::cout << excep << std::endl; @@ -603,7 +603,7 @@ ClusterThresholdVariate(int argc, char * argv[]) { relabel->Update(); } - catch (itk::ExceptionObject & /* excep */) + catch (const itk::ExceptionObject & /* excep */) { // std::cout << "Relabel: exception caught !" << std::endl; // std::cout << excep << std::endl; @@ -2959,7 +2959,7 @@ SliceTimingCorrection(int argc, char * argv[]) { filter->Update(); } - catch (itk::ExceptionObject & /* exp */) + catch (const itk::ExceptionObject & /* exp */) { // std::cout << "Exception caught!" << std::endl; // std::cout << exp << std::endl; @@ -3781,7 +3781,7 @@ TimeSeriesToMatrix(int argc, char * argv[]) { writer->Write(); } - catch (itk::ExceptionObject & /* exp */) + catch (const itk::ExceptionObject & /* exp */) { // std::cout << "Exception caught!" << std::endl; // std::cout << exp << std::endl; @@ -4498,7 +4498,7 @@ CompCorrAuto(int argc, char * argv[]) { writer->Write(); } - catch (itk::ExceptionObject & /* exp */) + catch (const itk::ExceptionObject & /* exp */) { // std::cout << "Exception caught!" << std::endl; // std::cout << exp << std::endl; @@ -4840,7 +4840,7 @@ ThreeTissueConfounds(int argc, char * argv[]) { writer->Write(); } - catch (itk::ExceptionObject & /* exp */) + catch (const itk::ExceptionObject & /* exp */) { // std::cout << "Exception caught!" << std::endl; // std::cout << exp << std::endl; @@ -6222,7 +6222,7 @@ TensorFunctions(int argc, char * argv[]) { whichvec = std::stoi(fn2.c_str()); } - catch (std::invalid_argument & itkNotUsed(e)) + catch (const std::invalid_argument & itkNotUsed(e)) { // arg is not whichvec } @@ -8680,7 +8680,7 @@ FillHoles(int argc, char * argv[]) { relabel->Update(); } - catch (itk::ExceptionObject & /* excep */) + catch (const itk::ExceptionObject & /* excep */) { // std::cout << "Relabel: exception caught !" << std::endl; // std::cout << excep << std::endl; @@ -9903,7 +9903,7 @@ DiceAndMinDistSum(int argc, char * argv[]) { OutputCSV->Write(); } - catch (itk::ExceptionObject & /* exp */) + catch (const itk::ExceptionObject & /* exp */) { // std::cout << "Exception caught!" << std::endl; // std::cout << exp << std::endl; @@ -9945,7 +9945,7 @@ DiceAndMinDistSum(int argc, char * argv[]) OutputCSV->Write(); // std::cout << "Output written to " << outname.c_str() << ".csv." << std::endl; } - catch (itk::ExceptionObject & /* exp */) + catch (const itk::ExceptionObject & /* exp */) { // std::cout << "Exception caught!" << std::endl; // std::cout << exp << std::endl; @@ -11441,7 +11441,7 @@ ConvertImageSetToMatrix(unsigned int argc, char * argv[]) { writer->Write(); } - catch (itk::ExceptionObject & /* exp */) + catch (const itk::ExceptionObject & /* exp */) { // std::cout << "Exception caught!" << std::endl; // std::cout << exp << std::endl; @@ -11577,7 +11577,7 @@ RandomlySampleImageSetToCSV(unsigned int argc, char * argv[]) { writer->Write(); } - catch (itk::ExceptionObject & /* exp */) + catch (const itk::ExceptionObject & /* exp */) { // std::cout << "Exception caught!" << std::endl; // std::cout << exp << std::endl; @@ -11757,7 +11757,7 @@ ConvertImageSetToEigenvectors(unsigned int argc, char * argv[]) { writer->Write(); } - catch (itk::ExceptionObject & /* exp */) + catch (const itk::ExceptionObject & /* exp */) { // std::cout << "Exception caught!" << std::endl; // std::cout << exp << std::endl; @@ -11782,7 +11782,7 @@ ConvertImageSetToEigenvectors(unsigned int argc, char * argv[]) { writer->Write(); } - catch (itk::ExceptionObject & /* exp */) + catch (const itk::ExceptionObject & /* exp */) { // std::cout << "Exception caught!" << std::endl; // std::cout << exp << std::endl; diff --git a/Examples/ImageSetStatistics.cxx b/Examples/ImageSetStatistics.cxx index f6663588d..bf52f71ac 100644 --- a/Examples/ImageSetStatistics.cxx +++ b/Examples/ImageSetStatistics.cxx @@ -284,7 +284,7 @@ GetClusterStat(typename TImage::Pointer image, { relabel->Update(); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "Relabel: exception caught !" << std::endl; std::cout << excep << std::endl; diff --git a/Examples/KellyKapowski.cxx b/Examples/KellyKapowski.cxx index 865f77f81..9cd53817f 100644 --- a/Examples/KellyKapowski.cxx +++ b/Examples/KellyKapowski.cxx @@ -372,7 +372,7 @@ DiReCT(itk::ants::CommandLineParser * parser) { direct->Update(); // causes problems with ANTsR , unknown reason } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { if (verbose) { diff --git a/Examples/LabelClustersUniquely.cxx b/Examples/LabelClustersUniquely.cxx index 5c49476f3..aa2a68210 100644 --- a/Examples/LabelClustersUniquely.cxx +++ b/Examples/LabelClustersUniquely.cxx @@ -99,7 +99,7 @@ LabelUniquely(int argc, char * argv[]) { relabel->Update(); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "Relabel: exception caught !" << std::endl; std::cout << excep << std::endl; diff --git a/Examples/LabelGeometryMeasures.cxx b/Examples/LabelGeometryMeasures.cxx index b838f2415..b47364d4c 100644 --- a/Examples/LabelGeometryMeasures.cxx +++ b/Examples/LabelGeometryMeasures.cxx @@ -230,7 +230,7 @@ LabelGeometryMeasures(int argc, char * argv[]) { writer->Write(); } - catch (itk::ExceptionObject & exp) + catch (const itk::ExceptionObject & exp) { std::cerr << "Exception caught!" << std::endl; std::cerr << exp << std::endl; diff --git a/Examples/LabelOverlapMeasures.cxx b/Examples/LabelOverlapMeasures.cxx index 4472b0964..86c705bc0 100644 --- a/Examples/LabelOverlapMeasures.cxx +++ b/Examples/LabelOverlapMeasures.cxx @@ -120,7 +120,7 @@ LabelOverlapMeasures(int argc, char * argv[]) { writer->Write(); } - catch (itk::ExceptionObject & exp) + catch (const itk::ExceptionObject & exp) { std::cerr << "Exception caught!" << std::endl; std::cerr << exp << std::endl; diff --git a/Examples/LesionFilling.cxx b/Examples/LesionFilling.cxx index 077921fcb..fd96d8799 100644 --- a/Examples/LesionFilling.cxx +++ b/Examples/LesionFilling.cxx @@ -53,7 +53,7 @@ LesionFilling(int argc, char * argv[]) { LesionReader->Update(); } - catch (itk::ExceptionObject & itkNotUsed(excp)) + catch (const itk::ExceptionObject & itkNotUsed(excp)) { std::cout << "no lesion mask that can be read" << std::endl; return 0; @@ -64,7 +64,7 @@ LesionFilling(int argc, char * argv[]) { T1Reader->Update(); } - catch (itk::ExceptionObject & itkNotUsed(excp)) + catch (const itk::ExceptionObject & itkNotUsed(excp)) { std::cout << "no T1 image that can be read" << std::endl; return 0; @@ -222,7 +222,7 @@ LesionFilling(int argc, char * argv[]) { writer->Update(); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cerr << "ExceptionObject caught !" << std::endl; std::cerr << err << std::endl; diff --git a/Examples/N3BiasFieldCorrection.cxx b/Examples/N3BiasFieldCorrection.cxx index bb0a2b2ef..59a6182a1 100644 --- a/Examples/N3BiasFieldCorrection.cxx +++ b/Examples/N3BiasFieldCorrection.cxx @@ -550,7 +550,7 @@ N3(itk::ants::CommandLineParser * parser) // correcter->DebugOn(); correcter->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { if (verbose) { diff --git a/Examples/N4BiasFieldCorrection.cxx b/Examples/N4BiasFieldCorrection.cxx index 437ec84db..e91256250 100644 --- a/Examples/N4BiasFieldCorrection.cxx +++ b/Examples/N4BiasFieldCorrection.cxx @@ -411,7 +411,7 @@ N4(itk::ants::CommandLineParser * parser) // correcter->DebugOn(); correcter->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { if (verbose) { diff --git a/Examples/NonLocalSuperResolution.cxx b/Examples/NonLocalSuperResolution.cxx index a808f05ef..3d86ae21d 100644 --- a/Examples/NonLocalSuperResolution.cxx +++ b/Examples/NonLocalSuperResolution.cxx @@ -353,7 +353,7 @@ NonLocalSuperResolution(itk::ants::CommandLineParser * parser) // superresoluter->DebugOn(); superresoluter->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { if (verbose) { diff --git a/Examples/ResampleImageBySpacing.cxx b/Examples/ResampleImageBySpacing.cxx index d0b83d46f..f4f46f5c3 100644 --- a/Examples/ResampleImageBySpacing.cxx +++ b/Examples/ResampleImageBySpacing.cxx @@ -152,7 +152,7 @@ ResampleImageBySpacing(std::vector args, std::ostream * /*out_strea { smootherX->Update(); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "Exception catched !" << std::endl; std::cout << excep << std::endl; @@ -285,7 +285,7 @@ ResampleImageBySpacing(std::vector args, std::ostream * /*out_strea { smootherX->Update(); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "Exception catched !" << std::endl; std::cout << excep << std::endl; @@ -414,7 +414,7 @@ ResampleImageBySpacing(std::vector args, std::ostream * /*out_strea { smootherX->Update(); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "Exception catched !" << std::endl; std::cout << excep << std::endl; diff --git a/Examples/WarpImageMultiTransform.cxx b/Examples/WarpImageMultiTransform.cxx index 98bdc1929..0333abaa3 100644 --- a/Examples/WarpImageMultiTransform.cxx +++ b/Examples/WarpImageMultiTransform.cxx @@ -865,7 +865,7 @@ WarpImageMultiTransform(std::vector args, std::ostream * /*out_stre return EXIT_FAILURE; } } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cout << "Exception caught during WarpImageMultiTransform." << std::endl; std::cout << e << std::endl; diff --git a/Examples/antsApplyTransforms.cxx b/Examples/antsApplyTransforms.cxx index 75c92b4a1..47dc6a616 100644 --- a/Examples/antsApplyTransforms.cxx +++ b/Examples/antsApplyTransforms.cxx @@ -792,7 +792,7 @@ antsApplyTransforms(itk::ants::CommandLineParser::Pointer & parser, unsigned int ANTs::WriteImage(caster->GetOutput(), (outputFileName).c_str()); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { if (verbose) { diff --git a/Examples/antsApplyTransformsToPoints.cxx b/Examples/antsApplyTransformsToPoints.cxx index 6050f3821..9a43ec05f 100644 --- a/Examples/antsApplyTransformsToPoints.cxx +++ b/Examples/antsApplyTransformsToPoints.cxx @@ -67,7 +67,7 @@ antsApplyTransformsToPoints(itk::ants::CommandLineParser::Pointer & parser) { reader->Update(); } - catch (itk::ExceptionObject & exp) + catch (const itk::ExceptionObject & exp) { std::cerr << "Exception caught!" << std::endl; std::cerr << exp << std::endl; @@ -212,7 +212,7 @@ antsApplyTransformsToPoints(itk::ants::CommandLineParser::Pointer & parser) { writer->Write(); } - catch (itk::ExceptionObject & exp) + catch (const itk::ExceptionObject & exp) { std::cerr << "Exception caught!" << std::endl; std::cerr << exp << std::endl; diff --git a/Examples/antsDisplacementAndVelocityFieldRegistrationCommandIterationUpdate.h b/Examples/antsDisplacementAndVelocityFieldRegistrationCommandIterationUpdate.h index 138b2520e..9e996224c 100644 --- a/Examples/antsDisplacementAndVelocityFieldRegistrationCommandIterationUpdate.h +++ b/Examples/antsDisplacementAndVelocityFieldRegistrationCommandIterationUpdate.h @@ -480,7 +480,7 @@ class antsDisplacementAndVelocityFieldRegistrationCommandIterationUpdate final : { writer->Update(); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cout << "Can't write warped image " << currentFileName.str().c_str() << std::endl; std::cout << "Exception Object caught: " << std::endl; diff --git a/Examples/antsJointFusion.cxx b/Examples/antsJointFusion.cxx index 3fa072cf8..0bacf3fee 100644 --- a/Examples/antsJointFusion.cxx +++ b/Examples/antsJointFusion.cxx @@ -497,7 +497,7 @@ antsJointFusion(itk::ants::CommandLineParser * parser) { fusionFilter->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { if (verbose) { diff --git a/Examples/antsJointTensorFusion.cxx b/Examples/antsJointTensorFusion.cxx index 4c8108b2c..cd70544d4 100644 --- a/Examples/antsJointTensorFusion.cxx +++ b/Examples/antsJointTensorFusion.cxx @@ -441,7 +441,7 @@ antsJointTensorFusion(itk::ants::CommandLineParser * parser) { fusionFilter->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { if (verbose) { diff --git a/Examples/antsLandmarkBasedTransformInitializer.cxx b/Examples/antsLandmarkBasedTransformInitializer.cxx index 26d5aaba7..e7f1a4a90 100644 --- a/Examples/antsLandmarkBasedTransformInitializer.cxx +++ b/Examples/antsLandmarkBasedTransformInitializer.cxx @@ -183,7 +183,7 @@ InitializeLinearTransform(int itkNotUsed(argc), char * argv[]) { transformWriter->Update(); } - catch (itk::ExceptionObject & itkNotUsed(err)) + catch (const itk::ExceptionObject & itkNotUsed(err)) { std::cerr << "Exception in writing transform file: " << argv[5] << std::endl; return EXIT_FAILURE; diff --git a/Examples/antsMotionCorr.cxx b/Examples/antsMotionCorr.cxx index c333fcef6..f4e41075a 100644 --- a/Examples/antsMotionCorr.cxx +++ b/Examples/antsMotionCorr.cxx @@ -1269,7 +1269,7 @@ ants_motion(itk::ants::CommandLineParser * parser) std::cout << std::endl << "*** Running affine registration ***" << timedim << std::endl << std::endl; affineRegistration->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cerr << "Exception caught: " << e << std::endl; return EXIT_FAILURE; @@ -1347,7 +1347,7 @@ ants_motion(itk::ants::CommandLineParser * parser) std::cout << std::endl << "*** Running rigid registration ***" << timedim << std::endl << std::endl; rigidRegistration->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cerr << "Exception caught: " << e << std::endl; return EXIT_FAILURE; @@ -1446,7 +1446,7 @@ ants_motion(itk::ants::CommandLineParser * parser) { displacementFieldRegistration->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cerr << "Exception caught: " << e << std::endl; return EXIT_FAILURE; @@ -1567,7 +1567,7 @@ ants_motion(itk::ants::CommandLineParser * parser) { displacementFieldRegistration->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cerr << "Exception caught: " << e << std::endl; return EXIT_FAILURE; diff --git a/Examples/antsRegistration.cxx b/Examples/antsRegistration.cxx index 2a09c1f31..e67ebad29 100644 --- a/Examples/antsRegistration.cxx +++ b/Examples/antsRegistration.cxx @@ -769,7 +769,7 @@ antsRegistration(std::vector args, std::ostream * /*out_stream = nu } } } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cerr << "Exception Object caught: " << std::endl; std::cerr << err << std::endl; diff --git a/Examples/antsRegistrationOptimizerCommandIterationUpdate.h b/Examples/antsRegistrationOptimizerCommandIterationUpdate.h index 8d3584d3c..966c85801 100644 --- a/Examples/antsRegistrationOptimizerCommandIterationUpdate.h +++ b/Examples/antsRegistrationOptimizerCommandIterationUpdate.h @@ -419,7 +419,7 @@ class antsRegistrationOptimizerCommandIterationUpdate final : public itk::Comman { writer->Update(); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cout << "Can't write warped image " << currentFileName.str().c_str() << std::endl; std::cout << "Exception Object caught: " << std::endl; diff --git a/Examples/antsRegistrationTemplateHeader.h b/Examples/antsRegistrationTemplateHeader.h index b6b84dd85..6030100fc 100644 --- a/Examples/antsRegistrationTemplateHeader.h +++ b/Examples/antsRegistrationTemplateHeader.h @@ -1445,7 +1445,7 @@ DoRegistration(typename ParserType::Pointer & parser) velocityFieldWriter->Update(); } } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { if (verbose) { diff --git a/Examples/antsSliceRegularizedRegistration.cxx b/Examples/antsSliceRegularizedRegistration.cxx index 578b53a08..fc36aa496 100644 --- a/Examples/antsSliceRegularizedRegistration.cxx +++ b/Examples/antsSliceRegularizedRegistration.cxx @@ -781,7 +781,7 @@ ants_slice_regularized_registration(itk::ants::CommandLineParser * parser) { translationRegistration->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cerr << "Exception caught: " << e << std::endl; return EXIT_FAILURE; diff --git a/Examples/iMath.cxx b/Examples/iMath.cxx index 0eaf1417a..5f01b8185 100644 --- a/Examples/iMath.cxx +++ b/Examples/iMath.cxx @@ -152,7 +152,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathBlobDetector(input, nBlobs); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "BlobDetector: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -188,7 +188,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathCanny(input, sigma, lower, upper); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "Canny: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -222,7 +222,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathDistanceMap(input, useSpacing); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "DistanceMap: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -256,7 +256,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathFillHoles(input, holeType); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "FillHoles: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -289,7 +289,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathGC(input, radius); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "GC: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -322,7 +322,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathGD(input, radius); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "GD: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -355,7 +355,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathGE(input, radius); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "GE: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -388,7 +388,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathGO(input, radius); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "GO: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -420,7 +420,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathGetLargestComponent(input, minSize); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "GetLargestComponents: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -458,7 +458,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathGrad(input, sigma, normalize); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "Grad: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -495,7 +495,7 @@ iMathHelperAll(int argc, char ** argv) std::cout << " a " << alpha << " b " << beta << std::endl; output = iMathHistogramEqualization(input, alpha, beta, 1); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "HistogramEqualization: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -533,7 +533,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathLaplacian(input, sigma, normalize); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "Laplacian: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -601,7 +601,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathMC(input, radius, value, shape, parametric, lines, thickness, includeCenter); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "MC: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -668,7 +668,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathMD(input, radius, value, shape, parametric, lines, thickness, includeCenter); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "MD: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -734,7 +734,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathME(input, radius, value, shape, parametric, lines, thickness, includeCenter); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "ME: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -800,7 +800,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathMO(input, radius, value, shape, parametric, lines, thickness, includeCenter); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "MO: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -833,7 +833,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathMaurerDistance(input, foreground); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "MaurerDistance: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -859,7 +859,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathNormalize(input); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "Normalize: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -888,7 +888,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathPad(input, padding); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "Pad: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -926,7 +926,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathPeronaMalik(input, nIterations, conductance); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "PeronaMalik: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -952,7 +952,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathSharpen(input); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "Sharpen: exception caught !" << std::endl; std::cout << excep << std::endl; @@ -1042,7 +1042,7 @@ iMathHelperAll(int argc, char ** argv) { output = iMathTruncateIntensity(input, lowerQ, upperQ, nBins, mask); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { std::cout << "TruncateIntensity: exception caught !" << std::endl; std::cout << excep << std::endl; diff --git a/Examples/iMathFunctions2.hxx b/Examples/iMathFunctions2.hxx index ced480156..fbde38f7a 100644 --- a/Examples/iMathFunctions2.hxx +++ b/Examples/iMathFunctions2.hxx @@ -175,7 +175,7 @@ iMathGetLargestComponent(typename ImageType::Pointer image, /*3*/ { relabel->Update(); } - catch (itk::ExceptionObject & itkNotUsed(excep)) + catch (const itk::ExceptionObject & itkNotUsed(excep)) { // std::cout << "Relabel: exception caught !" << std::endl; // std::cout << excep << std::endl; diff --git a/Examples/itkTestMain.h b/Examples/itkTestMain.h index cb966672f..3bd635f2e 100644 --- a/Examples/itkTestMain.h +++ b/Examples/itkTestMain.h @@ -270,7 +270,7 @@ RegressionTestImage(const char * testImageFilename, { baselineReader->UpdateLargestPossibleRegion(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cerr << "Exception detected while reading " << baselineImageFilename << " : " << e.GetDescription(); return 1000; @@ -283,7 +283,7 @@ RegressionTestImage(const char * testImageFilename, { testReader->UpdateLargestPossibleRegion(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cerr << "Exception detected while reading " << testImageFilename << " : " << e.GetDescription() << std::endl; return 1000; diff --git a/Examples/itkantsRegistrationHelper.h b/Examples/itkantsRegistrationHelper.h index ba4f8b238..0dc3ac929 100644 --- a/Examples/itkantsRegistrationHelper.h +++ b/Examples/itkantsRegistrationHelper.h @@ -1077,7 +1077,7 @@ class RegistrationHelper final : public itk::Object transformObserver->Execute(registrationMethod, itk::StartEvent()); registrationMethod->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { this->Logger() << "Exception caught: " << e << std::endl; return EXIT_FAILURE; diff --git a/Examples/itkantsRegistrationHelper.hxx b/Examples/itkantsRegistrationHelper.hxx index 73182eed4..fa56bb612 100644 --- a/Examples/itkantsRegistrationHelper.hxx +++ b/Examples/itkantsRegistrationHelper.hxx @@ -1817,7 +1817,7 @@ RegistrationHelper::DoRegistration() displacementFieldRegistrationObserver->Execute(registrationMethod, itk::StartEvent()); registrationMethod->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { this->Logger() << "Exception caught: " << e << std::endl; return EXIT_FAILURE; @@ -1950,7 +1950,7 @@ RegistrationHelper::DoRegistration() displacementFieldRegistrationObserver->Execute(registrationMethod, itk::StartEvent()); registrationMethod->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { this->Logger() << "Exception caught: " << e << std::endl; return EXIT_FAILURE; @@ -2172,7 +2172,7 @@ RegistrationHelper::DoRegistration() displacementFieldRegistrationObserver2->Execute(displacementFieldRegistration, itk::StartEvent()); displacementFieldRegistration->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { this->Logger() << "Exception caught: " << e << std::endl; return EXIT_FAILURE; @@ -2332,7 +2332,7 @@ RegistrationHelper::DoRegistration() displacementFieldRegistrationObserver->Execute(registrationMethod, itk::StartEvent()); registrationMethod->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { this->Logger() << "Exception caught: " << e << std::endl; return EXIT_FAILURE; @@ -2447,7 +2447,7 @@ RegistrationHelper::DoRegistration() displacementFieldRegistrationObserver->Execute(registrationMethod, itk::StartEvent()); registrationMethod->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { this->Logger() << "Exception caught: " << e << std::endl; return EXIT_FAILURE; @@ -2683,7 +2683,7 @@ RegistrationHelper::DoRegistration() velocityFieldRegistrationObserver->Execute(velocityFieldRegistration, itk::StartEvent()); velocityFieldRegistration->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { this->Logger() << "Exception caught: " << e << std::endl; return EXIT_FAILURE; @@ -2903,7 +2903,7 @@ RegistrationHelper::DoRegistration() velocityFieldRegistrationObserver->Execute(velocityFieldRegistration, itk::StartEvent()); velocityFieldRegistration->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { this->Logger() << "Exception caught: " << e << std::endl; return EXIT_FAILURE; @@ -3062,7 +3062,7 @@ RegistrationHelper::DoRegistration() velocityFieldRegistrationObserver->Execute(velocityFieldRegistration, itk::StartEvent()); velocityFieldRegistration->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { this->Logger() << "Exception caught: " << e << std::endl; return EXIT_FAILURE; @@ -3226,7 +3226,7 @@ RegistrationHelper::DoRegistration() displacementFieldRegistrationObserver->Execute(displacementFieldRegistration, itk::StartEvent()); displacementFieldRegistration->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { this->Logger() << "Exception caught: " << e << std::endl; return EXIT_FAILURE; @@ -3408,7 +3408,7 @@ RegistrationHelper::DoRegistration() displacementFieldRegistrationObserver->Execute(displacementFieldRegistration, itk::StartEvent()); displacementFieldRegistration->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { this->Logger() << "Exception caught: " << e << std::endl; return EXIT_FAILURE; @@ -3513,7 +3513,7 @@ RegistrationHelper::DoRegistration() bsplineObserver->Execute(registrationMethod, itk::StartEvent()); registrationMethod->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { this->Logger() << "Exception caught: " << e << std::endl; return EXIT_FAILURE; diff --git a/Examples/sccan.cxx b/Examples/sccan.cxx index 8a6be3024..821bb9e12 100644 --- a/Examples/sccan.cxx +++ b/Examples/sccan.cxx @@ -157,7 +157,7 @@ WriteSortedVariatesToSpatialImage(std::string filename, { writer1->Write(); } - catch (itk::ExceptionObject & exp) + catch (const itk::ExceptionObject & exp) { // std::cerr << "Exception caught!" << std::endl; // std::cerr << exp << std::endl; @@ -199,7 +199,7 @@ WriteSortedVariatesToSpatialImage(std::string filename, { writerROI->Write(); } - catch (itk::ExceptionObject & exp) + catch (const itk::ExceptionObject & exp) { // std::cerr << "Exception caught!" << std::endl; // std::cerr << exp << std::endl; @@ -235,7 +235,7 @@ WriteSortedVariatesToSpatialImage(std::string filename, { writer->Write(); } - catch (itk::ExceptionObject & exp) + catch (const itk::ExceptionObject & exp) { // std::cerr << "Exception caught!" << std::endl; // std::cerr << exp << std::endl; @@ -286,7 +286,7 @@ WriteVariatesToSpatialImage(std::string filename, { writer->Write(); } - catch (itk::ExceptionObject & itkNotUsed(exp)) + catch (const itk::ExceptionObject & itkNotUsed(exp)) { // std::cerr << "Exception caught!" << std::endl; // std::cerr << exp << std::endl; @@ -320,7 +320,7 @@ WriteVariatesToSpatialImage(std::string filename, { writer->Write(); } - catch (itk::ExceptionObject & itkNotUsed(exp)) + catch (const itk::ExceptionObject & itkNotUsed(exp)) { // std::cerr << "Exception caught!" << std::endl; // std::cerr << exp << std::endl; @@ -346,7 +346,7 @@ WriteVariatesToSpatialImage(std::string filename, { writer->Write(); } - catch (itk::ExceptionObject & itkNotUsed(exp)) + catch (const itk::ExceptionObject & itkNotUsed(exp)) { // std::cerr << "Exception caught!" << std::endl; // std::cerr << exp << std::endl; @@ -508,7 +508,7 @@ ReadMatrixFromCSVorImageSet(std::string matname, vnl_matrix & p) { reader->Update(); } - catch (itk::ExceptionObject & itkNotUsed(exp)) + catch (const itk::ExceptionObject & itkNotUsed(exp)) { // std::cerr << "Exception caught!" << std::endl; // std::cerr << exp << std::endl; @@ -628,7 +628,7 @@ ConvertImageListToMatrix(std::string imagelist, std::string maskfn, std::string { writer->Write(); } - catch (itk::ExceptionObject & itkNotUsed(exp)) + catch (const itk::ExceptionObject & itkNotUsed(exp)) { // std::cerr << "Exception caught!" << std::endl; // std::cerr << exp << std::endl; @@ -863,7 +863,7 @@ ConvertTimeSeriesImageToMatrix(std::string imagefn, { writer->Write(); } - catch (itk::ExceptionObject & itkNotUsed(exp)) + catch (const itk::ExceptionObject & itkNotUsed(exp)) { // std::cerr << "Exception caught!" << std::endl; // std::cerr << exp << std::endl; @@ -909,7 +909,7 @@ ConvertTimeSeriesImageToMatrix(std::string imagefn, { writer->Write(); } - catch (itk::ExceptionObject & itkNotUsed(exp)) + catch (const itk::ExceptionObject & itkNotUsed(exp)) { // std::cerr << "Exception caught!" << std::endl; // std::cerr << exp << std::endl; diff --git a/Examples/simpleSynRegistration.cxx b/Examples/simpleSynRegistration.cxx index 04b59a2b1..f3fd1f495 100644 --- a/Examples/simpleSynRegistration.cxx +++ b/Examples/simpleSynRegistration.cxx @@ -134,7 +134,7 @@ simpleSynRegistration(std::vector args, std::ostream * /*out_stream { fixedImage->Update(); } - catch (itk::ExceptionObject & excp) + catch (const itk::ExceptionObject & excp) { std::cerr << excp << std::endl; return EXIT_FAILURE; @@ -148,7 +148,7 @@ simpleSynRegistration(std::vector args, std::ostream * /*out_stream { movingImage->Update(); } - catch (itk::ExceptionObject & excp) + catch (const itk::ExceptionObject & excp) { std::cerr << excp << std::endl; return EXIT_FAILURE; diff --git a/ImageRegistration/ANTS_affine_registration.h b/ImageRegistration/ANTS_affine_registration.h index f298187cc..a39998f12 100644 --- a/ImageRegistration/ANTS_affine_registration.h +++ b/ImageRegistration/ANTS_affine_registration.h @@ -111,7 +111,7 @@ write_transform_file(TransformPointerType & transform, StringType filename) { transform_writer->Update(); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl << "Exception in writing transform file: " << std::endl @@ -141,7 +141,7 @@ read_transform_file(StringType filename, CastTransformPointerType & transform) { tran_reader->Update(); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cout << err << std::endl; std::cout << "Exception caught in reading tran para file: " << filename << std::endl; @@ -623,7 +623,7 @@ get_cost_value_mmi(ImagePointerType fixedImage, { rval = mattesMutualInfo->GetValue(para); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl << "Exception caught in computing mattesMutualInfo after registration" << std::endl @@ -643,7 +643,7 @@ get_cost_value_mmi(ImagePointerType fixedImage, { rval0 = mattesMutualInfo->GetValue(para0); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl << "Exception caught in computing mattesMutualInfo before registration" << std::endl @@ -682,7 +682,7 @@ register_image_cxy(ImagePointerType fixed_image, ImagePointerType moving_image, initializer->InitializeTransform(); transform->SetAngle(0.0); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!1" << std::endl << "Exception in InitializeTransform" << std::endl; return false; @@ -720,7 +720,7 @@ register_image_cxyz(ImagePointerType fixed_image, ImagePointerType moving_image, initializer->MomentsOn(); initializer->InitializeTransform(); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!1" << std::endl << "Exception in InitializeTransform" << std::endl; return false; @@ -854,7 +854,7 @@ register_image_affine3d_mres_mask(ImagePointerType fixed_image, { registration->Update(); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cout << "ExceptionObject caught !" << std::endl; std::cout << err << std::endl; @@ -1006,7 +1006,7 @@ register_image_affine2d_mres_mask(ImagePointerType fixed_image, { registration->Update(); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cout << "ExceptionObject caught !" << std::endl; std::cout << err << std::endl; diff --git a/ImageRegistration/ANTS_affine_registration2.h b/ImageRegistration/ANTS_affine_registration2.h index 5754664dd..8b0450d83 100644 --- a/ImageRegistration/ANTS_affine_registration2.h +++ b/ImageRegistration/ANTS_affine_registration2.h @@ -183,7 +183,7 @@ WriteAffineTransformFile(typename TransformType::Pointer & transform, const std: { transform_writer->Update(); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << err << std::endl << "Exception in writing transform file: " << std::endl @@ -212,7 +212,7 @@ ReadAffineTransformFile(const std::string & filename, typename CastTransformType { tran_reader->Update(); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cout << err << std::endl; std::cout << "Exception caught in reading tran para file: " << filename << std::endl; @@ -859,7 +859,7 @@ TestCostValueMMI(ImagePointerType fixedImage, { rval = mattesMutualInfo->GetValue(para); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << err << std::endl << "Exception caught in computing mattesMutualInfo after registration" << std::endl @@ -1124,7 +1124,7 @@ SymmRegisterImageAffineMutualInformationMultiResolution(RunningAffineCacheType & metric->GetValueAndDerivative(current_para, value, original_gradient); invmetric->GetValueAndDerivative(invtransform->GetParameters(), invvalue, invoriginal_gradient); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cout << "ExceptionObject caught !" << std::endl; std::cout << err << std::endl; @@ -1327,7 +1327,7 @@ RegisterImageAffineMutualInformationMultiResolution(RunningAffineCacheType & run { metric->GetValueAndDerivative(current_para, value, original_gradient); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cout << "ExceptionObject caught !" << std::endl; std::cout << err << std::endl; @@ -1473,7 +1473,7 @@ RegisterImageAffineMutualInformationMultiResolution(RunningAffineCacheType & run { metric->GetValueAndDerivative(current_para2, value, original_gradient); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cout << "ExceptionObject caught !" << std::endl; std::cout << err << std::endl; diff --git a/Temporary/itkFEMConformalMap.cxx b/Temporary/itkFEMConformalMap.cxx index ab587ff2d..c3b848272 100644 --- a/Temporary/itkFEMConformalMap.cxx +++ b/Temporary/itkFEMConformalMap.cxx @@ -1011,7 +1011,7 @@ FEMConformalMap::ConformalMap() { m_Solver.Read(f); } - catch (::itk::fem::FEMException & e) + catch (const ::itk::fem::FEMException & e) { ::std::cout << "Error reading FEM problem: " << filename << "!\n"; e.Print(::std::cout); diff --git a/Temporary/itkFEMDiscConformalMap.cxx b/Temporary/itkFEMDiscConformalMap.cxx index 015696b54..7a431ea75 100644 --- a/Temporary/itkFEMDiscConformalMap.cxx +++ b/Temporary/itkFEMDiscConformalMap.cxx @@ -1403,7 +1403,7 @@ FEMDiscConformalMap::ConformalMap() { m_Solver.Read(f); } - catch (::itk::fem::FEMException & e) + catch (const ::itk::fem::FEMException & e) { std::cout << "Error reading FEM problem: " << filename << "!\n"; e.Print(std::cout); diff --git a/Temporary/itkFEMElement3DMembrane1DOF.hxx b/Temporary/itkFEMElement3DMembrane1DOF.hxx index 069669bef..0353b9b2f 100644 --- a/Temporary/itkFEMElement3DMembrane1DOF.hxx +++ b/Temporary/itkFEMElement3DMembrane1DOF.hxx @@ -99,7 +99,7 @@ Element3DMembrane1DOF::Read(std::istream & f, void * info) } m_mat = dynamic_cast(&*mats->Find(n)); } - catch (FEMExceptionObjectNotFound & e) + catch (const FEMExceptionObjectNotFound & e) { throw FEMExceptionObjectNotFound(__FILE__, __LINE__, "Element3DMembrane1DOF::Read()", e.m_baseClassName, e.m_GN); } diff --git a/Utilities/ReadWriteData.h b/Utilities/ReadWriteData.h index 478c5feb2..0f258d95c 100644 --- a/Utilities/ReadWriteData.h +++ b/Utilities/ReadWriteData.h @@ -177,7 +177,7 @@ ReadTensorImage(itk::SmartPointer & target, const char * file, bool { reffilter->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cerr << "Exception caught during reference file reading " << std::endl; std::cerr << e << " file " << file << std::endl; @@ -198,7 +198,7 @@ ReadTensorImage(itk::SmartPointer & target, const char * file, bool { logFilter->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cerr << "Exception caught during log tensor filter " << std::endl; std::cerr << e << " file " << file << std::endl; @@ -259,7 +259,7 @@ ReadImage(itk::SmartPointer & target, const char * file) { reffilter->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cerr << "Exception caught during reference file reading " << std::endl; std::cerr << e << " file " << file << std::endl; @@ -291,7 +291,7 @@ ReadImage(char * fn) { reffilter->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cerr << "Exception caught during image reference file reading " << std::endl; std::cerr << e << std::endl; @@ -323,7 +323,7 @@ ReadTensorImage(char * fn, bool takelog = true) { reffilter->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cerr << "Exception caught during tensor image reference file reading " << std::endl; std::cerr << e << std::endl; @@ -375,7 +375,7 @@ ReadLabeledPointSet(itk::SmartPointer & target, { reffilter->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cerr << "Exception caught during point set reference file reading " << std::endl; std::cerr << e << std::endl; @@ -471,7 +471,7 @@ ReadLabeledPointSet(char * fn) { reffilter->Update(); } - catch (itk::ExceptionObject & e) + catch (const itk::ExceptionObject & e) { std::cerr << "Exception caught during point set reference file reading " << std::endl; std::cerr << e << std::endl; diff --git a/Utilities/antsSCCANObject.hxx b/Utilities/antsSCCANObject.hxx index afe92d538..cf445cf17 100644 --- a/Utilities/antsSCCANObject.hxx +++ b/Utilities/antsSCCANObject.hxx @@ -354,7 +354,7 @@ antsSCCANObject::ClusterThresholdVariate( { relabel->Update(); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { if (!this->m_Silent) std::cout << "Relabel: exception caught !" << std::endl; @@ -480,7 +480,7 @@ antsSCCANObject::ClusterThresholdVariate4D( { relabel->Update(); } - catch (itk::ExceptionObject & excep) + catch (const itk::ExceptionObject & excep) { if (!this->m_Silent) std::cout << "Relabel: exception caught !" << std::endl; diff --git a/Utilities/itkSimulatedExponentialDisplacementFieldSource.hxx b/Utilities/itkSimulatedExponentialDisplacementFieldSource.hxx index 48bea4e93..96af243ec 100644 --- a/Utilities/itkSimulatedExponentialDisplacementFieldSource.hxx +++ b/Utilities/itkSimulatedExponentialDisplacementFieldSource.hxx @@ -164,7 +164,7 @@ SimulatedExponentialDisplacementFieldSource::GenerateData() { smoother->Update(); } - catch (ExceptionObject & exc) + catch (const ExceptionObject & exc) { std::string msg("Caught exception: "); msg += exc.what(); diff --git a/Utilities/itkVectorImageFileReader.hxx b/Utilities/itkVectorImageFileReader.hxx index d2085f540..7eefc361a 100644 --- a/Utilities/itkVectorImageFileReader.hxx +++ b/Utilities/itkVectorImageFileReader.hxx @@ -104,7 +104,7 @@ VectorImageFileReader::GenerateOutputI m_ExceptionMessage = ""; this->TestFileExistanceAndReadability(); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { m_ExceptionMessage = err.GetDescription(); } @@ -431,7 +431,7 @@ VectorImageFileReader::GenerateData() m_ExceptionMessage = ""; this->TestFileExistanceAndReadability(); } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { m_ExceptionMessage = err.GetDescription(); } diff --git a/Utilities/itkantsReadWriteTransform.h b/Utilities/itkantsReadWriteTransform.h index 248ca129d..7805ea24d 100644 --- a/Utilities/itkantsReadWriteTransform.h +++ b/Utilities/itkantsReadWriteTransform.h @@ -209,7 +209,7 @@ WriteTransform(typename itk::Transform::Poi transformWriter->Update(); } } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cerr << "Can't write transform file " << filename << std::endl; std::cerr << "Exception Object caught: " << std::endl; @@ -254,7 +254,7 @@ WriteInverseTransform(typename itk::DisplacementFieldTransformUpdate(); } } - catch (itk::ExceptionObject & err) + catch (const itk::ExceptionObject & err) { std::cerr << "Can't write transform file " << filename << std::endl; std::cerr << "Exception Object caught: " << std::endl;