From 27482c79c41908bd16747c991971e620d4a9978d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Thu, 29 Feb 2024 16:09:53 -0500 Subject: [PATCH] ENH: Display debugging parameters only when verbose flag is turned on --- ImageRegistration/itkANTSAffine3DTransform.hxx | 15 +++++++++------ Utilities/itkAverageAffineTransformFunction.hxx | 8 ++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ImageRegistration/itkANTSAffine3DTransform.hxx b/ImageRegistration/itkANTSAffine3DTransform.hxx index f6a0c1335..03b54504a 100644 --- a/ImageRegistration/itkANTSAffine3DTransform.hxx +++ b/ImageRegistration/itkANTSAffine3DTransform.hxx @@ -708,14 +708,17 @@ ANTSAffine3DTransform::ComputeMatrixParameters() r = static_cast(Q(0, 1) - Q(1, 0)) / s; } - std::cout << "A=" << A << std::endl; - std::cout << "rotation R" << Q << std::endl; - std::cout << "upper R" << R << std::endl; - std::cout << "s=" << s << " u=" << u << " v=" << v << " w" << w << " r=" << r << std::endl; - m_Rotation = VnlQuaternionType(u, v, w, r); - std::cout << "m_Rotation from vnl" << VnlQuaternionType(u, v, w, r) << std::endl; + if (this->GetDebug()) + { + std::cout << "A=\n" << A << std::endl; + std::cout << "rotation R\n" << Q << std::endl; + std::cout << "upper R\n" << R << std::endl; + std::cout << "s=" << s << " u=" << u << " v=" << v << " w" << w << " r=" << r << std::endl; + + std::cout << "m_Rotation from vnl: " << VnlQuaternionType(u, v, w, r) << std::endl; + } m_S1 = R(0, 0); m_S2 = R(1, 1); diff --git a/Utilities/itkAverageAffineTransformFunction.hxx b/Utilities/itkAverageAffineTransformFunction.hxx index a5e854d99..45a217caf 100644 --- a/Utilities/itkAverageAffineTransformFunction.hxx +++ b/Utilities/itkAverageAffineTransformFunction.hxx @@ -86,12 +86,20 @@ AverageAffineTransformFunction::AverageMultipleAffineTransform( typename TransformListType::iterator it = m_TransformList.begin(); typename InternalAffineTransformType::Pointer average_iaff = InternalAffineTransformType::New(); + if (verbose) + { + average_iaff->DebugOn(); + } typename InternalAffineTransformType::ParametersType average_parameters = average_iaff->GetParameters(); for (; it != m_TransformList.end(); it++) { SingleInternalTransformItemType internal_item; internal_item.aff = InternalAffineTransformType::New(); + if (verbose) + { + internal_item.aff->DebugOn(); + } ConvertGenericAffineToInternalAffineByFixingCenter(it->aff, internal_item.aff, reference_center); internal_item.weight = it->weight; m_InternalTransformList.push_back(internal_item);