Skip to content

Commit

Permalink
STYLE: Prefer in class initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
blowekamp authored and N-Dekker committed Mar 17, 2021
1 parent 2819485 commit 46f9452
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,17 @@ class ITK_TEMPLATE_EXPORT DirectedHausdorffDistanceImageFilter : public ImageToI
using DistanceMapPointer = typename DistanceMapType::Pointer;


DistanceMapPointer m_DistanceMap;
DistanceMapPointer m_DistanceMap{ nullptr };

RealType m_MaxDistance{ NumericTraits<RealType>::ZeroValue() };
IdentifierType m_PixelCount{};

using CompensatedSummationType = itk::CompensatedSummation<RealType>;
CompensatedSummationType m_Sum;

RealType m_DirectedHausdorffDistance;
RealType m_AverageHausdorffDistance;
bool m_UseImageSpacing;
RealType m_DirectedHausdorffDistance{ NumericTraits<RealType>::ZeroValue() };
RealType m_AverageHausdorffDistance{ NumericTraits<RealType>::ZeroValue() };
bool m_UseImageSpacing{ true };

std::mutex m_Mutex;
}; // end of class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ DirectedHausdorffDistanceImageFilter<TInputImage1, TInputImage2>::DirectedHausdo
// this filter requires two input images
this->SetNumberOfRequiredInputs(2);

m_DistanceMap = nullptr;
m_DirectedHausdorffDistance = NumericTraits<RealType>::ZeroValue();
m_AverageHausdorffDistance = NumericTraits<RealType>::ZeroValue();
m_UseImageSpacing = true;


this->DynamicMultiThreadingOn();
this->ThreaderUpdateProgressOff();
}
Expand Down Expand Up @@ -214,7 +208,7 @@ DirectedHausdorffDistanceImageFilter<TInputImage1, TInputImage2>::PrintSelf(std:
<< static_cast<typename NumericTraits<RealType>::PrintType>(m_DirectedHausdorffDistance) << std::endl;
os << indent << "AverageHausdorffDistance: "
<< static_cast<typename NumericTraits<RealType>::PrintType>(m_AverageHausdorffDistance) << std::endl;
os << indent << "UseImageSpacing : " << m_UseImageSpacing << std::endl;
os << indent << "UseImageSpacing: " << m_UseImageSpacing << std::endl;
}
} // end namespace itk
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ HausdorffDistanceImageFilter<TInputImage1, TInputImage2>::PrintSelf(std::ostream

os << indent << "HausdorffDistance: " << m_HausdorffDistance << std::endl;
os << indent << "AverageHausdorffDistance: " << m_AverageHausdorffDistance << std::endl;
os << indent << "Use Image Spacing : " << m_UseImageSpacing << std::endl;
os << indent << "Use Image Spacing: " << m_UseImageSpacing << std::endl;
}
} // end namespace itk
#endif

0 comments on commit 46f9452

Please sign in to comment.