From ef9907597b036499127b716eb72138ac8cf7e7c3 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 2 May 2024 18:28:27 -0400 Subject: [PATCH] STYLE: Apply clang-format to LabelGeometryImageFilter Command: ./Utilities/Maintenance/clang-format.bash --clang-format /home/matt/bin/ITK3-Wrap-Release/ClangFormat-prefix/src/ClangFormat/clang-format --tracked --- .../include/itkLabelGeometryImageFilter.h | 129 ++++++------------ 1 file changed, 40 insertions(+), 89 deletions(-) diff --git a/Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.h b/Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.h index f602e6638a4..8bdb1ca588a 100644 --- a/Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.h +++ b/Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.h @@ -78,9 +78,9 @@ namespace itk * \endsphinx */ template -class ITK_TEMPLATE_EXPORT - [[deprecated("This class contains known computational bugs. See class documentation for details.")]] - LabelGeometryImageFilter : public ImageToImageFilter +class ITK_TEMPLATE_EXPORT [[deprecated( + "This class contains known computational bugs. See class documentation for details.")]] LabelGeometryImageFilter + : public ImageToImageFilter { public: ITK_DISALLOW_COPY_AND_MOVE(LabelGeometryImageFilter); @@ -254,8 +254,7 @@ class ITK_TEMPLATE_EXPORT // Macros for enabling the calculation of additional features. itkGetMacro(CalculatePixelIndices, bool); itkBooleanMacro(CalculatePixelIndices); - void - SetCalculatePixelIndices(const bool value) + void SetCalculatePixelIndices(const bool value) { // CalculateOrientedBoundingBox, CalculateOrientedLabelImage, and // CalculateOrientedIntensityImage all need CalculatePixelIndices to be @@ -281,8 +280,7 @@ class ITK_TEMPLATE_EXPORT itkGetMacro(CalculateOrientedBoundingBox, bool); itkBooleanMacro(CalculateOrientedBoundingBox); - void - SetCalculateOrientedBoundingBox(const bool value) + void SetCalculateOrientedBoundingBox(const bool value) { if (this->m_CalculateOrientedBoundingBox != value) { @@ -300,8 +298,7 @@ class ITK_TEMPLATE_EXPORT itkGetMacro(CalculateOrientedLabelRegions, bool); itkBooleanMacro(CalculateOrientedLabelRegions); - void - SetCalculateOrientedLabelRegions(const bool value) + void SetCalculateOrientedLabelRegions(const bool value) { if (this->m_CalculateOrientedLabelRegions != value) { @@ -319,8 +316,7 @@ class ITK_TEMPLATE_EXPORT itkGetMacro(CalculateOrientedIntensityRegions, bool); itkBooleanMacro(CalculateOrientedIntensityRegions); - void - SetCalculateOrientedIntensityRegions(const bool value) + void SetCalculateOrientedIntensityRegions(const bool value) { if (this->m_CalculateOrientedIntensityRegions != value) { @@ -337,117 +333,83 @@ class ITK_TEMPLATE_EXPORT } /** Set the intensity image */ - void - SetIntensityInput(const TIntensityImage * input) + void SetIntensityInput(const TIntensityImage * input) { // Process object is not const-correct so the const casting is required. this->SetNthInput(1, const_cast(input)); } /** Get the label image */ - const TIntensityImage * - GetIntensityInput() const + const TIntensityImage * GetIntensityInput() const { return static_cast(const_cast(this->ProcessObject::GetInput(1))); } /** Does the specified label exist? Can only be called after * a call to Update(). */ - bool - HasLabel(LabelPixelType label) const - { - return m_LabelGeometryMapper.find(label) != m_LabelGeometryMapper.end(); - } + bool HasLabel(LabelPixelType label) const { return m_LabelGeometryMapper.find(label) != m_LabelGeometryMapper.end(); } /** Get the number of labels used */ - SizeValueType - GetNumberOfObjects() const - { - return m_LabelGeometryMapper.size(); - } + SizeValueType GetNumberOfObjects() const { return m_LabelGeometryMapper.size(); } - SizeValueType - GetNumberOfLabels() const - { - return this->GetNumberOfObjects(); - } + SizeValueType GetNumberOfLabels() const { return this->GetNumberOfObjects(); } /** Get the labels that are in the image. */ - std::vector - GetLabels() const - { - return m_AllLabels; - } + std::vector GetLabels() const { return m_AllLabels; } /** Return the all pixel indices for a label. */ - LabelIndicesType - GetPixelIndices(LabelPixelType label) const; + LabelIndicesType GetPixelIndices(LabelPixelType label) const; /** Return the number of pixels for a label. This is the same as * the volume and the zero order moment */ - SizeValueType - GetVolume(LabelPixelType label) const; + SizeValueType GetVolume(LabelPixelType label) const; /** Return the computed integrated pixel intensity for a label. */ - RealType - GetIntegratedIntensity(LabelPixelType label) const; + RealType GetIntegratedIntensity(LabelPixelType label) const; /** Return the unweighted centroid for a label. */ - LabelPointType - GetCentroid(LabelPixelType label) const; + LabelPointType GetCentroid(LabelPixelType label) const; /** Return the weighted centroid for a label. */ - LabelPointType - GetWeightedCentroid(LabelPixelType label) const; + LabelPointType GetWeightedCentroid(LabelPixelType label) const; /** Return the eigenvalues as a vector. */ - VectorType - GetEigenvalues(LabelPixelType label) const; + VectorType GetEigenvalues(LabelPixelType label) const; /** Return the eigenvectors as a matrix. */ - MatrixType - GetEigenvectors(LabelPixelType label) const; + MatrixType GetEigenvectors(LabelPixelType label) const; /** Return the axes length for a label. */ - AxesLengthType - GetAxesLength(LabelPixelType label) const; + AxesLengthType GetAxesLength(LabelPixelType label) const; /** Return the minor axis length for a label. This is a convenience * class that returns the shortest length from GetAxesLength. */ - RealType - GetMinorAxisLength(LabelPixelType label) const; + RealType GetMinorAxisLength(LabelPixelType label) const; /** Return the major axis length for a label. This is a convenience * class that returns the longest length from GetAxesLength. */ - RealType - GetMajorAxisLength(LabelPixelType label) const; + RealType GetMajorAxisLength(LabelPixelType label) const; /** Return the eccentricity for a label. */ - RealType - GetEccentricity(LabelPixelType label) const; + RealType GetEccentricity(LabelPixelType label) const; /** Return the elongation for a label. This is defined as the * length of the major axis divided by the length of the minor axis. */ - RealType - GetElongation(LabelPixelType label) const; + RealType GetElongation(LabelPixelType label) const; /** Return the orientation for a label defined in radians. */ - RealType - GetOrientation(LabelPixelType label) const; + RealType GetOrientation(LabelPixelType label) const; /** Return the computed bounding box for a label. * This is organized in min/max pairs as [min(X), max(X), min(Y), * max(Y), min(Z), max(Z),...] */ - BoundingBoxType - GetBoundingBox(LabelPixelType label) const; + BoundingBoxType GetBoundingBox(LabelPixelType label) const; /** Return the volume of the bounding box. */ - RealType - GetBoundingBoxVolume(LabelPixelType label) const; + RealType GetBoundingBoxVolume(LabelPixelType label) const; /** Return the size of the bounding box. */ - LabelSizeType - GetBoundingBoxSize(LabelPixelType label) const; + LabelSizeType GetBoundingBoxSize(LabelPixelType label) const; /** Return the oriented bounding box vertices. The order of the * vertices corresponds with binary counting, where min is zero and @@ -455,38 +417,30 @@ class ITK_TEMPLATE_EXPORT * [0,0],[0,1],[1,0],[1,1], which corresponds to * [minX,minY],[minX,maxY],[maxX,minY],[maxX,maxY]. Each * vertex is defined as an ND point. */ - BoundingBoxVerticesType - GetOrientedBoundingBoxVertices(LabelPixelType label) const; + BoundingBoxVerticesType GetOrientedBoundingBoxVertices(LabelPixelType label) const; /** Return the volume of the oriented bounding box. */ - RealType - GetOrientedBoundingBoxVolume(LabelPixelType label) const; + RealType GetOrientedBoundingBoxVolume(LabelPixelType label) const; /** Return the size of the oriented bounding box. */ - LabelPointType - GetOrientedBoundingBoxSize(LabelPixelType label) const; + LabelPointType GetOrientedBoundingBoxSize(LabelPixelType label) const; /** Return the origin of the oriented bounding box. */ - LabelPointType - GetOrientedBoundingBoxOrigin(LabelPixelType label) const; + LabelPointType GetOrientedBoundingBoxOrigin(LabelPixelType label) const; /** Return the rotation matrix defined by the * eigenvalues/eigenvectors. */ - MatrixType - GetRotationMatrix(LabelPixelType label) const; + MatrixType GetRotationMatrix(LabelPixelType label) const; /** Return the region defined by the bounding box. */ - RegionType - GetRegion(LabelPixelType label) const; + RegionType GetRegion(LabelPixelType label) const; /** Return the label region defined by the oriented bounding box. */ - TLabelImage * - GetOrientedLabelImage(LabelPixelType label) const; + TLabelImage * GetOrientedLabelImage(LabelPixelType label) const; /** Return the intensity region defined by the oriented bounding * box. */ - TIntensityImage * - GetOrientedIntensityImage(LabelPixelType label) const; + TIntensityImage * GetOrientedIntensityImage(LabelPixelType label) const; #ifdef ITK_USE_CONCEPT_CHECKING // Begin concept checking @@ -497,15 +451,12 @@ class ITK_TEMPLATE_EXPORT protected: LabelGeometryImageFilter(); ~LabelGeometryImageFilter() override = default; - void - PrintSelf(std::ostream & os, Indent indent) const override; + void PrintSelf(std::ostream & os, Indent indent) const override; - void - GenerateData() override; + void GenerateData() override; private: - bool - CalculateOrientedBoundingBoxVertices(vnl_symmetric_eigensystem eig, LabelGeometry & m_LabelGeometry); + bool CalculateOrientedBoundingBoxVertices(vnl_symmetric_eigensystem eig, LabelGeometry & m_LabelGeometry); bool m_CalculatePixelIndices{}; bool m_CalculateOrientedBoundingBox{};