Skip to content

Commit

Permalink
Merge pull request #1690 from dzenanz/refactorAvgAffine
Browse files Browse the repository at this point in the history
ENH: Display debugging parameters only when verbose flag is turned on
  • Loading branch information
cookpa authored Mar 1, 2024
2 parents 00be620 + 27482c7 commit beb4aa2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
15 changes: 9 additions & 6 deletions ImageRegistration/itkANTSAffine3DTransform.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -708,14 +708,17 @@ ANTSAffine3DTransform<TScalarType>::ComputeMatrixParameters()
r = static_cast<double>(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);
Expand Down
8 changes: 8 additions & 0 deletions Utilities/itkAverageAffineTransformFunction.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,20 @@ AverageAffineTransformFunction<TTransform>::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);
Expand Down

0 comments on commit beb4aa2

Please sign in to comment.