diff --git a/.clang-format b/.clang-format index 69950423abc..8a09866c072 100644 --- a/.clang-format +++ b/.clang-format @@ -24,14 +24,13 @@ AlignConsecutiveDeclarations: true AlignEscapedNewlines: Left AlignOperands: true AlignTrailingComments: true -# clang 9.0 AllowAllArgumentsOnNextLine: true -# clang 9.0 AllowAllConstructorInitializersOnNextLine: true +AllowAllArgumentsOnNextLine: true +AllowAllConstructorInitializersOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: false AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: Inline -# clang 9.0 AllowShortLambdasOnASingleLine: All -# clang 9.0 features AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: All AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None @@ -42,7 +41,7 @@ BinPackArguments: false BinPackParameters: false BreakBeforeBraces: Custom BraceWrapping: - # clang 9.0 feature AfterCaseLabel: false + AfterCaseLabel: false AfterClass: true AfterControlStatement: true AfterEnum: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000000..99a7be5b14d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +fail_fast: true +default_stages: [commit] +repos: +- repo: https://github.com/pre-commit/mirrors-clang-format + rev: v18.1.5 + hooks: + - id: clang-format + args: ['--style=file'] + files: '\.(c|cc|h|cxx|hxx)$' + exclude: '^Modules/ThirdParty' diff --git a/Examples/DataRepresentation/Mesh/MeshCellsIteration.cxx b/Examples/DataRepresentation/Mesh/MeshCellsIteration.cxx index 42b40ee45e1..130ff8b7b62 100644 --- a/Examples/DataRepresentation/Mesh/MeshCellsIteration.cxx +++ b/Examples/DataRepresentation/Mesh/MeshCellsIteration.cxx @@ -272,32 +272,28 @@ main(int, char *[]) CellType * cell = cellIterator.Value(); switch (cell->GetType()) { - case itk::CellGeometryEnum::VERTEX_CELL: - { + case itk::CellGeometryEnum::VERTEX_CELL: { std::cout << "VertexCell : " << std::endl; auto * line = dynamic_cast(cell); std::cout << "dimension = " << line->GetDimension() << std::endl; std::cout << "# points = " << line->GetNumberOfPoints() << std::endl; break; } - case itk::CellGeometryEnum::LINE_CELL: - { + case itk::CellGeometryEnum::LINE_CELL: { std::cout << "LineCell : " << std::endl; auto * line = dynamic_cast(cell); std::cout << "dimension = " << line->GetDimension() << std::endl; std::cout << "# points = " << line->GetNumberOfPoints() << std::endl; break; } - case itk::CellGeometryEnum::TRIANGLE_CELL: - { + case itk::CellGeometryEnum::TRIANGLE_CELL: { std::cout << "TriangleCell : " << std::endl; auto * line = dynamic_cast(cell); std::cout << "dimension = " << line->GetDimension() << std::endl; std::cout << "# points = " << line->GetNumberOfPoints() << std::endl; break; } - default: - { + default: { std::cout << "Cell with more than three points" << std::endl; std::cout << "dimension = " << cell->GetDimension() << std::endl; std::cout << "# points = " << cell->GetNumberOfPoints() << std::endl; diff --git a/Examples/Filtering/DigitallyReconstructedRadiograph1.cxx b/Examples/Filtering/DigitallyReconstructedRadiograph1.cxx index 54d91069eeb..0b000a98287 100644 --- a/Examples/Filtering/DigitallyReconstructedRadiograph1.cxx +++ b/Examples/Filtering/DigitallyReconstructedRadiograph1.cxx @@ -46,7 +46,7 @@ #include "itkRayCastInterpolateImageFunction.h" // Software Guide : EndCodeSnippet -//#define WRITE_CUBE_IMAGE_TO_FILE +// #define WRITE_CUBE_IMAGE_TO_FILE void diff --git a/Examples/Filtering/FFTDirectInverse2.cxx b/Examples/Filtering/FFTDirectInverse2.cxx index e98aba62085..3731e168207 100644 --- a/Examples/Filtering/FFTDirectInverse2.cxx +++ b/Examples/Filtering/FFTDirectInverse2.cxx @@ -43,9 +43,9 @@ #include "itkFlipImageFilter.h" #if !defined(ITK_USE_FFTWF) -//#error "This example only works when single precision FFTW is used -// Changing WorkPixeltype to double and changing this conditional to -// ITK_USE_FFTWD will also work. +// #error "This example only works when single precision FFTW is used +// Changing WorkPixeltype to double and changing this conditional to +// ITK_USE_FFTWD will also work. #endif int diff --git a/Examples/IO/XML/itkParticleSwarmOptimizerSAXReader.cxx b/Examples/IO/XML/itkParticleSwarmOptimizerSAXReader.cxx index f5264354659..3e007a841ca 100644 --- a/Examples/IO/XML/itkParticleSwarmOptimizerSAXReader.cxx +++ b/Examples/IO/XML/itkParticleSwarmOptimizerSAXReader.cxx @@ -282,7 +282,7 @@ ParticleSwarmOptimizerSAXReader::ProcessBoundAttributes( } } } // end if - } // end for + } // end for } /** Search for and return a particular attribute from the attribute list. */ diff --git a/Modules/Bridge/NumPy/include/itkPyBuffer.hxx b/Modules/Bridge/NumPy/include/itkPyBuffer.hxx index efd66a500ac..96c8e06ec8a 100644 --- a/Modules/Bridge/NumPy/include/itkPyBuffer.hxx +++ b/Modules/Bridge/NumPy/include/itkPyBuffer.hxx @@ -70,8 +70,9 @@ PyBuffer::_GetArrayViewFromImage(ImageType * image) template auto -PyBuffer::_GetImageViewFromArray(PyObject * arr, PyObject * shape, PyObject * numOfComponent) - -> const OutputImagePointer +PyBuffer::_GetImageViewFromArray(PyObject * arr, + PyObject * shape, + PyObject * numOfComponent) -> const OutputImagePointer { PyObject * shapeseq = NULL; PyObject * item = NULL; diff --git a/Modules/Bridge/VtkGlue/src/QuickView.cxx b/Modules/Bridge/VtkGlue/src/QuickView.cxx index 287684053e4..ee7527236f9 100644 --- a/Modules/Bridge/VtkGlue/src/QuickView.cxx +++ b/Modules/Bridge/VtkGlue/src/QuickView.cxx @@ -58,27 +58,27 @@ using FloatImageType = itk::Image; using DoubleImageType = itk::Image; template void ITKVtkGlue_EXPORT - QuickView::AddImage(CharImageType * image, bool FlipVertical, std::string Description); +QuickView::AddImage(CharImageType * image, bool FlipVertical, std::string Description); template void ITKVtkGlue_EXPORT - QuickView::AddImage(UnsignedShortImageType * image, bool FlipVertical, std::string Description); +QuickView::AddImage(UnsignedShortImageType * image, bool FlipVertical, std::string Description); template void ITKVtkGlue_EXPORT - QuickView::AddImage(ShortImageType * image, bool FlipVertical, std::string Description); +QuickView::AddImage(ShortImageType * image, bool FlipVertical, std::string Description); template void ITKVtkGlue_EXPORT - QuickView::AddImage(UnsignedIntImageType * image, bool FlipVertical, std::string Description); +QuickView::AddImage(UnsignedIntImageType * image, bool FlipVertical, std::string Description); template void ITKVtkGlue_EXPORT - QuickView::AddImage(IntImageType * image, bool FlipVertical, std::string Description); +QuickView::AddImage(IntImageType * image, bool FlipVertical, std::string Description); template void ITKVtkGlue_EXPORT - QuickView::AddImage(UnsignedLongImageType * image, bool FlipVertical, std::string Description); +QuickView::AddImage(UnsignedLongImageType * image, bool FlipVertical, std::string Description); template void ITKVtkGlue_EXPORT - QuickView::AddImage(LongImageType * image, bool FlipVertical, std::string Description); +QuickView::AddImage(LongImageType * image, bool FlipVertical, std::string Description); template void ITKVtkGlue_EXPORT - QuickView::AddImage(FloatImageType * image, bool FlipVertical, std::string Description); +QuickView::AddImage(FloatImageType * image, bool FlipVertical, std::string Description); template void ITKVtkGlue_EXPORT - QuickView::AddImage(DoubleImageType * image, bool FlipVertical, std::string Description); +QuickView::AddImage(DoubleImageType * image, bool FlipVertical, std::string Description); template <> void ITKVtkGlue_EXPORT - QuickView::AddImage(UnsignedCharImageType * image, bool FlipVertical, std::string Description) +QuickView::AddImage(UnsignedCharImageType * image, bool FlipVertical, std::string Description) { if (FlipVertical) { @@ -101,7 +101,7 @@ void ITKVtkGlue_EXPORT template void ITK_TEMPLATE_EXPORT - QuickView::AddImage(TImage * image, bool FlipVertical, std::string Description) +QuickView::AddImage(TImage * image, bool FlipVertical, std::string Description) { using rescaleFilterType = itk::RescaleIntensityImageFilter; @@ -116,7 +116,7 @@ void ITK_TEMPLATE_EXPORT template <> void ITKVtkGlue_EXPORT - QuickView::AddImage(UnsignedCharRGBImageType * image, +QuickView::AddImage(UnsignedCharRGBImageType * image, bool FlipVertical, std::string Description) { @@ -141,7 +141,7 @@ void ITKVtkGlue_EXPORT template <> void ITKVtkGlue_EXPORT - QuickView::AddRGBImage(UnsignedCharRGBImageType * image, +QuickView::AddRGBImage(UnsignedCharRGBImageType * image, bool FlipVertical, std::string Description) { @@ -166,7 +166,7 @@ void ITKVtkGlue_EXPORT template <> void ITKVtkGlue_EXPORT - QuickView::AddRGBImage(FloatRGBImageType * image, bool FlipVertical, std::string Description) +QuickView::AddRGBImage(FloatRGBImageType * image, bool FlipVertical, std::string Description) { using AdaptorType = itk::RGBToVectorImageAdaptor; AdaptorType::Pointer adaptor = AdaptorType::New(); @@ -182,7 +182,7 @@ void ITKVtkGlue_EXPORT template <> void ITKVtkGlue_EXPORT - QuickView::AddImage(FloatRGBImageType * image, bool FlipVertical, std::string Description) +QuickView::AddImage(FloatRGBImageType * image, bool FlipVertical, std::string Description) { using AdaptorType = itk::RGBToVectorImageAdaptor; AdaptorType::Pointer adaptor = AdaptorType::New(); diff --git a/Modules/Compatibility/Deprecated/include/itkChildTreeIterator.h b/Modules/Compatibility/Deprecated/include/itkChildTreeIterator.h index 68166ac1263..15ac93bc0f1 100644 --- a/Modules/Compatibility/Deprecated/include/itkChildTreeIterator.h +++ b/Modules/Compatibility/Deprecated/include/itkChildTreeIterator.h @@ -64,7 +64,7 @@ class ITK_TEMPLATE_EXPORT ChildTreeIterator : public TreeIteratorBase if (this != &iterator) { Superclass::operator=(iterator); - auto & it = static_cast &>(iterator); + auto & it = static_cast &>(iterator); m_ListPosition = it.m_ListPosition; m_ParentNode = it.m_ParentNode; } diff --git a/Modules/Compatibility/Deprecated/include/itkTreeIteratorBase.h b/Modules/Compatibility/Deprecated/include/itkTreeIteratorBase.h index 464ab68fd1e..54c9fc6faec 100644 --- a/Modules/Compatibility/Deprecated/include/itkTreeIteratorBase.h +++ b/Modules/Compatibility/Deprecated/include/itkTreeIteratorBase.h @@ -47,7 +47,7 @@ class TreeIteratorBaseEnums }; // Define how to print enumeration extern ITKCOMMON_DEPRECATED_EXPORT std::ostream & - operator<<(std::ostream & out, const TreeIteratorBaseEnums::TreeIteratorBaseNode value); +operator<<(std::ostream & out, const TreeIteratorBaseEnums::TreeIteratorBaseNode value); /** \class TreeIteratorBase * \brief This class provides the base implementation for tree iterators. * diff --git a/Modules/Compatibility/Deprecated/include/itkTreeIteratorClone.h b/Modules/Compatibility/Deprecated/include/itkTreeIteratorClone.h index 6c5b156cd87..b09cb2894c1 100644 --- a/Modules/Compatibility/Deprecated/include/itkTreeIteratorClone.h +++ b/Modules/Compatibility/Deprecated/include/itkTreeIteratorClone.h @@ -74,7 +74,11 @@ class TreeIteratorClone } /** Overload operator -> */ - ObjectType * operator->() const { return m_Pointer; } + ObjectType * + operator->() const + { + return m_Pointer; + } /** Test if the pointer has been initialized */ bool diff --git a/Modules/Core/Common/include/itkArray.h b/Modules/Core/Common/include/itkArray.h index 9a1d1f1da78..96920d9741e 100644 --- a/Modules/Core/Common/include/itkArray.h +++ b/Modules/Core/Common/include/itkArray.h @@ -229,9 +229,9 @@ operator<<(std::ostream & os, const Array & arr) // declaration of specialization template <> -ITKCommon_EXPORT std::ostream & operator<<(std::ostream & os, const Array & arr); +ITKCommon_EXPORT std::ostream & operator<< (std::ostream & os, const Array & arr); template <> -ITKCommon_EXPORT std::ostream & operator<<(std::ostream & os, const Array & arr); +ITKCommon_EXPORT std::ostream & operator<< (std::ostream & os, const Array & arr); template diff --git a/Modules/Core/Common/include/itkAutoPointer.h b/Modules/Core/Common/include/itkAutoPointer.h index aa3abf945ee..5eccb9151ce 100644 --- a/Modules/Core/Common/include/itkAutoPointer.h +++ b/Modules/Core/Common/include/itkAutoPointer.h @@ -73,7 +73,11 @@ class AutoPointer ~AutoPointer() { this->Reset(); } /** Overload operator ->. */ - ObjectType * operator->() const { return m_Pointer; } + ObjectType * + operator->() const + { + return m_Pointer; + } /** Clear the AutoPointer. If it had a pointer the object is deleted and the pointer is set to null. */ diff --git a/Modules/Core/Common/include/itkBoolean.h b/Modules/Core/Common/include/itkBoolean.h index 9fdb636a0ed..055efc9f19d 100644 --- a/Modules/Core/Common/include/itkBoolean.h +++ b/Modules/Core/Common/include/itkBoolean.h @@ -47,7 +47,11 @@ class Boolean {} /** Supports implicit conversion to `bool`. */ - constexpr operator bool() const { return m_Value; } + constexpr + operator bool() const + { + return m_Value; + } private: bool m_Value = false; diff --git a/Modules/Core/Common/include/itkCellInterface.h b/Modules/Core/Common/include/itkCellInterface.h index 37b642cff90..fd246784636 100644 --- a/Modules/Core/Common/include/itkCellInterface.h +++ b/Modules/Core/Common/include/itkCellInterface.h @@ -30,7 +30,10 @@ // to define the Accept and GetTopologyId virtuals used // by the MultiVisitor class #define itkCellVisitMacro(TopologyId) \ - static constexpr CellGeometryEnum GetTopologyId() { return TopologyId; } \ + static constexpr CellGeometryEnum GetTopologyId() \ + { \ + return TopologyId; \ + } \ virtual void Accept(CellIdentifier cellid, typename CellInterface::MultiVisitor * mv) \ override \ { \ @@ -381,7 +384,11 @@ class ITK_TEMPLATE_EXPORT CellInterface * Array is ordered (xmin, xmax, ymin, ymax, ....). A pointer to the * array is returned for convenience. This allows code like: * "CoordRep* bounds = cell->GetBoundingBox(new CoordRep[6]);". */ - CoordRepType * GetBoundingBox(CoordRepType[PointDimension * 2]) { return nullptr; } + CoordRepType * + GetBoundingBox(CoordRepType[PointDimension * 2]) + { + return nullptr; + } /** Compute the square of the diagonal length of the bounding box. */ CoordRepType @@ -402,11 +409,12 @@ class ITK_TEMPLATE_EXPORT CellInterface * (returned through "t" pointer). * * Returns whether an intersection exists. */ - virtual bool IntersectBoundingBoxWithLine(CoordRepType[PointDimension * 2], - CoordRepType[PointDimension], - CoordRepType[PointDimension], - CoordRepType[PointDimension], - CoordRepType *) + virtual bool + IntersectBoundingBoxWithLine(CoordRepType[PointDimension * 2], + CoordRepType[PointDimension], + CoordRepType[PointDimension], + CoordRepType[PointDimension], + CoordRepType *) { return bool(); } diff --git a/Modules/Core/Common/include/itkColorTable.hxx b/Modules/Core/Common/include/itkColorTable.hxx index 94b08ed36dc..8fda02bfcb8 100644 --- a/Modules/Core/Common/include/itkColorTable.hxx +++ b/Modules/Core/Common/include/itkColorTable.hxx @@ -302,20 +302,16 @@ ColorTable::GetColorComponent(unsigned int c, char rgb) { switch (rgb) { - case 'r': - { + case 'r': { return m_Color[c][0]; } - case 'g': - { + case 'g': { return m_Color[c][1]; } - case 'b': - { + case 'b': { return m_Color[c][2]; } - default: - { + default: { return 0; } } diff --git a/Modules/Core/Common/include/itkCompensatedSummation.h b/Modules/Core/Common/include/itkCompensatedSummation.h index 3cefc4ad1a3..75cbd5662be 100644 --- a/Modules/Core/Common/include/itkCompensatedSummation.h +++ b/Modules/Core/Common/include/itkCompensatedSummation.h @@ -117,7 +117,8 @@ class ITK_TEMPLATE_EXPORT CompensatedSummation GetSum() const; /** explicit conversion */ - explicit operator FloatType() const; + explicit + operator FloatType() const; private: AccumulateType m_Sum{}; @@ -130,9 +131,9 @@ class ITK_TEMPLATE_EXPORT CompensatedSummation }; void ITKCommon_EXPORT - CompensatedSummationAddElement(float & compensation, float & sum, const float element); +CompensatedSummationAddElement(float & compensation, float & sum, const float element); void ITKCommon_EXPORT - CompensatedSummationAddElement(double & compensation, double & sum, const double element); +CompensatedSummationAddElement(double & compensation, double & sum, const double element); } // end namespace itk diff --git a/Modules/Core/Common/include/itkCompensatedSummation.hxx b/Modules/Core/Common/include/itkCompensatedSummation.hxx index c3a644772e1..5b7fabfb03c 100644 --- a/Modules/Core/Common/include/itkCompensatedSummation.hxx +++ b/Modules/Core/Common/include/itkCompensatedSummation.hxx @@ -23,9 +23,9 @@ namespace itk { void ITKCommon_EXPORT - CompensatedSummationAddElement(float & compensation, float & sum, const float element); +CompensatedSummationAddElement(float & compensation, float & sum, const float element); void ITKCommon_EXPORT - CompensatedSummationAddElement(double & compensation, double & sum, const double element); +CompensatedSummationAddElement(double & compensation, double & sum, const double element); #ifndef itkCompensatedSummation_cxx // We try the looser pragma guards if we don't have an explicit instantiation. diff --git a/Modules/Core/Common/include/itkConceptChecking.h b/Modules/Core/Common/include/itkConceptChecking.h index 6dd565f4435..7155cde551e 100644 --- a/Modules/Core/Common/include/itkConceptChecking.h +++ b/Modules/Core/Common/include/itkConceptChecking.h @@ -77,7 +77,10 @@ * project by Brad King at Kitware. */ # define itkConceptConstraintsMacro() \ - virtual void Enforcer() { &Constraints::constraints; } + virtual void Enforcer() \ + { \ + &Constraints::constraints; \ + } # define itkConceptMacro(name, concept) \ enum \ { \ @@ -140,7 +143,8 @@ struct UniqueType_bool * warning. (BOOST) */ template -inline void IgnoreUnusedVariable(T) +inline void +IgnoreUnusedVariable(T) {} /** @@ -806,7 +810,9 @@ struct SameDimensionOrMinusOne using Type1 = Detail::UniqueType_unsigned_int; using Type2 = Detail::UniqueType_unsigned_int; - void f(Type1) {} + void + f(Type1) + {} void f(Type2, int = 0) {} @@ -831,7 +837,9 @@ struct SameDimensionOrMinusOneOrTwo using Type2 = Detail::UniqueType_unsigned_int; using Type3 = Detail::UniqueType_unsigned_int; - void f(Type1) {} + void + f(Type1) + {} void f(Type2, int = 0) {} diff --git a/Modules/Core/Common/include/itkConnectedImageNeighborhoodShape.h b/Modules/Core/Common/include/itkConnectedImageNeighborhoodShape.h index 19eb29a0a12..8a6020df44a 100644 --- a/Modules/Core/Common/include/itkConnectedImageNeighborhoodShape.h +++ b/Modules/Core/Common/include/itkConnectedImageNeighborhoodShape.h @@ -196,8 +196,9 @@ class ConnectedImageNeighborhoodShape static constexpr uintmax_t CalculateBinomialCoefficient(const uintmax_t n, const uintmax_t k) noexcept { - return (k > n) ? (assert(!"Out of range!"), 0) - : (k == 0) ? 1 : Math::UnsignedProduct(n, CalculateBinomialCoefficient(n - 1, k - 1)) / k; + return (k > n) ? (assert(!"Out of range!"), 0) + : (k == 0) ? 1 + : Math::UnsignedProduct(n, CalculateBinomialCoefficient(n - 1, k - 1)) / k; } diff --git a/Modules/Core/Common/include/itkConstNeighborhoodIterator.h b/Modules/Core/Common/include/itkConstNeighborhoodIterator.h index ca856039f54..8a7a0afa08c 100644 --- a/Modules/Core/Common/include/itkConstNeighborhoodIterator.h +++ b/Modules/Core/Common/include/itkConstNeighborhoodIterator.h @@ -173,7 +173,7 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator /** Returns the N-dimensional index of the iterator's position in * the image. */ ITK_ITERATOR_VIRTUAL IndexType - GetIndex() const ITK_ITERATOR_FINAL + GetIndex() const ITK_ITERATOR_FINAL { return m_Loop; } @@ -187,11 +187,11 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator /** Function that "dereferences" a ConstNeighborhoodIterator, * returning a Neighborhood of pixel values. */ ITK_ITERATOR_VIRTUAL NeighborhoodType - GetNeighborhood() const ITK_ITERATOR_FINAL; + GetNeighborhood() const ITK_ITERATOR_FINAL; /** Returns the pixel value located at a linear array location i. */ ITK_ITERATOR_VIRTUAL PixelType - GetPixel(const NeighborIndexType i) const ITK_ITERATOR_FINAL + GetPixel(const NeighborIndexType i) const ITK_ITERATOR_FINAL { if (!m_NeedToUseBoundaryCondition || this->InBounds()) { @@ -212,12 +212,12 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator * image. Sets "IsInBounds" to false if the location is outside the * image and the pixel value returned is a boundary condition. */ ITK_ITERATOR_VIRTUAL PixelType - GetPixel(NeighborIndexType i, bool & IsInBounds) const ITK_ITERATOR_FINAL; + GetPixel(NeighborIndexType i, bool & IsInBounds) const ITK_ITERATOR_FINAL; /** Returns the pixel value located at the itk::Offset o from the center of the neighborhood. */ ITK_ITERATOR_VIRTUAL PixelType - GetPixel(const OffsetType & o) const ITK_ITERATOR_FINAL + GetPixel(const OffsetType & o) const ITK_ITERATOR_FINAL { bool inbounds; @@ -230,7 +230,7 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator * image. Sets "IsInBounds" to false if the offset is outside the * image and the pixel value returned is a boundary condition. */ ITK_ITERATOR_VIRTUAL PixelType - GetPixel(const OffsetType & o, bool & IsInBounds) const ITK_ITERATOR_FINAL + GetPixel(const OffsetType & o, bool & IsInBounds) const ITK_ITERATOR_FINAL { return (this->GetPixel(this->GetNeighborhoodIndex(o), IsInBounds)); } @@ -239,7 +239,7 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator * center in the positive specified "axis" direction. No bounds checking * is done on the size of the neighborhood. */ ITK_ITERATOR_VIRTUAL PixelType - GetNext(const unsigned int axis, NeighborIndexType i) const ITK_ITERATOR_FINAL + GetNext(const unsigned int axis, NeighborIndexType i) const ITK_ITERATOR_FINAL { return (this->GetPixel(this->GetCenterNeighborhoodIndex() + (i * this->GetStride(axis)))); } @@ -248,7 +248,7 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator * center in the specified positive axis direction. No bounds checking is * done on the size of the neighborhood. */ ITK_ITERATOR_VIRTUAL PixelType - GetNext(const unsigned int axis) const ITK_ITERATOR_FINAL + GetNext(const unsigned int axis) const ITK_ITERATOR_FINAL { return (this->GetPixel(this->GetCenterNeighborhoodIndex() + this->GetStride(axis))); } @@ -257,7 +257,7 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator * center in the negative specified "axis" direction. No bounds checking * is done on the size of the neighborhood. */ ITK_ITERATOR_VIRTUAL PixelType - GetPrevious(const unsigned int axis, NeighborIndexType i) const ITK_ITERATOR_FINAL + GetPrevious(const unsigned int axis, NeighborIndexType i) const ITK_ITERATOR_FINAL { return (this->GetPixel(this->GetCenterNeighborhoodIndex() - (i * this->GetStride(axis)))); } @@ -266,7 +266,7 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator * center in the specified negative axis direction. No bounds checking is * done on the size of the neighborhood. */ ITK_ITERATOR_VIRTUAL PixelType - GetPrevious(const unsigned int axis) const ITK_ITERATOR_FINAL + GetPrevious(const unsigned int axis) const ITK_ITERATOR_FINAL { return (this->GetPixel(this->GetCenterNeighborhoodIndex() - this->GetStride(axis))); } @@ -274,7 +274,7 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator /** Returns the image index for neighbor pixel at offset o from the center of the neighborhood. */ ITK_ITERATOR_VIRTUAL IndexType - GetIndex(const OffsetType & o) const ITK_ITERATOR_FINAL + GetIndex(const OffsetType & o) const ITK_ITERATOR_FINAL { return (this->GetIndex() + o); } @@ -282,7 +282,7 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIterator /** Returns the image index for neighbor pixel at index i in the neighborhood. */ ITK_ITERATOR_VIRTUAL IndexType - GetIndex(NeighborIndexType i) const ITK_ITERATOR_FINAL + GetIndex(NeighborIndexType i) const ITK_ITERATOR_FINAL { return (this->GetIndex() + this->GetOffset(i)); } diff --git a/Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx b/Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx index 5dc14d96364..ea2b337eaa4 100644 --- a/Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx +++ b/Modules/Core/Common/include/itkConstNeighborhoodIterator.hxx @@ -144,8 +144,8 @@ ConstNeighborhoodIterator::IndexInBounds(const Neigh template auto -ConstNeighborhoodIterator::GetPixel(NeighborIndexType n, bool & IsInBounds) const - -> PixelType +ConstNeighborhoodIterator::GetPixel(NeighborIndexType n, + bool & IsInBounds) const -> PixelType { // If the region the iterator is walking (padded by the neighborhood size) // never bumps up against the bounds of the buffered region, then don't diff --git a/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.h b/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.h index 2a88242f8a4..1eb9c105838 100644 --- a/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.h +++ b/Modules/Core/Common/include/itkConstNeighborhoodIteratorWithOnlyIndex.h @@ -139,7 +139,7 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIteratorWithOnlyIndex : public Neighb /** Returns the N-dimensional index of the iterator's position in * the image. */ ITK_ITERATOR_VIRTUAL IndexType - GetIndex() const ITK_ITERATOR_FINAL + GetIndex() const ITK_ITERATOR_FINAL { return m_Loop; } @@ -147,7 +147,7 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIteratorWithOnlyIndex : public Neighb /** Returns the image index for neighbor pixel at offset o from the center of the neighborhood. */ ITK_ITERATOR_VIRTUAL IndexType - GetIndex(const OffsetType & o) const ITK_ITERATOR_FINAL + GetIndex(const OffsetType & o) const ITK_ITERATOR_FINAL { return (this->GetIndex() + o); } @@ -155,7 +155,7 @@ class ITK_TEMPLATE_EXPORT ConstNeighborhoodIteratorWithOnlyIndex : public Neighb /** Returns the image index for neighbor pixel at index i in the neighborhood. */ ITK_ITERATOR_VIRTUAL IndexType - GetIndex(NeighborIndexType i) const ITK_ITERATOR_FINAL + GetIndex(NeighborIndexType i) const ITK_ITERATOR_FINAL { return (this->GetIndex() + this->GetOffset(i)); } diff --git a/Modules/Core/Common/include/itkConstSliceIterator.h b/Modules/Core/Common/include/itkConstSliceIterator.h index 28141401385..46deae7daed 100644 --- a/Modules/Core/Common/include/itkConstSliceIterator.h +++ b/Modules/Core/Common/include/itkConstSliceIterator.h @@ -99,11 +99,19 @@ class ConstSliceIterator /** Returns the element at position n of the slice. Sets the * iterator to point to position n. */ - const TPixel & operator[](SizeValueType n) { return this->Loc(m_Pos = n); } + const TPixel & + operator[](SizeValueType n) + { + return this->Loc(m_Pos = n); + } /** Dereferences the iterator, returning the value that it points * to. */ - const TPixel & operator*() { return Loc(m_Pos); } + const TPixel & + operator*() + { + return Loc(m_Pos); + } /** Returns the logical && of the boolean == of two slice iterator positions, * stride, and start locations. */ diff --git a/Modules/Core/Common/include/itkConstantBoundaryCondition.hxx b/Modules/Core/Common/include/itkConstantBoundaryCondition.hxx index 1a7ab87a75a..f6fc1009663 100644 --- a/Modules/Core/Common/include/itkConstantBoundaryCondition.hxx +++ b/Modules/Core/Common/include/itkConstantBoundaryCondition.hxx @@ -76,8 +76,8 @@ ConstantBoundaryCondition::GetInputRequestedRegion( template auto -ConstantBoundaryCondition::GetPixel(const IndexType & index, const TInputImage * image) const - -> OutputPixelType +ConstantBoundaryCondition::GetPixel(const IndexType & index, + const TInputImage * image) const -> OutputPixelType { RegionType imageRegion = image->GetLargestPossibleRegion(); if (imageRegion.IsInside(index)) diff --git a/Modules/Core/Common/include/itkCovariantVector.h b/Modules/Core/Common/include/itkCovariantVector.h index 05885d24ec3..737820d2147 100644 --- a/Modules/Core/Common/include/itkCovariantVector.h +++ b/Modules/Core/Common/include/itkCovariantVector.h @@ -190,15 +190,18 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray & other) const; + ValueType + operator*(const Vector & other) const; /** Scalar operator*. Scale the elements of a vector by a scalar. * Return a new vector. */ - inline Self operator*(const ValueType & val) const + inline Self + operator*(const ValueType & val) const { Self result; @@ -259,7 +262,8 @@ class ITK_TEMPLATE_EXPORT CovariantVector : public FixedArray = T * CovariantVector< T,N > */ template -inline CovariantVector operator*(const T & scalar, const CovariantVector & v) +inline CovariantVector +operator*(const T & scalar, const CovariantVector & v) { return v.operator*(scalar); } @@ -267,8 +271,8 @@ inline CovariantVector operator*(const T & scalar, const Co /** Performs the scalar product of a covariant with a contravariant. * This scalar product is invariant under affine transformations */ template -inline T operator*(const Vector & contravariant, - const CovariantVector & covariant) +inline T +operator*(const Vector & contravariant, const CovariantVector & covariant) { return covariant.operator*(contravariant); } diff --git a/Modules/Core/Common/include/itkCovariantVector.hxx b/Modules/Core/Common/include/itkCovariantVector.hxx index 41ee35cd288..d33e258c310 100644 --- a/Modules/Core/Common/include/itkCovariantVector.hxx +++ b/Modules/Core/Common/include/itkCovariantVector.hxx @@ -98,8 +98,8 @@ CovariantVector::operator-(const Self & vec) const -> Self } template -typename CovariantVector::ValueType CovariantVector::operator*( - const Self & other) const +typename CovariantVector::ValueType +CovariantVector::operator*(const Self & other) const { typename NumericTraits::AccumulateType value = T{}; for (unsigned int i = 0; i < VVectorDimension; ++i) @@ -110,8 +110,8 @@ typename CovariantVector::ValueType CovariantVector -typename CovariantVector::ValueType CovariantVector::operator*( - const Vector & other) const +typename CovariantVector::ValueType +CovariantVector::operator*(const Vector & other) const { typename NumericTraits::AccumulateType value = T{}; for (unsigned int i = 0; i < VVectorDimension; ++i) diff --git a/Modules/Core/Common/include/itkEventObject.h b/Modules/Core/Common/include/itkEventObject.h index 0dddea3f561..131d8962cd1 100644 --- a/Modules/Core/Common/include/itkEventObject.h +++ b/Modules/Core/Common/include/itkEventObject.h @@ -141,16 +141,22 @@ operator<<(std::ostream & os, const EventObject & e) }; \ static_assert(true, "Compile time eliminated. Used to require a semi-colon at end of macro.") -#define itkEventMacroDefinition(classname, super) \ - classname::classname(const classname & s) \ - : super(s){}; \ - classname::~classname() {} \ - const char * classname::GetEventName() const { return #classname; } \ - bool classname::CheckEvent(const itk::EventObject * e) const \ - { \ - return (dynamic_cast(e) != nullptr); \ - } \ - itk::EventObject * classname::MakeObject() const { return new classname; } \ +#define itkEventMacroDefinition(classname, super) \ + classname::classname(const classname & s) \ + : super(s) {}; \ + classname::~classname() {} \ + const char * classname::GetEventName() const \ + { \ + return #classname; \ + } \ + bool classname::CheckEvent(const itk::EventObject * e) const \ + { \ + return (dynamic_cast(e) != nullptr); \ + } \ + itk::EventObject * classname::MakeObject() const \ + { \ + return new classname; \ + } \ static_assert(true, "Compile time eliminated. Used to require a semi-colon at end of macro.") #if !defined(ITK_LEGACY_REMOVE) @@ -189,7 +195,7 @@ operator<<(std::ostream & os, const EventObject & e) return new Self; \ } \ classname(const Self & s) \ - : super(s){}; \ + : super(s) {}; \ \ private: \ void \ diff --git a/Modules/Core/Common/include/itkExtractImageFilter.hxx b/Modules/Core/Common/include/itkExtractImageFilter.hxx index 2b03120c2e2..10b77da7a3b 100644 --- a/Modules/Core/Common/include/itkExtractImageFilter.hxx +++ b/Modules/Core/Common/include/itkExtractImageFilter.hxx @@ -191,21 +191,18 @@ ExtractImageFilter::GenerateOutputInformation() { switch (m_DirectionCollapseStrategy) { - case DirectionCollapseStrategyEnum::DIRECTIONCOLLAPSETOIDENTITY: - { + case DirectionCollapseStrategyEnum::DIRECTIONCOLLAPSETOIDENTITY: { outputDirection.SetIdentity(); } break; - case DirectionCollapseStrategyEnum::DIRECTIONCOLLAPSETOSUBMATRIX: - { + case DirectionCollapseStrategyEnum::DIRECTIONCOLLAPSETOSUBMATRIX: { if (vnl_determinant(outputDirection.GetVnlMatrix()) == 0.0) { itkExceptionMacro("Invalid submatrix extracted for collapsed direction."); } } break; - case DirectionCollapseStrategyEnum::DIRECTIONCOLLAPSETOGUESS: - { + case DirectionCollapseStrategyEnum::DIRECTIONCOLLAPSETOGUESS: { if (vnl_determinant(outputDirection.GetVnlMatrix()) == 0.0) { outputDirection.SetIdentity(); @@ -213,8 +210,7 @@ ExtractImageFilter::GenerateOutputInformation() } break; case DirectionCollapseStrategyEnum::DIRECTIONCOLLAPSETOUNKOWN: - default: - { + default: { itkExceptionMacro( << "It is required that the strategy for collapsing the direction matrix be explicitly specified. " << "Set with either myfilter->SetDirectionCollapseToIdentity() or " diff --git a/Modules/Core/Common/include/itkFixedArray.h b/Modules/Core/Common/include/itkFixedArray.h index 92d4feef13d..7b7c6d77111 100644 --- a/Modules/Core/Common/include/itkFixedArray.h +++ b/Modules/Core/Common/include/itkFixedArray.h @@ -103,8 +103,16 @@ class ITK_TEMPLATE_EXPORT FixedArray { return ReverseIterator(m_Iterator++); } - Iterator operator->() const { return (m_Iterator - 1); } - ValueType & operator*() const { return *(m_Iterator - 1); } + Iterator + operator->() const + { + return (m_Iterator - 1); + } + ValueType & + operator*() const + { + return *(m_Iterator - 1); + } bool operator==(const ReverseIterator & rit) const @@ -150,8 +158,16 @@ class ITK_TEMPLATE_EXPORT FixedArray { return ConstReverseIterator(m_Iterator++); } - ConstIterator operator->() const { return (m_Iterator - 1); } - const ValueType & operator*() const { return *(m_Iterator - 1); } + ConstIterator + operator->() const + { + return (m_Iterator - 1); + } + const ValueType & + operator*() const + { + return *(m_Iterator - 1); + } bool operator==(const ConstReverseIterator & rit) const @@ -267,8 +283,16 @@ class ITK_TEMPLATE_EXPORT FixedArray # pragma GCC diagnostic ignored "-Warray-bounds" # endif #endif - constexpr reference operator[](unsigned int index) { return m_InternalArray[index]; } - constexpr const_reference operator[](unsigned int index) const { return m_InternalArray[index]; } + constexpr reference + operator[](unsigned int index) + { + return m_InternalArray[index]; + } + constexpr const_reference + operator[](unsigned int index) const + { + return m_InternalArray[index]; + } #if defined(__GNUC__) # if (__GNUC__ >= 7) # pragma GCC diagnostic pop diff --git a/Modules/Core/Common/include/itkFloodFilledFunctionConditionalConstIterator.hxx b/Modules/Core/Common/include/itkFloodFilledFunctionConditionalConstIterator.hxx index 73c8fa88be3..dabf262c0c5 100644 --- a/Modules/Core/Common/include/itkFloodFilledFunctionConditionalConstIterator.hxx +++ b/Modules/Core/Common/include/itkFloodFilledFunctionConditionalConstIterator.hxx @@ -205,7 +205,7 @@ FloodFilledFunctionConditionalConstIterator::DoFloodStep() } } } // end left/right neighbor loop - } // end check all neighbors + } // end check all neighbors // Now that all the potential neighbors have been // inserted we can get rid of the pixel in the front diff --git a/Modules/Core/Common/include/itkFloodFilledSpatialFunctionConditionalConstIterator.hxx b/Modules/Core/Common/include/itkFloodFilledSpatialFunctionConditionalConstIterator.hxx index a6e0abbfdb2..2f9a91e0499 100644 --- a/Modules/Core/Common/include/itkFloodFilledSpatialFunctionConditionalConstIterator.hxx +++ b/Modules/Core/Common/include/itkFloodFilledSpatialFunctionConditionalConstIterator.hxx @@ -51,8 +51,7 @@ FloodFilledSpatialFunctionConditionalConstIterator::IsPixelIn switch (m_InclusionStrategy) { // Origin - case 0: - { + case 0: { // Get the physical location of this index this->m_Image->TransformIndexToPhysicalPoint(index, position); @@ -62,8 +61,7 @@ FloodFilledSpatialFunctionConditionalConstIterator::IsPixelIn break; // Center - case 1: - { + case 1: { // The center of the pixel is the index provided in the function // call converted to a continuous index with an offset of 0.5 // along each dimension @@ -83,8 +81,7 @@ FloodFilledSpatialFunctionConditionalConstIterator::IsPixelIn break; // Complete - case 2: - { + case 2: { // This is unfortunately a little complicated... // We want to examine whether or not all of the corners of this pixel // are within the spatial function. For a pixel at (0,0) with a spacing @@ -147,8 +144,7 @@ FloodFilledSpatialFunctionConditionalConstIterator::IsPixelIn break; // Intersect - case 3: - { + case 3: { // The notes for the previous case apply here as well // The only difference is that we return true if any of the // generated indices are true diff --git a/Modules/Core/Common/include/itkGaussianKernelFunction.h b/Modules/Core/Common/include/itkGaussianKernelFunction.h index 8aa3f5d1c23..069de72c5a2 100644 --- a/Modules/Core/Common/include/itkGaussianKernelFunction.h +++ b/Modules/Core/Common/include/itkGaussianKernelFunction.h @@ -64,7 +64,7 @@ class ITK_TEMPLATE_EXPORT GaussianKernelFunction : public KernelFunctionBase::GetBoundaryFeature(int dimensi { switch (dimension) { - case 0: - { + case 0: { VertexAutoPointer vertexPointer; if (this->GetVertex(featureId, vertexPointer)) { @@ -113,8 +112,7 @@ HexahedronCell::GetBoundaryFeature(int dimensi } break; } - case 1: - { + case 1: { EdgeAutoPointer edgePointer; if (this->GetEdge(featureId, edgePointer)) { @@ -123,8 +121,7 @@ HexahedronCell::GetBoundaryFeature(int dimensi } break; } - case 2: - { + case 2: { FaceAutoPointer facePointer; if (this->GetFace(featureId, facePointer)) { diff --git a/Modules/Core/Common/include/itkImage.h b/Modules/Core/Common/include/itkImage.h index 6613887be9a..5b82c82ad2c 100644 --- a/Modules/Core/Common/include/itkImage.h +++ b/Modules/Core/Common/include/itkImage.h @@ -237,13 +237,21 @@ class ITK_TEMPLATE_EXPORT Image : public ImageBase * * For efficiency, this function does not check that the * image has actually been allocated yet. */ - TPixel & operator[](const IndexType & index) { return this->GetPixel(index); } + TPixel & + operator[](const IndexType & index) + { + return this->GetPixel(index); + } /** \brief Access a pixel. This version can only be an rvalue. * * For efficiency, this function does not check that the * image has actually been allocated yet. */ - const TPixel & operator[](const IndexType & index) const { return this->GetPixel(index); } + const TPixel & + operator[](const IndexType & index) const + { + return this->GetPixel(index); + } /** Return a pointer to the beginning of the buffer. This is used by * the image iterator class. */ diff --git a/Modules/Core/Common/include/itkImageBufferRange.h b/Modules/Core/Common/include/itkImageBufferRange.h index 28134ad4482..5c15ac9f3c6 100644 --- a/Modules/Core/Common/include/itkImageBufferRange.h +++ b/Modules/Core/Common/include/itkImageBufferRange.h @@ -317,7 +317,8 @@ class ImageBufferRange final /** Returns a reference to the current pixel. */ - reference operator*() const noexcept + reference + operator*() const noexcept { assert(m_InternalPixelPointer != nullptr); @@ -472,7 +473,11 @@ class ImageBufferRange final /** Returns it[n] for iterator 'it' and integer value 'n'. */ - reference operator[](const difference_type n) const noexcept { return *(*this + n); } + reference + operator[](const difference_type n) const noexcept + { + return *(*this + n); + } }; static constexpr bool IsImageTypeConst = std::is_const_v; @@ -648,7 +653,8 @@ class ImageBufferRange final * \note The return type QualifiedIterator::reference is equivalent to * iterator::reference. */ - typename QualifiedIterator::reference operator[](const size_t n) const noexcept + typename QualifiedIterator::reference + operator[](const size_t n) const noexcept { assert(n < this->size()); assert(n <= static_cast(std::numeric_limits::max())); @@ -660,7 +666,7 @@ class ImageBufferRange final // Deduction guide to avoid compiler warnings (-wctad-maybe-unsupported) when using class template argument deduction. template -ImageBufferRange(TImage &)->ImageBufferRange; +ImageBufferRange(TImage &) -> ImageBufferRange; /** Creates a range to iterate over the pixels of the specified image. diff --git a/Modules/Core/Common/include/itkImageContainerInterface.h b/Modules/Core/Common/include/itkImageContainerInterface.h index 18a439549b6..18751da24b5 100644 --- a/Modules/Core/Common/include/itkImageContainerInterface.h +++ b/Modules/Core/Common/include/itkImageContainerInterface.h @@ -67,10 +67,12 @@ class ImageContainerInterface : public Object using Element = TElement; /** Index operator. This version can be an lvalue. */ - virtual TElement & operator[](const ElementIdentifier) = 0; + virtual TElement & + operator[](const ElementIdentifier) = 0; /** Index operator. This version can only be an rvalue */ - virtual const TElement & operator[](const ElementIdentifier) const = 0; + virtual const TElement & + operator[](const ElementIdentifier) const = 0; /** Return a pointer to the beginning of the buffer. This is used by * the image iterator class. */ diff --git a/Modules/Core/Common/include/itkImageRandomNonRepeatingConstIteratorWithIndex.h b/Modules/Core/Common/include/itkImageRandomNonRepeatingConstIteratorWithIndex.h index b0defff6c42..32c6174ee3f 100644 --- a/Modules/Core/Common/include/itkImageRandomNonRepeatingConstIteratorWithIndex.h +++ b/Modules/Core/Common/include/itkImageRandomNonRepeatingConstIteratorWithIndex.h @@ -121,7 +121,11 @@ class RandomPermutation std::sort(m_Permutation, m_Permutation + m_Size); } - SizeValueType operator[](SizeValueType i) const { return m_Permutation[i].m_Index; } + SizeValueType + operator[](SizeValueType i) const + { + return m_Permutation[i].m_Index; + } ~RandomPermutation() { delete[] m_Permutation; } diff --git a/Modules/Core/Common/include/itkImageRegion.h b/Modules/Core/Common/include/itkImageRegion.h index 7fbb997a430..8dfb1d691c7 100644 --- a/Modules/Core/Common/include/itkImageRegion.h +++ b/Modules/Core/Common/include/itkImageRegion.h @@ -413,7 +413,7 @@ class ITK_TEMPLATE_EXPORT ImageRegion final // Deduction guide to avoid compiler warnings (-wctad-maybe-unsupported) when using class template argument deduction. template -ImageRegion(const Index &, const Size &)->ImageRegion; +ImageRegion(const Index &, const Size &) -> ImageRegion; template diff --git a/Modules/Core/Common/include/itkImageRegionRange.h b/Modules/Core/Common/include/itkImageRegionRange.h index e203267d3c7..6a0a7a85fcf 100644 --- a/Modules/Core/Common/include/itkImageRegionRange.h +++ b/Modules/Core/Common/include/itkImageRegionRange.h @@ -225,7 +225,11 @@ class ImageRegionRange final /** Returns a reference to the current pixel. */ - reference operator*() const noexcept { return *m_BufferIterator; } + reference + operator*() const noexcept + { + return *m_BufferIterator; + } /** Prefix increment ('++it'). */ QualifiedIterator & @@ -458,7 +462,7 @@ class ImageRegionRange final // Deduction guide to avoid compiler warnings (-wctad-maybe-unsupported) when using class template argument deduction. template -ImageRegionRange(TImage &)->ImageRegionRange; +ImageRegionRange(TImage &) -> ImageRegionRange; } // namespace itk diff --git a/Modules/Core/Common/include/itkImageScanlineConstIterator.h b/Modules/Core/Common/include/itkImageScanlineConstIterator.h index 393e5ecac17..56b8b16d940 100644 --- a/Modules/Core/Common/include/itkImageScanlineConstIterator.h +++ b/Modules/Core/Common/include/itkImageScanlineConstIterator.h @@ -265,7 +265,7 @@ class ITK_TEMPLATE_EXPORT ImageScanlineConstIterator : public ImageConstIterator // Deduction guide for class template argument deduction (CTAD). template ImageScanlineConstIterator(SmartPointer, const typename TImage::RegionType &) - ->ImageScanlineConstIterator>; + -> ImageScanlineConstIterator>; } // end namespace itk diff --git a/Modules/Core/Common/include/itkImageScanlineIterator.h b/Modules/Core/Common/include/itkImageScanlineIterator.h index c2ea15dfc9a..44b1864bf56 100644 --- a/Modules/Core/Common/include/itkImageScanlineIterator.h +++ b/Modules/Core/Common/include/itkImageScanlineIterator.h @@ -99,7 +99,7 @@ class ITK_TEMPLATE_EXPORT ImageScanlineIterator : public ImageScanlineConstItera // Deduction guide for class template argument deduction (CTAD). template -ImageScanlineIterator(SmartPointer, const typename TImage::RegionType &)->ImageScanlineIterator; +ImageScanlineIterator(SmartPointer, const typename TImage::RegionType &) -> ImageScanlineIterator; } // end namespace itk diff --git a/Modules/Core/Common/include/itkImageSource.hxx b/Modules/Core/Common/include/itkImageSource.hxx index 3103e4256eb..66fac86cace 100644 --- a/Modules/Core/Common/include/itkImageSource.hxx +++ b/Modules/Core/Common/include/itkImageSource.hxx @@ -58,7 +58,8 @@ ImageSource::ImageSource() } template -ProcessObject::DataObjectPointer ImageSource::MakeOutput(ProcessObject::DataObjectPointerArraySizeType) +ProcessObject::DataObjectPointer +ImageSource::MakeOutput(ProcessObject::DataObjectPointerArraySizeType) { return TOutputImage::New().GetPointer(); } diff --git a/Modules/Core/Common/include/itkImportImageContainer.h b/Modules/Core/Common/include/itkImportImageContainer.h index 189dfcb6a5a..90f25ab04b8 100644 --- a/Modules/Core/Common/include/itkImportImageContainer.h +++ b/Modules/Core/Common/include/itkImportImageContainer.h @@ -80,10 +80,18 @@ class ITK_TEMPLATE_EXPORT ImportImageContainer : public Object SetImportPointer(TElement * ptr, TElementIdentifier num, bool LetContainerManageMemory = false); /** Index operator. This version can be an lvalue. */ - TElement & operator[](const ElementIdentifier id) { return m_ImportPointer[id]; } + TElement & + operator[](const ElementIdentifier id) + { + return m_ImportPointer[id]; + } /** Index operator. This version can only be an rvalue */ - const TElement & operator[](const ElementIdentifier id) const { return m_ImportPointer[id]; } + const TElement & + operator[](const ElementIdentifier id) const + { + return m_ImportPointer[id]; + } /** Return a pointer to the beginning of the buffer. This is used by * the image iterator class. */ diff --git a/Modules/Core/Common/include/itkIndex.h b/Modules/Core/Common/include/itkIndex.h index 754bc27dbdb..65818f0c41a 100644 --- a/Modules/Core/Common/include/itkIndex.h +++ b/Modules/Core/Common/include/itkIndex.h @@ -210,7 +210,8 @@ struct ITK_TEMPLATE_EXPORT Index final /** * Multiply an index by a size (elementwise product). */ - const Self operator*(const SizeType & vec) const + const Self + operator*(const SizeType & vec) const { Self result; @@ -427,9 +428,17 @@ struct ITK_TEMPLATE_EXPORT Index final return false; } - constexpr reference operator[](size_type pos) { return m_InternalArray[pos]; } + constexpr reference + operator[](size_type pos) + { + return m_InternalArray[pos]; + } - constexpr const_reference operator[](size_type pos) const { return m_InternalArray[pos]; } + constexpr const_reference + operator[](size_type pos) const + { + return m_InternalArray[pos]; + } reference at(size_type pos) diff --git a/Modules/Core/Common/include/itkIndexRange.h b/Modules/Core/Common/include/itkIndexRange.h index 5306ef7785b..a454958f479 100644 --- a/Modules/Core/Common/include/itkIndexRange.h +++ b/Modules/Core/Common/include/itkIndexRange.h @@ -101,11 +101,19 @@ class IndexRange final /** Returns a reference to the current index. */ - reference operator*() const noexcept { return m_Index; } + reference + operator*() const noexcept + { + return m_Index; + } /** Returns a pointer to the current index. */ - pointer operator->() const noexcept { return &(**this); } + pointer + operator->() const noexcept + { + return &(**this); + } /** Prefix increment ('++it'). */ @@ -250,10 +258,18 @@ class IndexRange final struct ZeroIndex { // The "index" operator. - constexpr IndexValueType operator[](unsigned int) const { return 0; } + constexpr IndexValueType + operator[](unsigned int) const + { + return 0; + } // Implicitly converts to a default-initialized itk::Index. - constexpr operator IndexType() const { return IndexType(); } + constexpr + operator IndexType() const + { + return IndexType(); + } }; diff --git a/Modules/Core/Common/include/itkMacro.h b/Modules/Core/Common/include/itkMacro.h index cc3e2622890..7a318f51e94 100644 --- a/Modules/Core/Common/include/itkMacro.h +++ b/Modules/Core/Common/include/itkMacro.h @@ -324,8 +324,11 @@ namespace itk } \ ITK_MACROEND_NOOP_STATEMENT -#define itkCreateAnotherMacro(x) \ - ::itk::LightObject::Pointer CreateAnother() const override { return x::New().GetPointer(); } \ +#define itkCreateAnotherMacro(x) \ + ::itk::LightObject::Pointer CreateAnother() const override \ + { \ + return x::New().GetPointer(); \ + } \ ITK_MACROEND_NOOP_STATEMENT #define itkCloneMacro(x) \ @@ -346,7 +349,7 @@ namespace itk ITK_MACROEND_NOOP_STATEMENT #define itkSimpleFactoryOnlyNewMacro(x) \ - static auto New()->Pointer \ + static auto New() -> Pointer \ { \ Pointer smartPtr = ::itk::ObjectFactory::Create(); \ if (smartPtr == nullptr) \ @@ -423,8 +426,11 @@ namespace itk #else // For C++14 and C++17, this macro defines an operator!= member function that // just calls the corresponding operator== member function. -# define ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(TypeName) \ - bool operator!=(const TypeName & other) const { return !(this->operator==(other)); } \ +# define ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(TypeName) \ + bool operator!=(const TypeName & other) const \ + { \ + return !(this->operator==(other)); \ + } \ ITK_MACROEND_NOOP_STATEMENT #endif @@ -1012,23 +1018,32 @@ compilers. ITK_MACROEND_NOOP_STATEMENT // clang-format on /** Get built-in type. Creates member Get"name"() (e.g., GetVisibility()); */ -#define itkGetMacro(name, type) \ - virtual type Get##name() { return this->m_##name; } \ +#define itkGetMacro(name, type) \ + virtual type Get##name() \ + { \ + return this->m_##name; \ + } \ ITK_MACROEND_NOOP_STATEMENT /** Get built-in type. Creates member Get"name"() (e.g., GetVisibility()); * This is the "const" form of the itkGetMacro. It should be used unless * the member can be changed through the "Get" access routine. */ -#define itkGetConstMacro(name, type) \ - virtual type Get##name() const { return this->m_##name; } \ +#define itkGetConstMacro(name, type) \ + virtual type Get##name() const \ + { \ + return this->m_##name; \ + } \ ITK_MACROEND_NOOP_STATEMENT /** Get built-in type. Creates member Get"name"() (e.g., GetVisibility()); * This is the "const" form of the itkGetMacro. It should be used unless * the member can be changed through the "Get" access routine. * This versions returns a const reference to the variable. */ -#define itkGetConstReferenceMacro(name, type) \ - virtual const type & Get##name() const { return this->m_##name; } \ +#define itkGetConstReferenceMacro(name, type) \ + virtual const type & Get##name() const \ + { \ + return this->m_##name; \ + } \ ITK_MACROEND_NOOP_STATEMENT /** Set built-in type. Creates member Set"name"() (e.g., SetVisibility()); @@ -1051,39 +1066,48 @@ compilers. * This should be use when the type is an enum. It is use to avoid warnings on * some compilers with non specified enum types passed to * itkDebugMacro. */ -#define itkGetEnumMacro(name, type) \ - virtual type Get##name() const { return this->m_##name; } \ +#define itkGetEnumMacro(name, type) \ + virtual type Get##name() const \ + { \ + return this->m_##name; \ + } \ ITK_MACROEND_NOOP_STATEMENT /** Set character string. Creates member Set"name"() * (e.g., SetFilename(char *)). The macro assumes that * the class member (name) is declared a type std::string. */ -#define itkSetStringMacro(name) \ - virtual void Set##name(const char * _arg) \ - { \ - if (_arg && (_arg == this->m_##name)) \ - { \ - return; \ - } \ - if (_arg) \ - { \ - this->m_##name = _arg; \ - } \ - else \ - { \ - this->m_##name = ""; \ - } \ - this->Modified(); \ - } \ - virtual void Set##name(const std::string & _arg) { this->Set##name(_arg.c_str()); } \ +#define itkSetStringMacro(name) \ + virtual void Set##name(const char * _arg) \ + { \ + if (_arg && (_arg == this->m_##name)) \ + { \ + return; \ + } \ + if (_arg) \ + { \ + this->m_##name = _arg; \ + } \ + else \ + { \ + this->m_##name = ""; \ + } \ + this->Modified(); \ + } \ + virtual void Set##name(const std::string & _arg) \ + { \ + this->Set##name(_arg.c_str()); \ + } \ ITK_MACROEND_NOOP_STATEMENT /** Get character string. Creates member Get"name"() * (e.g., SetFilename(char *)). The macro assumes that * the class member (name) is declared as a type std::string. */ -#define itkGetStringMacro(name) \ - virtual const char * Get##name() const { return this->m_##name.c_str(); } \ +#define itkGetStringMacro(name) \ + virtual const char * Get##name() const \ + { \ + return this->m_##name.c_str(); \ + } \ ITK_MACROEND_NOOP_STATEMENT // clang-format off @@ -1149,8 +1173,11 @@ compilers. /** Get a raw const pointer to an object. Creates the member * Get"name"() (e.g., GetPoints()). */ -#define itkGetConstObjectMacro(name, type) \ - virtual const type * Get##name() const { return this->m_##name.GetPointer(); } \ +#define itkGetConstObjectMacro(name, type) \ + virtual const type * Get##name() const \ + { \ + return this->m_##name.GetPointer(); \ + } \ ITK_MACROEND_NOOP_STATEMENT @@ -1166,19 +1193,28 @@ compilers. purposeful_error("itkGetObjectMacro should be replaced with itkGetModifiableObjectMacro."); \ } -# define itkGetModifiableObjectMacro(name, type) \ - virtual type * GetModifiable##name() { return this->m_##name.GetPointer(); } \ +# define itkGetModifiableObjectMacro(name, type) \ + virtual type * GetModifiable##name() \ + { \ + return this->m_##name.GetPointer(); \ + } \ itkGetConstObjectMacro(name, type) #else // defined ( ITK_FUTURE_LEGACY_REMOVE ) /** Get a raw pointer to an object. Creates the member * Get"name"() (e.g., GetPoints()). */ -# define itkGetObjectMacro(name, type) \ - virtual type * Get##name() { return this->m_##name.GetPointer(); } \ +# define itkGetObjectMacro(name, type) \ + virtual type * Get##name() \ + { \ + return this->m_##name.GetPointer(); \ + } \ ITK_MACROEND_NOOP_STATEMENT -# define itkGetModifiableObjectMacro(name, type) \ - virtual type * GetModifiable##name() { return this->m_##name.GetPointer(); } \ - itkGetConstObjectMacro(name, type); \ +# define itkGetModifiableObjectMacro(name, type) \ + virtual type * GetModifiable##name() \ + { \ + return this->m_##name.GetPointer(); \ + } \ + itkGetConstObjectMacro(name, type); \ itkGetObjectMacro(name, type) #endif // defined ( ITK_FUTURE_LEGACY_REMOVE ) @@ -1188,8 +1224,11 @@ compilers. /** Get a const reference to a smart pointer to an object. * Creates the member Get"name"() (e.g., GetPoints()). */ -#define itkGetConstReferenceObjectMacro(name, type) \ - virtual const typename type::Pointer & Get##name() const { return this->m_##name; } \ +#define itkGetConstReferenceObjectMacro(name, type) \ + virtual const typename type::Pointer & Get##name() const \ + { \ + return this->m_##name; \ + } \ ITK_MACROEND_NOOP_STATEMENT /** Set const pointer to object; uses Object reference counting methodology. @@ -1209,9 +1248,15 @@ compilers. /** Create members "name"On() and "name"Off() (e.g., DebugOn() DebugOff()). * Set method must be defined to use this macro. */ -#define itkBooleanMacro(name) \ - virtual void name##On() { this->Set##name(true); } \ - virtual void name##Off() { this->Set##name(false); } +#define itkBooleanMacro(name) \ + virtual void name##On() \ + { \ + this->Set##name(true); \ + } \ + virtual void name##Off() \ + { \ + this->Set##name(false); \ + } // clang-format off /** General set vector macro creates a single method that copies specified @@ -1245,8 +1290,11 @@ compilers. /** Get vector macro. Returns pointer to type (i.e., array of type). * This is for efficiency. */ -#define itkGetVectorMacro(name, type, count) \ - virtual type * Get##name() const { return this->m_##name; } \ +#define itkGetVectorMacro(name, type, count) \ + virtual type * Get##name() const \ + { \ + return this->m_##name; \ + } \ ITK_MACROEND_NOOP_STATEMENT /**\def itkGPUKernelClassMacro @@ -1271,7 +1319,10 @@ compilers. } #define itkGetOpenCLSourceFromKernelMacro(kernel) \ - static const char * GetOpenCLSource() { return kernel::GetOpenCLSource(); } + static const char * GetOpenCLSource() \ + { \ + return kernel::GetOpenCLSource(); \ + } // A useful macro in the PrintSelf method for printing member variables // which are pointers to object based on the LightObject class. diff --git a/Modules/Core/Common/include/itkMapContainer.h b/Modules/Core/Common/include/itkMapContainer.h index 9a522117bdc..956087a6b43 100644 --- a/Modules/Core/Common/include/itkMapContainer.h +++ b/Modules/Core/Common/include/itkMapContainer.h @@ -181,8 +181,16 @@ class ITK_TEMPLATE_EXPORT MapContainer : m_Iter(i) {} - Iterator & operator*() { return *this; } - Iterator * operator->() { return this; } + Iterator & + operator*() + { + return *this; + } + Iterator * + operator->() + { + return this; + } Iterator & operator++() { @@ -266,8 +274,16 @@ class ITK_TEMPLATE_EXPORT MapContainer : m_Iter(r.m_Iter) {} - ConstIterator & operator*() { return *this; } - ConstIterator * operator->() { return this; } + ConstIterator & + operator*() + { + return *this; + } + ConstIterator * + operator->() + { + return this; + } ConstIterator & operator++() { diff --git a/Modules/Core/Common/include/itkMath.h b/Modules/Core/Common/include/itkMath.h index c311597d815..595dcfd8425 100644 --- a/Modules/Core/Common/include/itkMath.h +++ b/Modules/Core/Common/include/itkMath.h @@ -797,11 +797,10 @@ UnsignedPower(const uintmax_t base, const uintmax_t exponent) noexcept // Uses recursive function calls because C++11 does not support other ways of // iterations for a constexpr function. - return (exponent == 0) - ? (assert(base > 0), 1) - : (exponent == 1) ? base - : UnsignedProduct(UnsignedPower(base, exponent / 2), - UnsignedPower(base, (exponent + 1) / 2)); + return (exponent == 0) ? (assert(base > 0), 1) + : (exponent == 1) ? base + : UnsignedProduct(UnsignedPower(base, exponent / 2), + UnsignedPower(base, (exponent + 1) / 2)); } diff --git a/Modules/Core/Common/include/itkMatrix.h b/Modules/Core/Common/include/itkMatrix.h index 99bc070b2d0..e009654bc3e 100644 --- a/Modules/Core/Common/include/itkMatrix.h +++ b/Modules/Core/Common/include/itkMatrix.h @@ -72,22 +72,28 @@ class ITK_TEMPLATE_EXPORT Matrix using CompatibleSquareMatrixType = Matrix; /** Matrix by Vector multiplication. */ - Vector operator*(const Vector & vect) const; + Vector + operator*(const Vector & vect) const; /** Matrix by Point multiplication. */ - Point operator*(const Point & pnt) const; + Point + operator*(const Point & pnt) const; /** Matrix by CovariantVector multiplication. */ - CovariantVector operator*(const CovariantVector & covect) const; + CovariantVector + operator*(const CovariantVector & covect) const; /** Matrix by vnl_vector_fixed multiplication. */ - vnl_vector_fixed operator*(const vnl_vector_fixed & inVNLvect) const; + vnl_vector_fixed + operator*(const vnl_vector_fixed & inVNLvect) const; /** Matrix by Matrix multiplication. */ - Self operator*(const CompatibleSquareMatrixType & matrix) const; + Self + operator*(const CompatibleSquareMatrixType & matrix) const; template - Matrix operator*(const vnl_matrix_fixed & matrix) const + Matrix + operator*(const vnl_matrix_fixed & matrix) const { const Matrix result(m_Matrix * matrix); return result; @@ -108,7 +114,8 @@ class ITK_TEMPLATE_EXPORT Matrix operator-=(const Self & matrix); /** Matrix by vnl_matrix multiplication. */ - vnl_matrix operator*(const vnl_matrix & matrix) const; + vnl_matrix + operator*(const vnl_matrix & matrix) const; /** Matrix by Matrix multiplication. */ void @@ -119,7 +126,8 @@ class ITK_TEMPLATE_EXPORT Matrix operator*=(const vnl_matrix & matrix); /** Matrix by vnl_vector multiplication. */ - vnl_vector operator*(const vnl_vector & vc) const; + vnl_vector + operator*(const vnl_vector & vc) const; /** Matrix by scalar multiplication. */ void @@ -129,7 +137,8 @@ class ITK_TEMPLATE_EXPORT Matrix } /** Matrix by scalar multiplication. */ - Self operator*(const T & value) const + Self + operator*(const T & value) const { Self result(*this); @@ -169,10 +178,18 @@ class ITK_TEMPLATE_EXPORT Matrix } /** Return a row of the matrix. */ - inline T * operator[](unsigned int i) { return m_Matrix[i]; } + inline T * + operator[](unsigned int i) + { + return m_Matrix[i]; + } /** Return a row of the matrix. */ - inline const T * operator[](unsigned int i) const { return m_Matrix[i]; } + inline const T * + operator[](unsigned int i) const + { + return m_Matrix[i]; + } /** Return the matrix. */ inline InternalMatrixType & diff --git a/Modules/Core/Common/include/itkMatrix.hxx b/Modules/Core/Common/include/itkMatrix.hxx index 28f1d8446c7..557dcef106e 100644 --- a/Modules/Core/Common/include/itkMatrix.hxx +++ b/Modules/Core/Common/include/itkMatrix.hxx @@ -26,7 +26,8 @@ namespace itk * Product by a Vector */ template -Vector Matrix::operator*(const Vector & vect) const +Vector +Matrix::operator*(const Vector & vect) const { Vector result; for (unsigned int r = 0; r < VRows; ++r) @@ -45,7 +46,8 @@ Vector Matrix::operator*(const Vector * Product by a Point */ template -Point Matrix::operator*(const Point & pnt) const +Point +Matrix::operator*(const Point & pnt) const { Point result; for (unsigned int r = 0; r < VRows; ++r) @@ -64,7 +66,8 @@ Point Matrix::operator*(const Point & * Product by a vnl_vector_fixed */ template -vnl_vector_fixed Matrix::operator*(const vnl_vector_fixed & inVNLvect) const +vnl_vector_fixed +Matrix::operator*(const vnl_vector_fixed & inVNLvect) const { vnl_vector_fixed result; for (unsigned int r = 0; r < VRows; ++r) @@ -83,7 +86,8 @@ vnl_vector_fixed Matrix::operator*(const vnl_vecto * Product by a CovariantVector */ template -CovariantVector Matrix::operator*(const CovariantVector & covect) const +CovariantVector +Matrix::operator*(const CovariantVector & covect) const { CovariantVector result; for (unsigned int r = 0; r < VRows; ++r) @@ -102,7 +106,8 @@ CovariantVector Matrix::operator*(const CovariantV * Product by a matrix */ template -Matrix Matrix::operator*(const CompatibleSquareMatrixType & matrix) const +Matrix +Matrix::operator*(const CompatibleSquareMatrixType & matrix) const { const Self result(m_Matrix * matrix.GetVnlMatrix()); return result; @@ -184,7 +189,8 @@ Matrix::operator-=(const Self & matrix) * Product by a vnl_matrix */ template -vnl_matrix Matrix::operator*(const vnl_matrix & matrix) const +vnl_matrix +Matrix::operator*(const vnl_matrix & matrix) const { return m_Matrix * matrix; } @@ -213,7 +219,8 @@ Matrix::operator*=(const vnl_matrix & matrix) * Product by a vnl_vector */ template -vnl_vector Matrix::operator*(const vnl_vector & vc) const +vnl_vector +Matrix::operator*(const vnl_vector & vc) const { return m_Matrix * vc; } diff --git a/Modules/Core/Common/include/itkMetaDataDictionary.h b/Modules/Core/Common/include/itkMetaDataDictionary.h index 9aad3891bf9..dfab483e6dc 100644 --- a/Modules/Core/Common/include/itkMetaDataDictionary.h +++ b/Modules/Core/Common/include/itkMetaDataDictionary.h @@ -121,12 +121,14 @@ class ITKCommon_EXPORT MetaDataDictionary // cannot be exported. This causes problems when building DLL's. // Here we inherit privately from std::map and provide a simple // API. The implementation will be in the DLL. - MetaDataObjectBase::Pointer & operator[](const std::string &); + MetaDataObjectBase::Pointer & + operator[](const std::string &); // \brief Get a constant point to a DataObject // // If the key does not exist then nullptr is returned. - const MetaDataObjectBase * operator[](const std::string &) const; + const MetaDataObjectBase * + operator[](const std::string &) const; const MetaDataObjectBase * Get(const std::string &) const; diff --git a/Modules/Core/Common/include/itkMetaProgrammingLibrary.h b/Modules/Core/Common/include/itkMetaProgrammingLibrary.h index 34323675a50..f901d0a7f13 100644 --- a/Modules/Core/Common/include/itkMetaProgrammingLibrary.h +++ b/Modules/Core/Common/include/itkMetaProgrammingLibrary.h @@ -44,7 +44,7 @@ struct TrueType using Type = TrueType; static constexpr ValueType Value = true; - operator ValueType() { return Value; } + operator ValueType() { return Value; } }; /** borrowed from ``. @@ -56,7 +56,7 @@ struct FalseType using ValueType = bool; using Type = FalseType; static constexpr ValueType Value = false; - operator ValueType() { return Value; } + operator ValueType() { return Value; } }; /** MPL \c if control-statement. diff --git a/Modules/Core/Common/include/itkNeighborhood.h b/Modules/Core/Common/include/itkNeighborhood.h index 6456ed81d84..ee71574f423 100644 --- a/Modules/Core/Common/include/itkNeighborhood.h +++ b/Modules/Core/Common/include/itkNeighborhood.h @@ -193,8 +193,16 @@ class ITK_TEMPLATE_EXPORT Neighborhood } /** Pass-through data access methods to the buffer. */ - TPixel & operator[](NeighborIndexType i) { return m_DataBuffer[i]; } - const TPixel & operator[](NeighborIndexType i) const { return m_DataBuffer[i]; } + TPixel & + operator[](NeighborIndexType i) + { + return m_DataBuffer[i]; + } + const TPixel & + operator[](NeighborIndexType i) const + { + return m_DataBuffer[i]; + } TPixel & GetElement(NeighborIndexType i) { @@ -249,8 +257,16 @@ class ITK_TEMPLATE_EXPORT Neighborhood } /** Get pixel value by offset */ - TPixel & operator[](const OffsetType & o) { return this->operator[](this->GetNeighborhoodIndex(o)); } - const TPixel & operator[](const OffsetType & o) const { return this->operator[](this->GetNeighborhoodIndex(o)); } + TPixel & + operator[](const OffsetType & o) + { + return this->operator[](this->GetNeighborhoodIndex(o)); + } + const TPixel & + operator[](const OffsetType & o) const + { + return this->operator[](this->GetNeighborhoodIndex(o)); + } /** Returns the itk::Offset from the center of the Neighborhood to the requested neighbor index. */ diff --git a/Modules/Core/Common/include/itkNeighborhoodAccessorFunctor.h b/Modules/Core/Common/include/itkNeighborhoodAccessorFunctor.h index e51bd9e147c..e0b1ee4faf8 100644 --- a/Modules/Core/Common/include/itkNeighborhoodAccessorFunctor.h +++ b/Modules/Core/Common/include/itkNeighborhoodAccessorFunctor.h @@ -88,7 +88,9 @@ class ITK_TEMPLATE_EXPORT NeighborhoodAccessorFunctor final return boundaryCondition->operator()(point_index, boundary_offset, data); } - void SetVectorLength(VectorLengthType) {} + void + SetVectorLength(VectorLengthType) + {} VectorLengthType SetVectorLength() { diff --git a/Modules/Core/Common/include/itkNeighborhoodAlgorithm.hxx b/Modules/Core/Common/include/itkNeighborhoodAlgorithm.hxx index 39e63b41c4a..36138e277c8 100644 --- a/Modules/Core/Common/include/itkNeighborhoodAlgorithm.hxx +++ b/Modules/Core/Common/include/itkNeighborhoodAlgorithm.hxx @@ -28,8 +28,9 @@ namespace NeighborhoodAlgorithm { template auto -ImageBoundaryFacesCalculator::Compute(const TImage & img, RegionType regionToProcess, RadiusType radius) - -> Result +ImageBoundaryFacesCalculator::Compute(const TImage & img, + RegionType regionToProcess, + RadiusType radius) -> Result { // Analyze the regionToProcess to determine if any of its faces are // along a buffer boundary (we have no data in the buffer for pixels @@ -164,8 +165,9 @@ ImageBoundaryFacesCalculator::Compute(const TImage & img, RegionType reg template auto -ImageBoundaryFacesCalculator::operator()(const TImage * img, RegionType regionToProcess, RadiusType radius) - -> FaceListType +ImageBoundaryFacesCalculator::operator()(const TImage * img, + RegionType regionToProcess, + RadiusType radius) -> FaceListType { const auto result = Compute(*img, regionToProcess, radius); diff --git a/Modules/Core/Common/include/itkNeighborhoodAllocator.h b/Modules/Core/Common/include/itkNeighborhoodAllocator.h index fb66cd8ddcd..7e7476ed628 100644 --- a/Modules/Core/Common/include/itkNeighborhoodAllocator.h +++ b/Modules/Core/Common/include/itkNeighborhoodAllocator.h @@ -149,8 +149,16 @@ class NeighborhoodAllocator } /** Data access methods */ - const TPixel & operator[](unsigned int i) const { return m_Data[i]; } - TPixel & operator[](unsigned int i) { return m_Data[i]; } + const TPixel & + operator[](unsigned int i) const + { + return m_Data[i]; + } + TPixel & + operator[](unsigned int i) + { + return m_Data[i]; + } /** Allocates a buffer of size n */ void diff --git a/Modules/Core/Common/include/itkNumberToString.h b/Modules/Core/Common/include/itkNumberToString.h index de7b3eaec16..b599c0e4c67 100644 --- a/Modules/Core/Common/include/itkNumberToString.h +++ b/Modules/Core/Common/include/itkNumberToString.h @@ -56,10 +56,10 @@ class ITK_TEMPLATE_EXPORT NumberToString // declaration of specialization template <> ITKCommon_EXPORT std::string -NumberToString::operator()(double val) const; + NumberToString::operator()(double val) const; template <> ITKCommon_EXPORT std::string -NumberToString::operator()(float val) const; + NumberToString::operator()(float val) const; template <> class NumberToString diff --git a/Modules/Core/Common/include/itkNumericTraits.h b/Modules/Core/Common/include/itkNumericTraits.h index ae4bd04fbb2..0452cf00a6d 100644 --- a/Modules/Core/Common/include/itkNumericTraits.h +++ b/Modules/Core/Common/include/itkNumericTraits.h @@ -23,11 +23,23 @@ #undef min #undef max -#define itkNUMERIC_TRAITS_MIN_MAX_MACRO() \ - static constexpr ValueType min(ValueType) { return std::numeric_limits::min(); } \ - static constexpr ValueType max(ValueType) { return std::numeric_limits::max(); } \ - static constexpr ValueType min() { return std::numeric_limits::min(); } \ - static constexpr ValueType max() { return std::numeric_limits::max(); } +#define itkNUMERIC_TRAITS_MIN_MAX_MACRO() \ + static constexpr ValueType min(ValueType) \ + { \ + return std::numeric_limits::min(); \ + } \ + static constexpr ValueType max(ValueType) \ + { \ + return std::numeric_limits::max(); \ + } \ + static constexpr ValueType min() \ + { \ + return std::numeric_limits::min(); \ + } \ + static constexpr ValueType max() \ + { \ + return std::numeric_limits::max(); \ + } #include // for std::numeric_limits #include @@ -1798,8 +1810,16 @@ class NumericTraits : public std::numeric_limits> { return std::numeric_limits::max(); } - static constexpr Self min(Self) { return min(); } - static constexpr Self max(Self) { return max(); } + static constexpr Self + min(Self) + { + return min(); + } + static constexpr Self + max(Self) + { + return max(); + } static constexpr ValueType epsilon() { diff --git a/Modules/Core/Common/include/itkOctree.h b/Modules/Core/Common/include/itkOctree.h index 647468bf4cb..6d5544fa85d 100644 --- a/Modules/Core/Common/include/itkOctree.h +++ b/Modules/Core/Common/include/itkOctree.h @@ -149,7 +149,8 @@ class ITK_TEMPLATE_EXPORT Octree : public OctreeBase const unsigned int ysize, const unsigned int zsize) override; - void BuildFromImage(Image * fromImage); + void + BuildFromImage(Image * fromImage); Octree(); ~Octree() override; diff --git a/Modules/Core/Common/include/itkOffset.h b/Modules/Core/Common/include/itkOffset.h index 694bfff02a3..056bc6f76ec 100644 --- a/Modules/Core/Common/include/itkOffset.h +++ b/Modules/Core/Common/include/itkOffset.h @@ -379,9 +379,17 @@ struct ITK_TEMPLATE_EXPORT Offset final return false; } - reference operator[](size_type pos) { return m_InternalArray[pos]; } + reference + operator[](size_type pos) + { + return m_InternalArray[pos]; + } - const_reference operator[](size_type pos) const { return m_InternalArray[pos]; } + const_reference + operator[](size_type pos) const + { + return m_InternalArray[pos]; + } reference at(size_type pos) diff --git a/Modules/Core/Common/include/itkOrientationAdapterBase.h b/Modules/Core/Common/include/itkOrientationAdapterBase.h index 30f47b3b0b8..52c64ae2652 100644 --- a/Modules/Core/Common/include/itkOrientationAdapterBase.h +++ b/Modules/Core/Common/include/itkOrientationAdapterBase.h @@ -53,10 +53,12 @@ class ITK_TEMPLATE_EXPORT [[deprecated("Since ITK 5.3 use SpatialOrientationAdap using DirectionType = typename ImageType::DirectionType; /** Convert direction cosines to the Orientation type */ - virtual OrientationType FromDirectionCosines(const DirectionType & Dir) = 0; + virtual OrientationType + FromDirectionCosines(const DirectionType & Dir) = 0; /** Convert Orientation type direction cosines */ - virtual DirectionType ToDirectionCosines(const OrientationType & Orient) = 0; + virtual DirectionType + ToDirectionCosines(const OrientationType & Orient) = 0; protected: /** destructor, to silence "virtual class has non-virtual destructor()" diff --git a/Modules/Core/Common/include/itkPeriodicBoundaryCondition.hxx b/Modules/Core/Common/include/itkPeriodicBoundaryCondition.hxx index caba00b5658..4140a2331e5 100644 --- a/Modules/Core/Common/include/itkPeriodicBoundaryCondition.hxx +++ b/Modules/Core/Common/include/itkPeriodicBoundaryCondition.hxx @@ -180,8 +180,8 @@ PeriodicBoundaryCondition::GetInputRequestedRegion( template auto -PeriodicBoundaryCondition::GetPixel(const IndexType & index, const TInputImage * image) const - -> OutputPixelType +PeriodicBoundaryCondition::GetPixel(const IndexType & index, + const TInputImage * image) const -> OutputPixelType { RegionType imageRegion = image->GetLargestPossibleRegion(); IndexType imageIndex = imageRegion.GetIndex(); diff --git a/Modules/Core/Common/include/itkPhasedArray3DSpecialCoordinatesImage.h b/Modules/Core/Common/include/itkPhasedArray3DSpecialCoordinatesImage.h index df4a79eec02..b9a5edbe2ff 100644 --- a/Modules/Core/Common/include/itkPhasedArray3DSpecialCoordinatesImage.h +++ b/Modules/Core/Common/include/itkPhasedArray3DSpecialCoordinatesImage.h @@ -367,7 +367,8 @@ class ITK_TEMPLATE_EXPORT PhasedArray3DSpecialCoordinatesImage : public SpecialC itkSetMacro(FirstSampleDistance, double); template - void TransformLocalVectorToPhysicalVector(FixedArray &) const + void + TransformLocalVectorToPhysicalVector(FixedArray &) const {} template diff --git a/Modules/Core/Common/include/itkPolygonCell.hxx b/Modules/Core/Common/include/itkPolygonCell.hxx index d48fb8ef5c6..991255ebada 100644 --- a/Modules/Core/Common/include/itkPolygonCell.hxx +++ b/Modules/Core/Common/include/itkPolygonCell.hxx @@ -109,8 +109,7 @@ PolygonCell::GetBoundaryFeature(int dimension, { switch (dimension) { - case 0: - { + case 0: { VertexAutoPointer vertexPointer; if (this->GetVertex(featureId, vertexPointer)) { @@ -119,8 +118,7 @@ PolygonCell::GetBoundaryFeature(int dimension, } break; } - case 1: - { + case 1: { EdgeAutoPointer edgePointer; if (this->GetEdge(featureId, edgePointer)) { diff --git a/Modules/Core/Common/include/itkPromoteType.h b/Modules/Core/Common/include/itkPromoteType.h index 7162ac1805c..a6b30e9bfe2 100644 --- a/Modules/Core/Common/include/itkPromoteType.h +++ b/Modules/Core/Common/include/itkPromoteType.h @@ -112,17 +112,28 @@ struct PromoteType static Details::Identity<2>::Type & Check(typename Details::SizeToType<2, TA, TB>::Type, T); // Common numeric types - static Details::Identity<3>::Type & Check(typename Details::SizeToType<3, TA, TB>::Type, int); - static Details::Identity<4>::Type & Check(typename Details::SizeToType<4, TA, TB>::Type, int); - static Details::Identity<5>::Type & Check(typename Details::SizeToType<5, TA, TB>::Type, int); - static Details::Identity<6>::Type & Check(typename Details::SizeToType<6, TA, TB>::Type, int); - static Details::Identity<7>::Type & Check(typename Details::SizeToType<7, TA, TB>::Type, int); - static Details::Identity<8>::Type & Check(typename Details::SizeToType<8, TA, TB>::Type, int); - static Details::Identity<9>::Type & Check(typename Details::SizeToType<9, TA, TB>::Type, int); - static Details::Identity<10>::Type & Check(typename Details::SizeToType<10, TA, TB>::Type, int); - static Details::Identity<11>::Type & Check(typename Details::SizeToType<11, TA, TB>::Type, int); - static Details::Identity<12>::Type & Check(typename Details::SizeToType<12, TA, TB>::Type, int); - static Details::Identity<13>::Type & Check(typename Details::SizeToType<13, TA, TB>::Type, int); + static Details::Identity<3>::Type & + Check(typename Details::SizeToType<3, TA, TB>::Type, int); + static Details::Identity<4>::Type & + Check(typename Details::SizeToType<4, TA, TB>::Type, int); + static Details::Identity<5>::Type & + Check(typename Details::SizeToType<5, TA, TB>::Type, int); + static Details::Identity<6>::Type & + Check(typename Details::SizeToType<6, TA, TB>::Type, int); + static Details::Identity<7>::Type & + Check(typename Details::SizeToType<7, TA, TB>::Type, int); + static Details::Identity<8>::Type & + Check(typename Details::SizeToType<8, TA, TB>::Type, int); + static Details::Identity<9>::Type & + Check(typename Details::SizeToType<9, TA, TB>::Type, int); + static Details::Identity<10>::Type & + Check(typename Details::SizeToType<10, TA, TB>::Type, int); + static Details::Identity<11>::Type & + Check(typename Details::SizeToType<11, TA, TB>::Type, int); + static Details::Identity<12>::Type & + Check(typename Details::SizeToType<12, TA, TB>::Type, int); + static Details::Identity<13>::Type & + Check(typename Details::SizeToType<13, TA, TB>::Type, int); public: /** Type result of operations between \c TA and \c TB. diff --git a/Modules/Core/Common/include/itkQuadraticEdgeCell.hxx b/Modules/Core/Common/include/itkQuadraticEdgeCell.hxx index 88b81784125..ab07f672a8f 100644 --- a/Modules/Core/Common/include/itkQuadraticEdgeCell.hxx +++ b/Modules/Core/Common/include/itkQuadraticEdgeCell.hxx @@ -86,8 +86,7 @@ QuadraticEdgeCell::GetBoundaryFeature(int dime { switch (dimension) { - case 0: - { + case 0: { VertexAutoPointer vertexPointer; if (this->GetVertex(featureId, vertexPointer)) { diff --git a/Modules/Core/Common/include/itkQuadraticTriangleCell.hxx b/Modules/Core/Common/include/itkQuadraticTriangleCell.hxx index 74d96543d1e..25f5cd03a98 100644 --- a/Modules/Core/Common/include/itkQuadraticTriangleCell.hxx +++ b/Modules/Core/Common/include/itkQuadraticTriangleCell.hxx @@ -88,8 +88,7 @@ QuadraticTriangleCell::GetBoundaryFeature(int { switch (dimension) { - case 0: - { + case 0: { VertexAutoPointer vertexPointer; if (this->GetVertex(featureId, vertexPointer)) { @@ -98,8 +97,7 @@ QuadraticTriangleCell::GetBoundaryFeature(int } break; } - case 1: - { + case 1: { EdgeAutoPointer edgePointer; if (this->GetEdge(featureId, edgePointer)) { diff --git a/Modules/Core/Common/include/itkQuadrilateralCell.h b/Modules/Core/Common/include/itkQuadrilateralCell.h index acf10441a73..5f84559ea5a 100644 --- a/Modules/Core/Common/include/itkQuadrilateralCell.h +++ b/Modules/Core/Common/include/itkQuadrilateralCell.h @@ -141,7 +141,7 @@ class ITK_TEMPLATE_EXPORT QuadrilateralCell // This was observed in at least gcc 4.8 and 5.4.0, and // AppleClang 7.0.2 and 8.0.0. Probably others too. // "= default" doesn't gain us much, so just don't use it here. - ~QuadrilateralCell() override{}; + ~QuadrilateralCell() override {}; #else ~QuadrilateralCell() override = default; #endif diff --git a/Modules/Core/Common/include/itkQuadrilateralCell.hxx b/Modules/Core/Common/include/itkQuadrilateralCell.hxx index 36551042363..d19e1e911d8 100644 --- a/Modules/Core/Common/include/itkQuadrilateralCell.hxx +++ b/Modules/Core/Common/include/itkQuadrilateralCell.hxx @@ -91,8 +91,7 @@ QuadrilateralCell::GetBoundaryFeature(int dime { switch (dimension) { - case 0: - { + case 0: { VertexAutoPointer vertexPointer; if (this->GetVertex(featureId, vertexPointer)) { @@ -101,8 +100,7 @@ QuadrilateralCell::GetBoundaryFeature(int dime } break; } - case 1: - { + case 1: { EdgeAutoPointer edgePointer; if (this->GetEdge(featureId, edgePointer)) { diff --git a/Modules/Core/Common/include/itkRGBAPixel.h b/Modules/Core/Common/include/itkRGBAPixel.h index 65205478704..176d09e5956 100644 --- a/Modules/Core/Common/include/itkRGBAPixel.h +++ b/Modules/Core/Common/include/itkRGBAPixel.h @@ -111,8 +111,9 @@ class ITK_TEMPLATE_EXPORT RGBAPixel : public FixedArray Self operator+(const Self & r) const; Self - operator-(const Self & r) const; - Self operator*(const ComponentType & r) const; + operator-(const Self & r) const; + Self + operator*(const ComponentType & r) const; Self operator/(const ComponentType & r) const; diff --git a/Modules/Core/Common/include/itkRGBAPixel.hxx b/Modules/Core/Common/include/itkRGBAPixel.hxx index 65d5028ec28..ac2c91d1631 100644 --- a/Modules/Core/Common/include/itkRGBAPixel.hxx +++ b/Modules/Core/Common/include/itkRGBAPixel.hxx @@ -103,7 +103,8 @@ RGBAPixel::operator/=(const ComponentType & r) } template -RGBAPixel RGBAPixel::operator*(const ComponentType & r) const +RGBAPixel +RGBAPixel::operator*(const ComponentType & r) const { Self result; diff --git a/Modules/Core/Common/include/itkRGBPixel.h b/Modules/Core/Common/include/itkRGBPixel.h index 643024b15ad..030e635b181 100644 --- a/Modules/Core/Common/include/itkRGBPixel.h +++ b/Modules/Core/Common/include/itkRGBPixel.h @@ -120,8 +120,9 @@ class ITK_TEMPLATE_EXPORT RGBPixel : public FixedArray Self operator+(const Self & r) const; Self - operator-(const Self & r) const; - Self operator*(const ComponentType & r) const; + operator-(const Self & r) const; + Self + operator*(const ComponentType & r) const; Self operator/(const ComponentType & r) const; diff --git a/Modules/Core/Common/include/itkRGBPixel.hxx b/Modules/Core/Common/include/itkRGBPixel.hxx index e89f6ba17e5..42fee507e94 100644 --- a/Modules/Core/Common/include/itkRGBPixel.hxx +++ b/Modules/Core/Common/include/itkRGBPixel.hxx @@ -103,7 +103,8 @@ RGBPixel::operator/=(const ComponentType & r) } template -RGBPixel RGBPixel::operator*(const ComponentType & r) const +RGBPixel +RGBPixel::operator*(const ComponentType & r) const { Self result; diff --git a/Modules/Core/Common/include/itkShapedImageNeighborhoodRange.h b/Modules/Core/Common/include/itkShapedImageNeighborhoodRange.h index a6594c22c9b..ec74b895a13 100644 --- a/Modules/Core/Common/include/itkShapedImageNeighborhoodRange.h +++ b/Modules/Core/Common/include/itkShapedImageNeighborhoodRange.h @@ -347,7 +347,8 @@ class ShapedImageNeighborhoodRange final {} - TImageNeighborhoodPixelAccessPolicy CreatePixelAccessPolicy(EmptyPixelAccessParameter) const + TImageNeighborhoodPixelAccessPolicy + CreatePixelAccessPolicy(EmptyPixelAccessParameter) const { return TImageNeighborhoodPixelAccessPolicy{ m_ImageSize, m_OffsetTable, m_NeighborhoodAccessor, m_RelativeLocation + *m_CurrentOffset @@ -403,7 +404,8 @@ class ShapedImageNeighborhoodRange final /** Returns a reference to the current pixel. */ - reference operator*() const noexcept + reference + operator*() const noexcept { return reference{ m_ImageBufferPointer, CreatePixelAccessPolicy(m_OptionalPixelAccessParameter) }; } @@ -566,7 +568,11 @@ class ShapedImageNeighborhoodRange final /** Returns it[n] for iterator 'it' and integer value 'n'. */ - reference operator[](const difference_type n) const noexcept { return *(*this + n); } + reference + operator[](const difference_type n) const noexcept + { + return *(*this + n); + } }; static constexpr bool IsImageTypeConst = std::is_const_v; @@ -777,7 +783,8 @@ class ShapedImageNeighborhoodRange final * iterator::reference. The return value is a proxy object that behaves like a * reference to the pixel. */ - typename QualifiedIterator::reference operator[](const size_t n) const noexcept + typename QualifiedIterator::reference + operator[](const size_t n) const noexcept { assert(n < this->size()); assert(n <= static_cast(std::numeric_limits::max())); diff --git a/Modules/Core/Common/include/itkSingleton.h b/Modules/Core/Common/include/itkSingleton.h index a0847f87323..51c04c77955 100644 --- a/Modules/Core/Common/include/itkSingleton.h +++ b/Modules/Core/Common/include/itkSingleton.h @@ -33,7 +33,7 @@ */ template [[deprecated("Preferably use the C++ `[[maybe_unused]]` attribute instead!")]] inline void -Unused(const T &){}; +Unused(const T &) {}; #endif namespace itk diff --git a/Modules/Core/Common/include/itkSize.h b/Modules/Core/Common/include/itkSize.h index 2e6a60c8441..e58e9514e7b 100644 --- a/Modules/Core/Common/include/itkSize.h +++ b/Modules/Core/Common/include/itkSize.h @@ -139,7 +139,8 @@ struct ITK_TEMPLATE_EXPORT Size final } /** Multiply two sizes (elementwise product). */ - const Self operator*(const Self & vec) const + const Self + operator*(const Self & vec) const { Self result; @@ -351,9 +352,17 @@ struct ITK_TEMPLATE_EXPORT Size final return false; } - constexpr reference operator[](size_type pos) { return m_InternalArray[pos]; } + constexpr reference + operator[](size_type pos) + { + return m_InternalArray[pos]; + } - constexpr const_reference operator[](size_type pos) const { return m_InternalArray[pos]; } + constexpr const_reference + operator[](size_type pos) const + { + return m_InternalArray[pos]; + } reference at(size_type pos) diff --git a/Modules/Core/Common/include/itkSliceIterator.h b/Modules/Core/Common/include/itkSliceIterator.h index 13ab52ff284..9713d26c89b 100644 --- a/Modules/Core/Common/include/itkSliceIterator.h +++ b/Modules/Core/Common/include/itkSliceIterator.h @@ -95,11 +95,19 @@ class SliceIterator /** Returns the element at position n of the slice. Sets the * iterator to point to position n. */ - TPixel & operator[](OffsetValueType n) { return this->Loc(m_Pos = n); } + TPixel & + operator[](OffsetValueType n) + { + return this->Loc(m_Pos = n); + } /** Dereferences the iterator, returning the value that it points * to. */ - TPixel & operator*() { return Loc(m_Pos); } + TPixel & + operator*() + { + return Loc(m_Pos); + } /** Returns the logical && of the boolean == of two slice iterator positions, * stride, and start locations. */ diff --git a/Modules/Core/Common/include/itkSmartPointer.h b/Modules/Core/Common/include/itkSmartPointer.h index 6ed775ac68a..f027648d70d 100644 --- a/Modules/Core/Common/include/itkSmartPointer.h +++ b/Modules/Core/Common/include/itkSmartPointer.h @@ -103,11 +103,23 @@ class SmartPointer ~SmartPointer() { this->UnRegister(); } /** Overload operator -> */ - ObjectType * operator->() const noexcept { return m_Pointer; } + ObjectType * + operator->() const noexcept + { + return m_Pointer; + } - ObjectType & operator*() const noexcept { return *m_Pointer; } + ObjectType & + operator*() const noexcept + { + return *m_Pointer; + } - explicit operator bool() const noexcept { return m_Pointer != nullptr; } + explicit + operator bool() const noexcept + { + return m_Pointer != nullptr; + } /** Return pointer to object. */ operator ObjectType *() const noexcept { return m_Pointer; } @@ -160,7 +172,8 @@ class SmartPointer return *this; } - SmartPointer & operator=(std::nullptr_t) noexcept + SmartPointer & + operator=(std::nullptr_t) noexcept { this->UnRegister(); this->m_Pointer = nullptr; diff --git a/Modules/Core/Common/include/itkSmartPointerForwardReference.hxx b/Modules/Core/Common/include/itkSmartPointerForwardReference.hxx index 2e23865dcc9..e1cffae687a 100644 --- a/Modules/Core/Common/include/itkSmartPointerForwardReference.hxx +++ b/Modules/Core/Common/include/itkSmartPointerForwardReference.hxx @@ -54,7 +54,8 @@ SmartPointerForwardReference::~SmartPointerForwardReference() //---------------------------------------------------------------------------- template -T * SmartPointerForwardReference::operator->() const +T * +SmartPointerForwardReference::operator->() const { return m_Pointer; } diff --git a/Modules/Core/Common/include/itkSparseFieldLayer.h b/Modules/Core/Common/include/itkSparseFieldLayer.h index f5fb3331a0b..90efd525e2e 100644 --- a/Modules/Core/Common/include/itkSparseFieldLayer.h +++ b/Modules/Core/Common/include/itkSparseFieldLayer.h @@ -37,9 +37,17 @@ template class ITK_TEMPLATE_EXPORT ConstSparseFieldLayerIterator { public: - const TNodeType & operator*() const { return *m_Pointer; } + const TNodeType & + operator*() const + { + return *m_Pointer; + } - const TNodeType * operator->() const { return m_Pointer; } + const TNodeType * + operator->() const + { + return m_Pointer; + } const TNodeType * GetPointer() const @@ -104,9 +112,17 @@ class ITK_TEMPLATE_EXPORT SparseFieldLayerIterator : public ConstSparseFieldLaye : Superclass(p) {} - TNodeType & operator*() { return *this->m_Pointer; } + TNodeType & + operator*() + { + return *this->m_Pointer; + } - TNodeType * operator->() { return this->m_Pointer; } + TNodeType * + operator->() + { + return this->m_Pointer; + } TNodeType * GetPointer() diff --git a/Modules/Core/Common/include/itkSpatialOrientation.h b/Modules/Core/Common/include/itkSpatialOrientation.h index 50d345f491e..fdc8e55afdc 100644 --- a/Modules/Core/Common/include/itkSpatialOrientation.h +++ b/Modules/Core/Common/include/itkSpatialOrientation.h @@ -461,7 +461,7 @@ extern ITKCommon_EXPORT std::ostream & extern ITKCommon_EXPORT std::ostream & operator<<(std::ostream & out, const SpatialOrientationEnums::CoordinateMajornessTerms value); extern ITKCommon_EXPORT std::ostream & - operator<<(std::ostream & out, const SpatialOrientationEnums::ValidCoordinateOrientations value); +operator<<(std::ostream & out, const SpatialOrientationEnums::ValidCoordinateOrientations value); #ifndef ITK_LEGACY_REMOVE namespace SpatialOrientation diff --git a/Modules/Core/Common/include/itkSpecialCoordinatesImage.h b/Modules/Core/Common/include/itkSpecialCoordinatesImage.h index 90fce4143b0..af4e8f74a17 100644 --- a/Modules/Core/Common/include/itkSpecialCoordinatesImage.h +++ b/Modules/Core/Common/include/itkSpecialCoordinatesImage.h @@ -223,13 +223,21 @@ class ITK_TEMPLATE_EXPORT SpecialCoordinatesImage : public ImageBaseGetPixel(index); } + TPixel & + operator[](const IndexType & index) + { + return this->GetPixel(index); + } /** \brief Access a pixel. This version can only be an rvalue. * * For efficiency, this function does not check that the * image has actually been allocated yet. */ - const TPixel & operator[](const IndexType & index) const { return this->GetPixel(index); } + const TPixel & + operator[](const IndexType & index) const + { + return this->GetPixel(index); + } /** Return a pointer to the beginning of the buffer. This is used by * the image iterator class. */ diff --git a/Modules/Core/Common/include/itkSymmetricEigenAnalysis.h b/Modules/Core/Common/include/itkSymmetricEigenAnalysis.h index ff6d65f46e8..275acf66f09 100644 --- a/Modules/Core/Common/include/itkSymmetricEigenAnalysis.h +++ b/Modules/Core/Common/include/itkSymmetricEigenAnalysis.h @@ -709,8 +709,9 @@ class ITK_TEMPLATE_EXPORT SymmetricEigenAnalysis * @return an unsigned int with no information value (no error code in EigenLib) */ template auto - ComputeEigenValuesWithEigenLibraryImpl(const QMatrix & A, TVector & EigenValues, bool) const - -> decltype(GetPointerToMatrixData(A), 1U) + ComputeEigenValuesWithEigenLibraryImpl(const QMatrix & A, + TVector & EigenValues, + bool) const -> decltype(GetPointerToMatrixData(A), 1U) { auto pointerToData = GetPointerToMatrixData(A); using PointerType = decltype(pointerToData); @@ -1056,8 +1057,9 @@ class ITK_TEMPLATE_EXPORT SymmetricEigenAnalysisFixedDimension * @return an unsigned int with no information value (no error code in EigenLib) */ template auto - ComputeEigenValuesWithEigenLibraryImpl(const QMatrix & A, TVector & EigenValues, bool) const - -> decltype(GetPointerToMatrixData(A), 1U) + ComputeEigenValuesWithEigenLibraryImpl(const QMatrix & A, + TVector & EigenValues, + bool) const -> decltype(GetPointerToMatrixData(A), 1U) { auto pointerToData = GetPointerToMatrixData(A); using PointerType = decltype(pointerToData); diff --git a/Modules/Core/Common/include/itkSymmetricSecondRankTensor.h b/Modules/Core/Common/include/itkSymmetricSecondRankTensor.h index 9a8de6111c6..9dfebb02500 100644 --- a/Modules/Core/Common/include/itkSymmetricSecondRankTensor.h +++ b/Modules/Core/Common/include/itkSymmetricSecondRankTensor.h @@ -156,7 +156,8 @@ class ITK_TEMPLATE_EXPORT SymmetricSecondRankTensor : public FixedArray::operator/=(const RealValueType & r) * Performs multiplication with a scalar */ template -SymmetricSecondRankTensor SymmetricSecondRankTensor::operator*( - const RealValueType & r) const +SymmetricSecondRankTensor +SymmetricSecondRankTensor::operator*(const RealValueType & r) const { Self result; diff --git a/Modules/Core/Common/include/itkTetrahedronCell.hxx b/Modules/Core/Common/include/itkTetrahedronCell.hxx index 431617d6884..d559c457911 100644 --- a/Modules/Core/Common/include/itkTetrahedronCell.hxx +++ b/Modules/Core/Common/include/itkTetrahedronCell.hxx @@ -214,8 +214,7 @@ TetrahedronCell::GetBoundaryFeature(int dimens { switch (dimension) { - case 0: - { + case 0: { VertexAutoPointer vertexPointer; if (this->GetVertex(featureId, vertexPointer)) { @@ -224,8 +223,7 @@ TetrahedronCell::GetBoundaryFeature(int dimens } break; } - case 1: - { + case 1: { EdgeAutoPointer edgePointer; if (this->GetEdge(featureId, edgePointer)) { @@ -234,8 +232,7 @@ TetrahedronCell::GetBoundaryFeature(int dimens } break; } - case 2: - { + case 2: { FaceAutoPointer facePointer; if (this->GetFace(featureId, facePointer)) { diff --git a/Modules/Core/Common/include/itkThreadSupport.h b/Modules/Core/Common/include/itkThreadSupport.h index 467ced7a418..cd025547a12 100644 --- a/Modules/Core/Common/include/itkThreadSupport.h +++ b/Modules/Core/Common/include/itkThreadSupport.h @@ -107,8 +107,8 @@ struct ConditionVariableType // threads to wake up and // release the semaphore - int m_WasBroadcast; // Used as boolean. Keeps track of whether - // we were broadcasting or signaling + int m_WasBroadcast; // Used as boolean. Keeps track of whether + // we were broadcasting or signaling #endif }; diff --git a/Modules/Core/Common/include/itkTriangleCell.h b/Modules/Core/Common/include/itkTriangleCell.h index 24b6a787ddf..d2e2f4e5012 100644 --- a/Modules/Core/Common/include/itkTriangleCell.h +++ b/Modules/Core/Common/include/itkTriangleCell.h @@ -188,7 +188,7 @@ class ITK_TEMPLATE_EXPORT TriangleCell // This was observed in at least gcc 4.8 and 5.4.0, and // AppleClang 7.0.2 and 8.0.0. Probably others too. // "= default" doesn't gain us much, so just don't use it here. - ~TriangleCell() override{}; + ~TriangleCell() override {}; #else ~TriangleCell() override = default; #endif diff --git a/Modules/Core/Common/include/itkTriangleCell.hxx b/Modules/Core/Common/include/itkTriangleCell.hxx index 2f4a8fd0a4e..de01e8813e2 100644 --- a/Modules/Core/Common/include/itkTriangleCell.hxx +++ b/Modules/Core/Common/include/itkTriangleCell.hxx @@ -69,8 +69,7 @@ TriangleCell::GetBoundaryFeature(int dimension { switch (dimension) { - case 0: - { + case 0: { VertexAutoPointer vertexPointer; if (this->GetVertex(featureId, vertexPointer)) { @@ -79,8 +78,7 @@ TriangleCell::GetBoundaryFeature(int dimension } break; } - case 1: - { + case 1: { EdgeAutoPointer edgePointer; if (this->GetEdge(featureId, edgePointer)) { diff --git a/Modules/Core/Common/include/itkTriangleHelper.hxx b/Modules/Core/Common/include/itkTriangleHelper.hxx index 42bdd5de2ea..2e753b52389 100644 --- a/Modules/Core/Common/include/itkTriangleHelper.hxx +++ b/Modules/Core/Common/include/itkTriangleHelper.hxx @@ -132,8 +132,9 @@ TriangleHelper::ComputeBarycenter(const CoordRepType & iA1, template auto -TriangleHelper::ComputeAngle(const PointType & iP1, const PointType & iP2, const PointType & iP3) - -> CoordRepType +TriangleHelper::ComputeAngle(const PointType & iP1, + const PointType & iP2, + const PointType & iP3) -> CoordRepType { VectorType v21 = iP1 - iP2; VectorType v23 = iP3 - iP2; @@ -159,16 +160,18 @@ TriangleHelper::ComputeAngle(const PointType & iP1, const PointType & iP template auto -TriangleHelper::ComputeGravityCenter(const PointType & iP1, const PointType & iP2, const PointType & iP3) - -> PointType +TriangleHelper::ComputeGravityCenter(const PointType & iP1, + const PointType & iP2, + const PointType & iP3) -> PointType { return ComputeBarycenter(1., iP1, 1., iP2, 1., iP3); } template auto -TriangleHelper::ComputeCircumCenter(const PointType & iP1, const PointType & iP2, const PointType & iP3) - -> PointType +TriangleHelper::ComputeCircumCenter(const PointType & iP1, + const PointType & iP2, + const PointType & iP3) -> PointType { PointType oPt; @@ -224,8 +227,9 @@ TriangleHelper::ComputeArea(const PointType & iP1, const PointType & iP2 template auto -TriangleHelper::ComputeMixedArea(const PointType & iP1, const PointType & iP2, const PointType & iP3) - -> CoordRepType +TriangleHelper::ComputeMixedArea(const PointType & iP1, + const PointType & iP2, + const PointType & iP3) -> CoordRepType { using TriangleType = TriangleHelper; diff --git a/Modules/Core/Common/include/itkValarrayImageContainer.h b/Modules/Core/Common/include/itkValarrayImageContainer.h index 7cf966d5ade..d5c492158dc 100644 --- a/Modules/Core/Common/include/itkValarrayImageContainer.h +++ b/Modules/Core/Common/include/itkValarrayImageContainer.h @@ -90,10 +90,18 @@ class ITK_TEMPLATE_EXPORT ValarrayImageContainer itkOverrideGetNameOfClassMacro(ValarrayImageContainer); /** Index operator. This version can be an lvalue. */ - TElement & operator[](const ElementIdentifier id) { return this->ValarrayType::operator[](id); } + TElement & + operator[](const ElementIdentifier id) + { + return this->ValarrayType::operator[](id); + } /** Index operator. This version can only be an rvalue */ - const TElement & operator[](const ElementIdentifier id) const { return this->ValarrayType::operator[](id); } + const TElement & + operator[](const ElementIdentifier id) const + { + return this->ValarrayType::operator[](id); + } /** Return a pointer to the beginning of the buffer. This is used by * the image iterator class. */ diff --git a/Modules/Core/Common/include/itkVariableLengthVector.h b/Modules/Core/Common/include/itkVariableLengthVector.h index 6eece59fd6e..900f7550e87 100644 --- a/Modules/Core/Common/include/itkVariableLengthVector.h +++ b/Modules/Core/Common/include/itkVariableLengthVector.h @@ -592,9 +592,17 @@ class ITK_TEMPLATE_EXPORT VariableLengthVector } /** Return reference to the element at specified index. No range checking. */ - TValue & operator[](unsigned int i) { return this->m_Data[i]; } + TValue & + operator[](unsigned int i) + { + return this->m_Data[i]; + } /** Return reference to the element at specified index. No range checking. */ - TValue const & operator[](unsigned int i) const { return this->m_Data[i]; } + TValue const & + operator[](unsigned int i) const + { + return this->m_Data[i]; + } /** Get one element */ const TValue & @@ -1231,7 +1239,8 @@ struct VariableLengthVectorExpression * * \c Load() is in charge of fetching the i-th element of the sub-expressions */ - ResType operator[](unsigned int idx) const + ResType + operator[](unsigned int idx) const { itkAssertInDebugAndIgnoreInReleaseMacro(idx < Size()); return TBinaryOp::Apply(Details::GetType::Load(m_lhs, idx), Details::GetType::Load(m_rhs, idx)); diff --git a/Modules/Core/Common/include/itkVariableSizeMatrix.h b/Modules/Core/Common/include/itkVariableSizeMatrix.h index ef302d781cf..f3ee84e4e7d 100644 --- a/Modules/Core/Common/include/itkVariableSizeMatrix.h +++ b/Modules/Core/Common/include/itkVariableSizeMatrix.h @@ -56,10 +56,12 @@ class ITK_TEMPLATE_EXPORT VariableSizeMatrix using InternalMatrixType = vnl_matrix; /** Matrix by Vector multiplication. */ - Array operator*(const Array & vect) const; + Array + operator*(const Array & vect) const; /** Matrix by Matrix multiplication. */ - Self operator*(const Self & matrix) const; + Self + operator*(const Self & matrix) const; /** Matrix addition. */ Self @@ -80,7 +82,8 @@ class ITK_TEMPLATE_EXPORT VariableSizeMatrix operator-(); /** Matrix by vnl_matrix multiplication. */ - vnl_matrix operator*(const vnl_matrix & matrix) const; + vnl_matrix + operator*(const vnl_matrix & matrix) const; /** Matrix by Matrix multiplication. */ void @@ -91,7 +94,8 @@ class ITK_TEMPLATE_EXPORT VariableSizeMatrix operator*=(const vnl_matrix & matrix); /** Matrix by vnl_vector multiplication. */ - vnl_vector operator*(const vnl_vector & vc) const; + vnl_vector + operator*(const vnl_vector & vc) const; /** Matrix by scalar multiplication. */ void @@ -101,7 +105,8 @@ class ITK_TEMPLATE_EXPORT VariableSizeMatrix } /** Matrix by scalar multiplication. */ - Self operator*(const T & value) const + Self + operator*(const T & value) const { Self result(*this); @@ -141,10 +146,18 @@ class ITK_TEMPLATE_EXPORT VariableSizeMatrix } /** Return a row of the matrix. */ - inline T * operator[](unsigned int i) { return m_Matrix[i]; } + inline T * + operator[](unsigned int i) + { + return m_Matrix[i]; + } /** Return a row of the matrix. */ - inline const T * operator[](unsigned int i) const { return m_Matrix[i]; } + inline const T * + operator[](unsigned int i) const + { + return m_Matrix[i]; + } /** Return the matrix. */ inline InternalMatrixType & diff --git a/Modules/Core/Common/include/itkVariableSizeMatrix.hxx b/Modules/Core/Common/include/itkVariableSizeMatrix.hxx index d6ce69e35a9..e8f6671f4af 100644 --- a/Modules/Core/Common/include/itkVariableSizeMatrix.hxx +++ b/Modules/Core/Common/include/itkVariableSizeMatrix.hxx @@ -31,7 +31,8 @@ VariableSizeMatrix::VariableSizeMatrix(unsigned int rows, unsigned int cols) * Product by a Vector */ template -Array VariableSizeMatrix::operator*(const Array & vect) const +Array +VariableSizeMatrix::operator*(const Array & vect) const { unsigned int rows = this->Rows(); unsigned int cols = this->Cols(); @@ -59,7 +60,8 @@ Array VariableSizeMatrix::operator*(const Array & vect) const * Product by a matrix */ template -VariableSizeMatrix VariableSizeMatrix::operator*(const Self & matrix) const +VariableSizeMatrix +VariableSizeMatrix::operator*(const Self & matrix) const { if (this->Cols() != matrix.Rows()) { @@ -188,7 +190,8 @@ VariableSizeMatrix::operator-() * Product by a vnl_matrix */ template -vnl_matrix VariableSizeMatrix::operator*(const vnl_matrix & matrix) const +vnl_matrix +VariableSizeMatrix::operator*(const vnl_matrix & matrix) const { return m_Matrix * matrix; } @@ -217,7 +220,8 @@ VariableSizeMatrix::operator*=(const vnl_matrix & matrix) * Product by a vnl_vector */ template -vnl_vector VariableSizeMatrix::operator*(const vnl_vector & vc) const +vnl_vector +VariableSizeMatrix::operator*(const vnl_vector & vc) const { return m_Matrix * vc; } diff --git a/Modules/Core/Common/include/itkVector.h b/Modules/Core/Common/include/itkVector.h index 02fd8fec328..eb5764b8ca2 100644 --- a/Modules/Core/Common/include/itkVector.h +++ b/Modules/Core/Common/include/itkVector.h @@ -198,11 +198,13 @@ class ITK_TEMPLATE_EXPORT Vector : public FixedArray /** Vector operator*. Performs the inner product of two vectors. * this is also known as the scalar product. */ - ValueType operator*(const Self & other) const; + ValueType + operator*(const Self & other) const; /** Scalar operator*. Scale the elements of a vector by a scalar. * Return a new vector. */ - inline Self operator*(const ValueType & value) const + inline Self + operator*(const ValueType & value) const { Self result; @@ -293,7 +295,8 @@ class ITK_TEMPLATE_EXPORT Vector : public FixedArray /** Premultiply Operator for product of a vector and a scalar. * Vector< T, N > = T * Vector< T,N > */ template -inline Vector operator*(const T & scalar, const Vector & v) +inline Vector +operator*(const T & scalar, const Vector & v) { return v.operator*(scalar); } diff --git a/Modules/Core/Common/include/itkVector.hxx b/Modules/Core/Common/include/itkVector.hxx index 408a9d8cb4f..8efdc3a70f3 100644 --- a/Modules/Core/Common/include/itkVector.hxx +++ b/Modules/Core/Common/include/itkVector.hxx @@ -194,7 +194,8 @@ operator>>(std::istream & is, Vector & vct) } template -typename Vector::ValueType Vector::operator*(const Self & other) const +typename Vector::ValueType +Vector::operator*(const Self & other) const { typename NumericTraits::AccumulateType value = T{}; for (unsigned int i = 0; i < TVectorDimension; ++i) diff --git a/Modules/Core/Common/include/itkVectorContainer.h b/Modules/Core/Common/include/itkVectorContainer.h index 5e217d16d17..ba2d3067c31 100644 --- a/Modules/Core/Common/include/itkVectorContainer.h +++ b/Modules/Core/Common/include/itkVectorContainer.h @@ -162,8 +162,16 @@ class ITK_TEMPLATE_EXPORT VectorContainer : m_Pos(d) , m_Iter(i) {} - Iterator & operator*() { return *this; } - Iterator * operator->() { return this; } + Iterator & + operator*() + { + return *this; + } + Iterator * + operator->() + { + return this; + } Iterator & operator++() { @@ -290,8 +298,16 @@ class ITK_TEMPLATE_EXPORT VectorContainer : m_Pos(r.m_Pos) , m_Iter(r.m_Iter) {} - ConstIterator & operator*() { return *this; } - ConstIterator * operator->() { return this; } + ConstIterator & + operator*() + { + return *this; + } + ConstIterator * + operator->() + { + return this; + } ConstIterator & operator++() { diff --git a/Modules/Core/Common/include/itkVectorImage.h b/Modules/Core/Common/include/itkVectorImage.h index 30a52652555..128bc364329 100644 --- a/Modules/Core/Common/include/itkVectorImage.h +++ b/Modules/Core/Common/include/itkVectorImage.h @@ -274,13 +274,21 @@ class ITK_TEMPLATE_EXPORT VectorImage : public ImageBase * * For efficiency, this function does not check that the * image has actually been allocated yet. */ - PixelType operator[](const IndexType & index) { return this->GetPixel(index); } + PixelType + operator[](const IndexType & index) + { + return this->GetPixel(index); + } /** \brief Access a pixel. * * For efficiency, this function does not check that the * image has actually been allocated yet. */ - const PixelType operator[](const IndexType & index) const { return this->GetPixel(index); } + const PixelType + operator[](const IndexType & index) const + { + return this->GetPixel(index); + } /** Return a pointer to the beginning of the buffer. This is used by * the image iterator class. */ diff --git a/Modules/Core/Common/include/itkVersor.h b/Modules/Core/Common/include/itkVersor.h index 5763fcfdaf1..a3c9536f654 100644 --- a/Modules/Core/Common/include/itkVersor.h +++ b/Modules/Core/Common/include/itkVersor.h @@ -158,7 +158,8 @@ class ITK_TEMPLATE_EXPORT Versor /** Versor operator*. Performs the composition of two versors. * this operation is NOT commutative. */ - Self operator*(const Self & v) const; + Self + operator*(const Self & v) const; /** Versor operator/. Performs the division of two versors. */ Self diff --git a/Modules/Core/Common/include/itkVersor.hxx b/Modules/Core/Common/include/itkVersor.hxx index ba4071aa3d5..1f92ade20fc 100644 --- a/Modules/Core/Common/include/itkVersor.hxx +++ b/Modules/Core/Common/include/itkVersor.hxx @@ -79,7 +79,8 @@ Versor::operator*=(const Self & v) } template -Versor Versor::operator*(const Self & v) const +Versor +Versor::operator*(const Self & v) const { Self result; diff --git a/Modules/Core/Common/include/itkWeakPointer.h b/Modules/Core/Common/include/itkWeakPointer.h index ca9320c1836..45aa1a56b5b 100644 --- a/Modules/Core/Common/include/itkWeakPointer.h +++ b/Modules/Core/Common/include/itkWeakPointer.h @@ -63,7 +63,11 @@ class WeakPointer {} /** Overload operator ->. */ - ObjectType * operator->() const { return m_Pointer; } + ObjectType * + operator->() const + { + return m_Pointer; + } /** Return pointer to object. */ operator ObjectType *() const { return m_Pointer; } diff --git a/Modules/Core/Common/include/itkWin32OutputWindow.h b/Modules/Core/Common/include/itkWin32OutputWindow.h index 97fbd874667..aa880c7a346 100644 --- a/Modules/Core/Common/include/itkWin32OutputWindow.h +++ b/Modules/Core/Common/include/itkWin32OutputWindow.h @@ -73,7 +73,7 @@ class ITKCommon_EXPORT Win32OutputWindow : public OutputWindow DisplayText(const char *) override; static LRESULT APIENTRY - WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); + WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); protected: Win32OutputWindow() = default; diff --git a/Modules/Core/Common/include/itkZeroFluxNeumannImageNeighborhoodPixelAccessPolicy.h b/Modules/Core/Common/include/itkZeroFluxNeumannImageNeighborhoodPixelAccessPolicy.h index 4f1edf0ae9d..0237e55f302 100644 --- a/Modules/Core/Common/include/itkZeroFluxNeumannImageNeighborhoodPixelAccessPolicy.h +++ b/Modules/Core/Common/include/itkZeroFluxNeumannImageNeighborhoodPixelAccessPolicy.h @@ -67,9 +67,9 @@ class ZeroFluxNeumannImageNeighborhoodPixelAccessPolicy final GetClampedIndexValue(const IndexValueType indexValue, const ImageSizeValueType imageSizeValue) noexcept { return (indexValue <= 0) ? 0 - : (static_cast(indexValue) < imageSizeValue) - ? indexValue - : static_cast(imageSizeValue - 1); + : (static_cast(indexValue) < imageSizeValue) + ? indexValue + : static_cast(imageSizeValue - 1); } // Private helper function. Calculates and returns the index value of the diff --git a/Modules/Core/Common/src/itkArrayOutputSpecialization.cxx b/Modules/Core/Common/src/itkArrayOutputSpecialization.cxx index 5dd38fdaf24..d6802f9e270 100644 --- a/Modules/Core/Common/src/itkArrayOutputSpecialization.cxx +++ b/Modules/Core/Common/src/itkArrayOutputSpecialization.cxx @@ -22,7 +22,7 @@ namespace itk { template <> -std::ostream & operator<<(std::ostream & os, const Array & arr) +std::ostream & operator<< (std::ostream & os, const Array & arr) { os << '['; const size_t length = arr.size(); @@ -40,7 +40,7 @@ std::ostream & operator<<(std::ostream & os, const Array & arr) } template <> -std::ostream & operator<<(std::ostream & os, const Array & arr) +std::ostream & operator<< (std::ostream & os, const Array & arr) { os << '['; const size_t length = arr.size(); @@ -58,7 +58,7 @@ std::ostream & operator<<(std::ostream & os, const Array & arr) } template <> -std::ostream & operator<<(std::ostream & os, const Array2D & arr) +std::ostream & operator<< (std::ostream & os, const Array2D & arr) { const unsigned int numberOfRows = arr.rows(); const unsigned int numberOfColumns = arr.cols(); @@ -82,7 +82,7 @@ std::ostream & operator<<(std::ostream & os, const Array2D & arr } template <> -std::ostream & operator<<(std::ostream & os, const Array2D & arr) +std::ostream & operator<< (std::ostream & os, const Array2D & arr) { const unsigned int numberOfRows = arr.rows(); const unsigned int numberOfColumns = arr.cols(); diff --git a/Modules/Core/Common/src/itkCompensatedSummation.cxx b/Modules/Core/Common/src/itkCompensatedSummation.cxx index 26a32b14c5a..df1bd3bd95a 100644 --- a/Modules/Core/Common/src/itkCompensatedSummation.cxx +++ b/Modules/Core/Common/src/itkCompensatedSummation.cxx @@ -26,12 +26,12 @@ namespace itk { void ITKCommon_EXPORT - CompensatedSummationAddElement(float & compensation, float & sum, const float element) +CompensatedSummationAddElement(float & compensation, float & sum, const float element) { CompensatedSummationAddElement(compensation, sum, element, 1); } void ITKCommon_EXPORT - CompensatedSummationAddElement(double & compensation, double & sum, const double element) +CompensatedSummationAddElement(double & compensation, double & sum, const double element) { CompensatedSummationAddElement(compensation, sum, element, 1); } diff --git a/Modules/Core/Common/src/itkCovariantVector.cxx b/Modules/Core/Common/src/itkCovariantVector.cxx index 64e8ad75233..2f12b74d6c8 100644 --- a/Modules/Core/Common/src/itkCovariantVector.cxx +++ b/Modules/Core/Common/src/itkCovariantVector.cxx @@ -28,7 +28,7 @@ namespace itk */ void ITKCommon_EXPORT - CrossProduct(CovariantVector & c, const Vector & a, const Vector & b) +CrossProduct(CovariantVector & c, const Vector & a, const Vector & b) { c[0] = a[1] * b[2] - a[2] * b[1]; c[1] = a[2] * b[0] - a[0] * b[2]; @@ -36,7 +36,7 @@ void ITKCommon_EXPORT } void ITKCommon_EXPORT - CrossProduct(CovariantVector & c, const Vector & a, const Vector & b) +CrossProduct(CovariantVector & c, const Vector & a, const Vector & b) { c[0] = a[1] * b[2] - a[2] * b[1]; c[1] = a[2] * b[0] - a[0] * b[2]; @@ -44,7 +44,7 @@ void ITKCommon_EXPORT } void ITKCommon_EXPORT - CrossProduct(CovariantVector & c, const Vector & a, const Vector & b) +CrossProduct(CovariantVector & c, const Vector & a, const Vector & b) { c[0] = a[1] * b[2] - a[2] * b[1]; c[1] = a[2] * b[0] - a[0] * b[2]; diff --git a/Modules/Core/Common/src/itkLightObject.cxx b/Modules/Core/Common/src/itkLightObject.cxx index 132e79caf8d..2328902ac31 100644 --- a/Modules/Core/Common/src/itkLightObject.cxx +++ b/Modules/Core/Common/src/itkLightObject.cxx @@ -96,13 +96,13 @@ LightObject::operator new[](size_t n) void LightObject::operator delete(void * m) { - delete[](char *) m; + delete[] (char *)m; } void LightObject::operator delete[](void * m, size_t) { - delete[](char *) m; + delete[] (char *)m; } #endif diff --git a/Modules/Core/Common/src/itkLoggerBase.cxx b/Modules/Core/Common/src/itkLoggerBase.cxx index 5f1a6ec1ee5..3fd1fb92012 100644 --- a/Modules/Core/Common/src/itkLoggerBase.cxx +++ b/Modules/Core/Common/src/itkLoggerBase.cxx @@ -77,14 +77,12 @@ LoggerBase::BuildFormattedEntry(PriorityLevelEnum level, std::string const & con switch (this->m_TimeStampFormat) { - case TimeStampFormatEnum::REALVALUE: - { + case TimeStampFormatEnum::REALVALUE: { s.precision(30); s << m_Clock->GetTimeInSeconds(); break; } - case TimeStampFormatEnum::HUMANREADABLE: - { + case TimeStampFormatEnum::HUMANREADABLE: { s << itksys::SystemTools::GetCurrentDateTime(this->m_HumanReadableFormat.c_str()); break; } diff --git a/Modules/Core/Common/src/itkMemoryUsageObserver.cxx b/Modules/Core/Common/src/itkMemoryUsageObserver.cxx index 61cbe7b657d..f0b993d3063 100644 --- a/Modules/Core/Common/src/itkMemoryUsageObserver.cxx +++ b/Modules/Core/Common/src/itkMemoryUsageObserver.cxx @@ -169,8 +169,8 @@ struct SYSTEM_PROCESSES ULONG pad4; ULONG pad5; # else - ULONG ProcessId; - ULONG InheritedFromProcessId; + ULONG ProcessId; + ULONG InheritedFromProcessId; # endif ULONG HandleCount; ULONG Reserved2[2]; diff --git a/Modules/Core/Common/src/itkMetaDataDictionary.cxx b/Modules/Core/Common/src/itkMetaDataDictionary.cxx index 8edd058fd05..04113be49de 100644 --- a/Modules/Core/Common/src/itkMetaDataDictionary.cxx +++ b/Modules/Core/Common/src/itkMetaDataDictionary.cxx @@ -51,13 +51,15 @@ MetaDataDictionary::Print(std::ostream & os) const } } -MetaDataObjectBase::Pointer & MetaDataDictionary::operator[](const std::string & key) +MetaDataObjectBase::Pointer & +MetaDataDictionary::operator[](const std::string & key) { MakeUnique(); return (*m_Dictionary)[key]; } -const MetaDataObjectBase * MetaDataDictionary::operator[](const std::string & key) const +const MetaDataObjectBase * +MetaDataDictionary::operator[](const std::string & key) const { auto iter = m_Dictionary->find(key); if (iter == m_Dictionary->end()) diff --git a/Modules/Core/Common/src/itkNumericTraits.cxx b/Modules/Core/Common/src/itkNumericTraits.cxx index 550dad4a85a..9d1d225629a 100644 --- a/Modules/Core/Common/src/itkNumericTraits.cxx +++ b/Modules/Core/Common/src/itkNumericTraits.cxx @@ -44,11 +44,11 @@ template <> const std::complex NumericTraits>::One = std::complex(1, 0); template <> -const std::complex NumericTraits>::Zero = std::complex(0, - 0); +const std::complex NumericTraits>::Zero = + std::complex(0, 0); template <> -const std::complex NumericTraits>::One = std::complex(1, - 0); +const std::complex NumericTraits>::One = + std::complex(1, 0); template <> const std::complex NumericTraits>::Zero = std::complex(0, 0); @@ -66,11 +66,11 @@ template <> const std::complex NumericTraits>::One = std::complex(1L, 0L); template <> -const std::complex NumericTraits>::Zero = std::complex(0UL, - 0UL); +const std::complex NumericTraits>::Zero = + std::complex(0UL, 0UL); template <> -const std::complex NumericTraits>::One = std::complex(1UL, - 0UL); +const std::complex NumericTraits>::One = + std::complex(1UL, 0UL); #endif // !defined(ITK_LEGACY_REMOVE) template <> diff --git a/Modules/Core/Common/src/itkObjectFactoryBase.cxx b/Modules/Core/Common/src/itkObjectFactoryBase.cxx index cdf7f68de57..e54848ea7e3 100644 --- a/Modules/Core/Common/src/itkObjectFactoryBase.cxx +++ b/Modules/Core/Common/src/itkObjectFactoryBase.cxx @@ -256,7 +256,7 @@ ObjectFactoryBase::LoadDynamicFactories() # ifdef _WIN32 char PathSeparator = ';'; # else - char PathSeparator = ':'; + char PathSeparator = ':'; # endif const std::string itk_autoload_env{ "ITK_AUTOLOAD_PATH" }; @@ -554,8 +554,7 @@ ObjectFactoryBase::RegisterFactory(ObjectFactoryBase * factory, InsertionPositio // switch (where) { - case InsertionPositionEnum::INSERT_AT_BACK: - { + case InsertionPositionEnum::INSERT_AT_BACK: { if (position) { itkGenericExceptionMacro( @@ -564,8 +563,7 @@ ObjectFactoryBase::RegisterFactory(ObjectFactoryBase * factory, InsertionPositio m_PimplGlobals->m_RegisteredFactories.push_back(factory); break; } - case InsertionPositionEnum::INSERT_AT_FRONT: - { + case InsertionPositionEnum::INSERT_AT_FRONT: { if (position) { itkGenericExceptionMacro( @@ -574,8 +572,7 @@ ObjectFactoryBase::RegisterFactory(ObjectFactoryBase * factory, InsertionPositio m_PimplGlobals->m_RegisteredFactories.push_front(factory); break; } - case InsertionPositionEnum::INSERT_AT_POSITION: - { + case InsertionPositionEnum::INSERT_AT_POSITION: { const size_t numberOfFactories = m_PimplGlobals->m_RegisteredFactories.size(); if (position < numberOfFactories) { diff --git a/Modules/Core/Common/src/itkProcessObject.cxx b/Modules/Core/Common/src/itkProcessObject.cxx index 27149b018a7..45235d6c941 100644 --- a/Modules/Core/Common/src/itkProcessObject.cxx +++ b/Modules/Core/Common/src/itkProcessObject.cxx @@ -95,7 +95,8 @@ ProcessObject::MakeOutput(const DataObjectIdentifierType & name) } -DataObject::Pointer ProcessObject::MakeOutput(DataObjectPointerArraySizeType) +DataObject::Pointer +ProcessObject::MakeOutput(DataObjectPointerArraySizeType) { return static_cast(DataObject::New().GetPointer()); } diff --git a/Modules/Core/Common/src/itkSmapsFileParser.cxx b/Modules/Core/Common/src/itkSmapsFileParser.cxx index 9a2f2ce8d50..3e5ab8505c8 100644 --- a/Modules/Core/Common/src/itkSmapsFileParser.cxx +++ b/Modules/Core/Common/src/itkSmapsFileParser.cxx @@ -20,7 +20,7 @@ namespace itk { bool ITKCommon_EXPORT - ci_equal(char a, char b) +ci_equal(char a, char b) { return tolower(static_cast(a)) == tolower(static_cast(b)); } diff --git a/Modules/Core/Common/src/itkSpatialOrientationAdapter.cxx b/Modules/Core/Common/src/itkSpatialOrientationAdapter.cxx index e7e19898d68..e0b60485ac5 100644 --- a/Modules/Core/Common/src/itkSpatialOrientationAdapter.cxx +++ b/Modules/Core/Common/src/itkSpatialOrientationAdapter.cxx @@ -71,21 +71,18 @@ SpatialOrientationAdapter::FromDirectionCosines(const DirectionType & Dir) switch (max_c) { - case 0: - { + case 0: { // When the dominant axis sign is positive, assign the coordinate for the direction we are increasing away from. terms[max_r] = (max_sgn == 1) ? SpatialOrientationTerms::ITK_COORDINATE_Right : SpatialOrientationTerms::ITK_COORDINATE_Left; break; } - case 1: - { + case 1: { terms[max_r] = (max_sgn == 1) ? SpatialOrientationTerms::ITK_COORDINATE_Anterior : SpatialOrientationTerms::ITK_COORDINATE_Posterior; break; } - case 2: - { + case 2: { terms[max_r] = (max_sgn == 1) ? SpatialOrientationTerms::ITK_COORDINATE_Inferior : SpatialOrientationTerms::ITK_COORDINATE_Superior; break; diff --git a/Modules/Core/Common/src/itkVector.cxx b/Modules/Core/Common/src/itkVector.cxx index 44259f07492..8481814507a 100644 --- a/Modules/Core/Common/src/itkVector.cxx +++ b/Modules/Core/Common/src/itkVector.cxx @@ -28,7 +28,7 @@ namespace itk */ Vector ITKCommon_EXPORT - CrossProduct(const Vector & a, const Vector & b) +CrossProduct(const Vector & a, const Vector & b) { Vector c; c[0] = a[1] * b[2] - a[2] * b[1]; @@ -38,7 +38,7 @@ Vector ITKCommon_EXPORT } Vector ITKCommon_EXPORT - CrossProduct(const Vector & a, const Vector & b) +CrossProduct(const Vector & a, const Vector & b) { Vector c; c[0] = a[1] * b[2] - a[2] * b[1]; @@ -48,7 +48,7 @@ Vector ITKCommon_EXPORT } Vector ITKCommon_EXPORT - CrossProduct(const Vector & a, const Vector & b) +CrossProduct(const Vector & a, const Vector & b) { Vector c; c[0] = a[1] * b[2] - a[2] * b[1]; diff --git a/Modules/Core/Common/src/itkWin32OutputWindow.cxx b/Modules/Core/Common/src/itkWin32OutputWindow.cxx index 4e2b4ceb7bf..d9224331797 100644 --- a/Modules/Core/Common/src/itkWin32OutputWindow.cxx +++ b/Modules/Core/Common/src/itkWin32OutputWindow.cxx @@ -44,12 +44,11 @@ Win32OutputWindow::~Win32OutputWindow() /** */ LRESULT APIENTRY - Win32OutputWindow::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +Win32OutputWindow::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { - case WM_SIZE: - { + case WM_SIZE: { /** width of client area */ int w = LOWORD(lParam); diff --git a/Modules/Core/Common/src/itkXMLFileOutputWindow.cxx b/Modules/Core/Common/src/itkXMLFileOutputWindow.cxx index cf24b3c3b02..5d14b291cbc 100644 --- a/Modules/Core/Common/src/itkXMLFileOutputWindow.cxx +++ b/Modules/Core/Common/src/itkXMLFileOutputWindow.cxx @@ -82,38 +82,32 @@ XMLFileOutputWindow::DisplayXML(const char * tag, const char * text) { switch (*s) { - case '&': - { + case '&': { strcat(x, "&"); x += 5; break; } - case '"': - { + case '"': { strcat(x, """); x += 6; break; } - case '\'': - { + case '\'': { strcat(x, "'"); x += 6; break; } - case '<': - { + case '<': { strcat(x, "<"); x += 4; break; } - case '>': - { + case '>': { strcat(x, ">"); x += 4; break; } - default: - { + default: { *x = *s; ++x; *x = '\0'; // explicitly terminate the new string diff --git a/Modules/Core/Common/test/ClientTestLibraryA.h b/Modules/Core/Common/test/ClientTestLibraryA.h index 302280c2b19..6cf16412405 100644 --- a/Modules/Core/Common/test/ClientTestLibraryA.h +++ b/Modules/Core/Common/test/ClientTestLibraryA.h @@ -43,10 +43,10 @@ class ClientTestLibraryA_EXPORT ITKObjectProducer }; int ClientTestLibraryA_EXPORT - dynamic_castDownCastEquivalencyTable(const char * type, const char * instanceSource, itk::Object const * base); +dynamic_castDownCastEquivalencyTable(const char * type, const char * instanceSource, itk::Object const * base); int ClientTestLibraryA_EXPORT - dynamic_castDownCastImage(const char * type, const char * instanceSource, itk::Object const * base); +dynamic_castDownCastImage(const char * type, const char * instanceSource, itk::Object const * base); } // end namespace LibraryA diff --git a/Modules/Core/Common/test/ClientTestLibraryC.h b/Modules/Core/Common/test/ClientTestLibraryC.h index a9a8a5be4fc..ac20f6dbe4b 100644 --- a/Modules/Core/Common/test/ClientTestLibraryC.h +++ b/Modules/Core/Common/test/ClientTestLibraryC.h @@ -43,10 +43,10 @@ class ClientTestLibraryC_EXPORT ITKObjectProducer }; int ClientTestLibraryC_EXPORT - dynamic_castDownCastEquivalencyTable(const char * type, const char * instanceSource, itk::Object const * base); +dynamic_castDownCastEquivalencyTable(const char * type, const char * instanceSource, itk::Object const * base); int ClientTestLibraryC_EXPORT - dynamic_castDownCastImage(const char * type, const char * instanceSource, itk::Object const * base); +dynamic_castDownCastImage(const char * type, const char * instanceSource, itk::Object const * base); } // end namespace LibraryC diff --git a/Modules/Core/Common/test/SharedTestLibraryA.h b/Modules/Core/Common/test/SharedTestLibraryA.h index f8ebf69e00d..b823c17b2e2 100644 --- a/Modules/Core/Common/test/SharedTestLibraryA.h +++ b/Modules/Core/Common/test/SharedTestLibraryA.h @@ -23,6 +23,6 @@ #include void SharedTestLibraryA_EXPORT - bar(); +bar(); #endif diff --git a/Modules/Core/Common/test/SharedTestLibraryB.h b/Modules/Core/Common/test/SharedTestLibraryB.h index 9a00b166d75..add865bb3f7 100644 --- a/Modules/Core/Common/test/SharedTestLibraryB.h +++ b/Modules/Core/Common/test/SharedTestLibraryB.h @@ -23,6 +23,6 @@ #include void SharedTestLibraryB_EXPORT - foo(); +foo(); #endif diff --git a/Modules/Core/Common/test/itkCommandObserverObjectTest.cxx b/Modules/Core/Common/test/itkCommandObserverObjectTest.cxx index 23bc60571f9..b72bf939917 100644 --- a/Modules/Core/Common/test/itkCommandObserverObjectTest.cxx +++ b/Modules/Core/Common/test/itkCommandObserverObjectTest.cxx @@ -311,7 +311,7 @@ testLambdaCommand() ITK_TEST_EXPECT_EQUAL(1, cnt); ITK_TEST_EXPECT_EQUAL(1, name_of_class_cnt); - } // A DeleteEvent is called here! as object "o" is deleted + } // A DeleteEvent is called here! as object "o" is deleted ITK_TEST_EXPECT_EQUAL(2, cnt); // Verify that cnt really was incremented during DeleteEvent! ITK_TEST_EXPECT_EQUAL(2, name_of_class_cnt); return EXIT_SUCCESS; diff --git a/Modules/Core/Common/test/itkFilterDispatchTest.cxx b/Modules/Core/Common/test/itkFilterDispatchTest.cxx index bcf3f3f26fe..076c1713763 100644 --- a/Modules/Core/Common/test/itkFilterDispatchTest.cxx +++ b/Modules/Core/Common/test/itkFilterDispatchTest.cxx @@ -150,7 +150,8 @@ ExampleImageFilter::Execute(const DispatchBase &) * instantiation. */ template -void ExampleImageFilter::Execute(Dispatch<2>) +void +ExampleImageFilter::Execute(Dispatch<2>) { std::cout << "2d-specific Execute() has been called." << std::endl; @@ -170,7 +171,8 @@ void ExampleImageFilter::Execute(Dispatch<2>) * instantiation. */ template -void ExampleImageFilter::Execute(Dispatch<3>) +void +ExampleImageFilter::Execute(Dispatch<3>) { std::cout << "3d-specific Execute() has been called." << std::endl; @@ -190,7 +192,8 @@ void ExampleImageFilter::Execute(Dispatch<3>) * fail to compile. */ template -void ExampleImageFilter::Execute(Dispatch<0>) +void +ExampleImageFilter::Execute(Dispatch<0>) { // this_should_not_have_been_instantiated(); throw std::string("The 0-Dispatch method should not have been called."); diff --git a/Modules/Core/Common/test/itkFloodFilledSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkFloodFilledSpatialFunctionTest.cxx index 21816b5811f..8647c1d59eb 100644 --- a/Modules/Core/Common/test/itkFloodFilledSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkFloodFilledSpatialFunctionTest.cxx @@ -101,23 +101,19 @@ itkFloodFilledSpatialFunctionTest(int, char *[]) switch (strat) { - case 0: - { + case 0: { sfi.SetOriginInclusionStrategy(); } break; - case 1: - { + case 1: { sfi.SetCenterInclusionStrategy(); } break; - case 2: - { + case 2: { sfi.SetCompleteInclusionStrategy(); } break; - case 3: - { + case 3: { sfi.SetIntersectInclusionStrategy(); } } // end switch inclusion strategy diff --git a/Modules/Core/Common/test/itkImageBufferRangeGTest.cxx b/Modules/Core/Common/test/itkImageBufferRangeGTest.cxx index 2481e0594da..0632aeb30fa 100644 --- a/Modules/Core/Common/test/itkImageBufferRangeGTest.cxx +++ b/Modules/Core/Common/test/itkImageBufferRangeGTest.cxx @@ -750,7 +750,7 @@ TEST(ImageBufferRange, IteratorsSupportRandomAccess) static_assert(std::is_convertible_v b), bool>, "Return type tested"); static_assert(std::is_convertible_v= b), bool>, "Return type tested"); static_assert(std::is_convertible_v, "Return type tested"); - EXPECT_EQ(a 0); + EXPECT_EQ(a < b, b - a > 0); EXPECT_EQ(a > b, b < a); EXPECT_EQ(a >= b, !(a < b)); EXPECT_EQ(a <= b, !(b < a)); diff --git a/Modules/Core/Common/test/itkMultiThreaderParallelizeArrayTest.cxx b/Modules/Core/Common/test/itkMultiThreaderParallelizeArrayTest.cxx index c5f157273e1..15db221b08c 100644 --- a/Modules/Core/Common/test/itkMultiThreaderParallelizeArrayTest.cxx +++ b/Modules/Core/Common/test/itkMultiThreaderParallelizeArrayTest.cxx @@ -70,8 +70,7 @@ itkMultiThreaderParallelizeArrayTest(int argc, char * argv[]) auto progressPO = SomeProcessObject::New(); auto showProgress = ShowProgress::New(); progressPO->AddObserver(itk::ProgressEvent(), showProgress); - mt->ParallelizeArray( - 1, size, [&vec](int i) { vec[i] = i; }, progressPO); + mt->ParallelizeArray(1, size, [&vec](int i) { vec[i] = i; }, progressPO); int result = EXIT_SUCCESS; if (vec[0] != 0) diff --git a/Modules/Core/Common/test/itkShapedImageNeighborhoodRangeGTest.cxx b/Modules/Core/Common/test/itkShapedImageNeighborhoodRangeGTest.cxx index 2550872be58..0ffc94763ae 100644 --- a/Modules/Core/Common/test/itkShapedImageNeighborhoodRangeGTest.cxx +++ b/Modules/Core/Common/test/itkShapedImageNeighborhoodRangeGTest.cxx @@ -858,7 +858,7 @@ TEST(ShapedImageNeighborhoodRange, IteratorsSupportRandomAccess) static_assert(std::is_convertible_v b), bool>, "Return type tested"); static_assert(std::is_convertible_v= b), bool>, "Return type tested"); static_assert(std::is_convertible_v, "Return type tested"); - EXPECT_EQ(a 0); + EXPECT_EQ(a < b, b - a > 0); EXPECT_EQ(a > b, b < a); EXPECT_EQ(a >= b, !(a < b)); EXPECT_EQ(a <= b, !(b < a)); diff --git a/Modules/Core/Common/test/itkSmartPointerTest.cxx b/Modules/Core/Common/test/itkSmartPointerTest.cxx index 55e30222489..a0e94b82691 100644 --- a/Modules/Core/Common/test/itkSmartPointerTest.cxx +++ b/Modules/Core/Common/test/itkSmartPointerTest.cxx @@ -93,7 +93,9 @@ itkTestObjectSubClass::New() // This SHOULD NOT be used in ITK, all functions // should take raw pointers as arguments -void TestUpCastPointer(itkTestObject::Pointer) {} +void +TestUpCastPointer(itkTestObject::Pointer) +{} // Test a function that takes an itkTestObject raw pointer void diff --git a/Modules/Core/Common/test/itkSpatialOrientationAdaptorGTest.cxx b/Modules/Core/Common/test/itkSpatialOrientationAdaptorGTest.cxx index 638da456419..6855e68e76f 100644 --- a/Modules/Core/Common/test/itkSpatialOrientationAdaptorGTest.cxx +++ b/Modules/Core/Common/test/itkSpatialOrientationAdaptorGTest.cxx @@ -35,8 +35,8 @@ TEST(SpatialOrientationAdaptor, test1) adapter.FromDirectionCosines(d1)); const double data[] = { 0.5986634407395047, 0.22716302314740483, -0.768113953548866, - 0.5627936241740271, 0.563067040943212, 0.6051601804419384, - 0.5699696670095713, -0.794576911518317, 0.20924175102261847 }; + 0.5627936241740271, 0.563067040943212, 0.6051601804419384, + 0.5699696670095713, -0.794576911518317, 0.20924175102261847 }; DirectionType d2{ DirectionType::InternalMatrixType{ data } }; EXPECT_EQ(itk::SpatialOrientationEnums::ValidCoordinateOrientations::ITK_COORDINATE_ORIENTATION_ASL, adapter.FromDirectionCosines(d2)); diff --git a/Modules/Core/Common/test/itkVariableLengthVectorTest.cxx b/Modules/Core/Common/test/itkVariableLengthVectorTest.cxx index f7dd56020a1..a0adb1afcef 100644 --- a/Modules/Core/Common/test/itkVariableLengthVectorTest.cxx +++ b/Modules/Core/Common/test/itkVariableLengthVectorTest.cxx @@ -288,128 +288,129 @@ itkVariableLengthVectorTest(int, char *[]) { // Testing arithmetic operations (and rvalue references) - { FloatVariableLengthVectorType v = f + f + f; - ASSERT(v[0] == 3.0 && v[1] == 6.0 && v[2] == 9.0, "Chained additions failed"); -} -{ // rvref + lv - FloatVariableLengthVectorType v = (f + f) + f; - ASSERT(v[0] == 3.0 && v[1] == 6.0 && v[2] == 9.0, "Chained additions failed"); -} -{ // lv + rvref - FloatVariableLengthVectorType v = f + (f + f); - ASSERT(v[0] == 3.0 && v[1] == 6.0 && v[2] == 9.0, "Chained additions failed"); -} -{ // 2xlv+lv ; rvref + rvref - FloatVariableLengthVectorType v = (f + f) + (f + f); - ASSERT(v[0] == 4.0 && v[1] == 8.0 && v[2] == 12.0, "Chained additions failed"); -} + { + FloatVariableLengthVectorType v = f + f + f; + ASSERT(v[0] == 3.0 && v[1] == 6.0 && v[2] == 9.0, "Chained additions failed"); + } + { // rvref + lv + FloatVariableLengthVectorType v = (f + f) + f; + ASSERT(v[0] == 3.0 && v[1] == 6.0 && v[2] == 9.0, "Chained additions failed"); + } + { // lv + rvref + FloatVariableLengthVectorType v = f + (f + f); + ASSERT(v[0] == 3.0 && v[1] == 6.0 && v[2] == 9.0, "Chained additions failed"); + } + { // 2xlv+lv ; rvref + rvref + FloatVariableLengthVectorType v = (f + f) + (f + f); + ASSERT(v[0] == 4.0 && v[1] == 8.0 && v[2] == 12.0, "Chained additions failed"); + } -{ - FloatVariableLengthVectorType v = f - f - f; - ASSERT(v[0] == -1.0 && v[1] == -2.0 && v[2] == -3.0, "Chained subtractions failed"); -} -{ // rvref - lv - FloatVariableLengthVectorType v = (f - f) - f; - ASSERT(v[0] == -1.0 && v[1] == -2.0 && v[2] == -3.0, "Chained subtractions failed"); -} -{ // lv - rvref - FloatVariableLengthVectorType v = f - (f - f); - ASSERT(v[0] == 1.0 && v[1] == 2.0 && v[2] == 3.0, "Chained subtractions failed"); -} -{ // 2xlv-lv ; rvref - rvref - FloatVariableLengthVectorType v = (f - f) - (f - f); - ASSERT(v[0] == 0.0 && v[1] == 0.0 && v[2] == 0.0, "Chained subtractions failed"); -} + { + FloatVariableLengthVectorType v = f - f - f; + ASSERT(v[0] == -1.0 && v[1] == -2.0 && v[2] == -3.0, "Chained subtractions failed"); + } + { // rvref - lv + FloatVariableLengthVectorType v = (f - f) - f; + ASSERT(v[0] == -1.0 && v[1] == -2.0 && v[2] == -3.0, "Chained subtractions failed"); + } + { // lv - rvref + FloatVariableLengthVectorType v = f - (f - f); + ASSERT(v[0] == 1.0 && v[1] == 2.0 && v[2] == 3.0, "Chained subtractions failed"); + } + { // 2xlv-lv ; rvref - rvref + FloatVariableLengthVectorType v = (f - f) - (f - f); + ASSERT(v[0] == 0.0 && v[1] == 0.0 && v[2] == 0.0, "Chained subtractions failed"); + } -{ // c + lv - FloatVariableLengthVectorType v = 2.f + f; - ASSERT(v[0] == 3.0 && v[1] == 4.0 && v[2] == 5.0, "Addition with scalar failed"); -} -{ // lv + c - FloatVariableLengthVectorType v = f + 2.f; - ASSERT(v[0] == 3.0 && v[1] == 4.0 && v[2] == 5.0, "Addition with scalar failed"); -} -{ // rvref + c - FloatVariableLengthVectorType v = (f + f) + 2.f; - ASSERT(v[0] == 4.0 && v[1] == 6.0 && v[2] == 8.0, "Addition with scalar failed"); -} -{ // c + rvref - FloatVariableLengthVectorType v = 2.f + (f + f); - ASSERT(v[0] == 4.0 && v[1] == 6.0 && v[2] == 8.0, "Addition with scalar failed"); -} + { // c + lv + FloatVariableLengthVectorType v = 2.f + f; + ASSERT(v[0] == 3.0 && v[1] == 4.0 && v[2] == 5.0, "Addition with scalar failed"); + } + { // lv + c + FloatVariableLengthVectorType v = f + 2.f; + ASSERT(v[0] == 3.0 && v[1] == 4.0 && v[2] == 5.0, "Addition with scalar failed"); + } + { // rvref + c + FloatVariableLengthVectorType v = (f + f) + 2.f; + ASSERT(v[0] == 4.0 && v[1] == 6.0 && v[2] == 8.0, "Addition with scalar failed"); + } + { // c + rvref + FloatVariableLengthVectorType v = 2.f + (f + f); + ASSERT(v[0] == 4.0 && v[1] == 6.0 && v[2] == 8.0, "Addition with scalar failed"); + } -{ // c - lv - FloatVariableLengthVectorType v = 2.f - f; - ASSERT(v[0] == 1.0 && v[1] == 0.0 && v[2] == -1.0, "Subtraction with scalar failed"); -} -{ // lv - c - FloatVariableLengthVectorType v = f - 2.f; - ASSERT(v[0] == -1.0 && v[1] == 0.0 && v[2] == 1.0, "Subtraction with scalar failed"); -} -{ // rvref - c - FloatVariableLengthVectorType v = (f + f) - 2.f; - ASSERT(v[0] == 0.0 && v[1] == 2.0 && v[2] == 4.0, "Subtraction with scalar failed"); -} -{ // c - rvref - FloatVariableLengthVectorType v = 2.f - (f + f); - ASSERT(v[0] == 0.0 && v[1] == -2.0 && v[2] == -4.0, "Subtraction with scalar failed"); -} + { // c - lv + FloatVariableLengthVectorType v = 2.f - f; + ASSERT(v[0] == 1.0 && v[1] == 0.0 && v[2] == -1.0, "Subtraction with scalar failed"); + } + { // lv - c + FloatVariableLengthVectorType v = f - 2.f; + ASSERT(v[0] == -1.0 && v[1] == 0.0 && v[2] == 1.0, "Subtraction with scalar failed"); + } + { // rvref - c + FloatVariableLengthVectorType v = (f + f) - 2.f; + ASSERT(v[0] == 0.0 && v[1] == 2.0 && v[2] == 4.0, "Subtraction with scalar failed"); + } + { // c - rvref + FloatVariableLengthVectorType v = 2.f - (f + f); + ASSERT(v[0] == 0.0 && v[1] == -2.0 && v[2] == -4.0, "Subtraction with scalar failed"); + } -{ // c * lv - FloatVariableLengthVectorType v = 2 * f; - ASSERT(v[0] == 2.0 && v[1] == 4.0 && v[2] == 6.0, "Multiplication with scalar failed"); -} -{ // lv * c - FloatVariableLengthVectorType v = f * 2; - ASSERT(v[0] == 2.0 && v[1] == 4.0 && v[2] == 6.0, "Multiplication with scalar failed"); -} -{ // rvref * c - FloatVariableLengthVectorType v = (f + f) * 2; - ASSERT(v[0] == 4.0 && v[1] == 8.0 && v[2] == 12.0, "Multiplication with scalar failed"); -} -{ // c * rvref - FloatVariableLengthVectorType v = 2 * (f + f); - ASSERT(v[0] == 4.0 && v[1] == 8.0 && v[2] == 12.0, "Multiplication with scalar failed"); -} + { // c * lv + FloatVariableLengthVectorType v = 2 * f; + ASSERT(v[0] == 2.0 && v[1] == 4.0 && v[2] == 6.0, "Multiplication with scalar failed"); + } + { // lv * c + FloatVariableLengthVectorType v = f * 2; + ASSERT(v[0] == 2.0 && v[1] == 4.0 && v[2] == 6.0, "Multiplication with scalar failed"); + } + { // rvref * c + FloatVariableLengthVectorType v = (f + f) * 2; + ASSERT(v[0] == 4.0 && v[1] == 8.0 && v[2] == 12.0, "Multiplication with scalar failed"); + } + { // c * rvref + FloatVariableLengthVectorType v = 2 * (f + f); + ASSERT(v[0] == 4.0 && v[1] == 8.0 && v[2] == 12.0, "Multiplication with scalar failed"); + } -{ // lv / c - FloatVariableLengthVectorType v = f / 2; - ASSERT(v[0] == 0.5 && v[1] == 1.0 && v[2] == 1.5, "Division with scalar failed"); -} -{ // rvref / c - FloatVariableLengthVectorType v = (f + f) / 2; - ASSERT(v[0] == 1.0 && v[1] == 2.0 && v[2] == 3.0, "Division with scalar failed"); -} -} + { // lv / c + FloatVariableLengthVectorType v = f / 2; + ASSERT(v[0] == 0.5 && v[1] == 1.0 && v[2] == 1.5, "Division with scalar failed"); + } + { // rvref / c + FloatVariableLengthVectorType v = (f + f) / 2; + ASSERT(v[0] == 1.0 && v[1] == 2.0 && v[2] == 3.0, "Division with scalar failed"); + } + } -{ // Testing arithmetic operations and on the fly conversions. - { // f[0]=1.0; f[1] = 2.0; f[2] = 3.0; - // g[0]=4.0; g[1] = 5.0; g[2] = 6.0; - // g += f+1 - FloatVariableLengthVectorType v = f + 2 * g; -ASSERT(v[0] == 13.0 && v[1] == 18.0 && v[2] == 23.0, "On-the-fly conversion failed; v=" << v); -} -{ - DoubleVariableLengthVectorType v = f + 2 * g; - ASSERT(v[0] == 13.0 && v[1] == 18.0 && v[2] == 23.0, "On-the-fly conversion failed; v=" << v); -} -} + { // Testing arithmetic operations and on the fly conversions. + { // f[0]=1.0; f[1] = 2.0; f[2] = 3.0; + // g[0]=4.0; g[1] = 5.0; g[2] = 6.0; + // g += f+1 + FloatVariableLengthVectorType v = f + 2 * g; + ASSERT(v[0] == 13.0 && v[1] == 18.0 && v[2] == 23.0, "On-the-fly conversion failed; v=" << v); + } + { + DoubleVariableLengthVectorType v = f + 2 * g; + ASSERT(v[0] == 13.0 && v[1] == 18.0 && v[2] == 23.0, "On-the-fly conversion failed; v=" << v); + } + } -{ - // Testing empty vectors - FloatVariableLengthVectorType v1; - v1.Fill(0); - FloatVariableLengthVectorType v2 = v1; - v1 = v2; + { + // Testing empty vectors + FloatVariableLengthVectorType v1; + v1.Fill(0); + FloatVariableLengthVectorType v2 = v1; + v1 = v2; - FloatVariableLengthVectorType v3, v4; - v1 = 2 * v2 + (v3 - v4) / 6; + FloatVariableLengthVectorType v3, v4; + v1 = 2 * v2 + (v3 - v4) / 6; - v1.SetSize(0, FloatVariableLengthVectorType::DontShrinkToFit(), FloatVariableLengthVectorType::KeepOldValues()); - v1.SetSize(1, FloatVariableLengthVectorType::DontShrinkToFit(), FloatVariableLengthVectorType::KeepOldValues()); -} + v1.SetSize(0, FloatVariableLengthVectorType::DontShrinkToFit(), FloatVariableLengthVectorType::KeepOldValues()); + v1.SetSize(1, FloatVariableLengthVectorType::DontShrinkToFit(), FloatVariableLengthVectorType::KeepOldValues()); + } -std::cout << (result == EXIT_SUCCESS ? "[PASSED]" : "[FAILED]") << std::endl; + std::cout << (result == EXIT_SUCCESS ? "[PASSED]" : "[FAILED]") << std::endl; -return result; + return result; } diff --git a/Modules/Core/GPUCommon/include/itkGPUImage.h b/Modules/Core/GPUCommon/include/itkGPUImage.h index 20b7da43e80..8c00bd7e943 100644 --- a/Modules/Core/GPUCommon/include/itkGPUImage.h +++ b/Modules/Core/GPUCommon/include/itkGPUImage.h @@ -95,9 +95,11 @@ class ITK_TEMPLATE_EXPORT GPUImage : public Image TPixel & GetPixel(const IndexType & index); - const TPixel & operator[](const IndexType & index) const; + const TPixel & + operator[](const IndexType & index) const; - TPixel & operator[](const IndexType & index); + TPixel & + operator[](const IndexType & index); /** Explicit synchronize CPU/GPU buffers */ void diff --git a/Modules/Core/GPUCommon/include/itkGPUImage.hxx b/Modules/Core/GPUCommon/include/itkGPUImage.hxx index a77719489a6..dee1c653311 100644 --- a/Modules/Core/GPUCommon/include/itkGPUImage.hxx +++ b/Modules/Core/GPUCommon/include/itkGPUImage.hxx @@ -107,7 +107,8 @@ GPUImage::GetPixel(const IndexType & index) } template -TPixel & GPUImage::operator[](const IndexType & index) +TPixel & +GPUImage::operator[](const IndexType & index) { /* Original version - very conservative m_DataManager->SetGPUBufferDirty(); @@ -118,7 +119,8 @@ TPixel & GPUImage::operator[](const IndexType & index) } template -const TPixel & GPUImage::operator[](const IndexType & index) const +const TPixel & +GPUImage::operator[](const IndexType & index) const { m_DataManager->UpdateCPUBuffer(); return Superclass::operator[](index); diff --git a/Modules/Core/GPUCommon/include/itkGPUReduction.hxx b/Modules/Core/GPUCommon/include/itkGPUReduction.hxx index 9a4600d4994..99dc55bf9c0 100644 --- a/Modules/Core/GPUCommon/include/itkGPUReduction.hxx +++ b/Modules/Core/GPUCommon/include/itkGPUReduction.hxx @@ -20,7 +20,7 @@ #include "itkMacro.h" -//#define CPU_VERIFY +// #define CPU_VERIFY namespace itk { diff --git a/Modules/Core/GPUCommon/src/itkGPUDataManager.cxx b/Modules/Core/GPUCommon/src/itkGPUDataManager.cxx index 8c1109a9eb9..c03ba5fda42 100644 --- a/Modules/Core/GPUCommon/src/itkGPUDataManager.cxx +++ b/Modules/Core/GPUCommon/src/itkGPUDataManager.cxx @@ -17,7 +17,7 @@ *=========================================================================*/ #include "itkGPUDataManager.h" -//#define VERBOSE +// #define VERBOSE namespace itk { diff --git a/Modules/Core/GPUCommon/test/itkGPUImageTest.cxx b/Modules/Core/GPUCommon/test/itkGPUImageTest.cxx index 66c489f35fb..a746eb5d472 100644 --- a/Modules/Core/GPUCommon/test/itkGPUImageTest.cxx +++ b/Modules/Core/GPUCommon/test/itkGPUImageTest.cxx @@ -20,7 +20,7 @@ * Test program for itkGPUImage class. * This program shows how to use GPU image and GPU program. */ -//#include "pathToOpenCLSourceCode.h" +// #include "pathToOpenCLSourceCode.h" #include "itkGPUImage.h" #include "itkGPUKernelManager.h" #include "itkGPUContextManager.h" diff --git a/Modules/Core/GPUCommon/test/itkGPUReductionTest.cxx b/Modules/Core/GPUCommon/test/itkGPUReductionTest.cxx index da3032a0d5b..55aa6107997 100644 --- a/Modules/Core/GPUCommon/test/itkGPUReductionTest.cxx +++ b/Modules/Core/GPUCommon/test/itkGPUReductionTest.cxx @@ -20,7 +20,7 @@ * Test program for itkGPUImage class. * This program shows how to use GPU image and GPU program. */ -//#include "pathToOpenCLSourceCode.h" +// #include "pathToOpenCLSourceCode.h" #include "itkGPUImage.h" #include "itkGPUReduction.h" diff --git a/Modules/Core/ImageAdaptors/include/itkImageAdaptor.h b/Modules/Core/ImageAdaptors/include/itkImageAdaptor.h index 37bd325028e..97751c8614f 100644 --- a/Modules/Core/ImageAdaptors/include/itkImageAdaptor.h +++ b/Modules/Core/ImageAdaptors/include/itkImageAdaptor.h @@ -224,7 +224,11 @@ class ITK_TEMPLATE_EXPORT ImageAdaptor : public ImageBaseGetPixel(index)); } + PixelType + operator[](const IndexType & index) const + { + return m_PixelAccessor.Get(m_Image->GetPixel(index)); + } /** Get the OffsetTable from the adapted image */ const OffsetValueType * diff --git a/Modules/Core/ImageFunction/include/itkBSplineInterpolateImageFunction.hxx b/Modules/Core/ImageFunction/include/itkBSplineInterpolateImageFunction.hxx index 0e440ff3134..3e69dd124dc 100644 --- a/Modules/Core/ImageFunction/include/itkBSplineInterpolateImageFunction.hxx +++ b/Modules/Core/ImageFunction/include/itkBSplineInterpolateImageFunction.hxx @@ -179,8 +179,7 @@ BSplineInterpolateImageFunction::SetInt switch (splineOrder) { - case 3: - { + case 3: { for (unsigned int n = 0; n < ImageDimension; ++n) { w = x[n] - static_cast(EvaluateIndex[n][1]); @@ -191,16 +190,14 @@ BSplineInterpolateImageFunction::SetInt } break; } - case 0: - { + case 0: { for (unsigned int n = 0; n < ImageDimension; ++n) { weights[n][0] = 1; // implements nearest neighbor } break; } - case 1: - { + case 1: { for (unsigned int n = 0; n < ImageDimension; ++n) { w = x[n] - static_cast(EvaluateIndex[n][0]); @@ -209,8 +206,7 @@ BSplineInterpolateImageFunction::SetInt } break; } - case 2: - { + case 2: { for (unsigned int n = 0; n < ImageDimension; ++n) { /* x */ @@ -221,8 +217,7 @@ BSplineInterpolateImageFunction::SetInt } break; } - case 4: - { + case 4: { for (unsigned int n = 0; n < ImageDimension; ++n) { /* x */ @@ -241,8 +236,7 @@ BSplineInterpolateImageFunction::SetInt } break; } - case 5: - { + case 5: { for (unsigned int n = 0; n < ImageDimension; ++n) { /* x */ @@ -265,8 +259,7 @@ BSplineInterpolateImageFunction::SetInt } break; } - default: - { + default: { // SplineOrder not implemented yet. ExceptionObject err(__FILE__, __LINE__); err.SetLocation(ITK_LOCATION); @@ -298,8 +291,7 @@ BSplineInterpolateImageFunction::SetDer { // Calculates B(splineOrder) ( (x + 1/2) - xi) - // B(splineOrder -1)( (x - 1/2) - xi) - case -1: - { + case -1: { // Why would we want to do this? for (unsigned int n = 0; n < ImageDimension; ++n) { @@ -307,8 +299,7 @@ BSplineInterpolateImageFunction::SetDer } break; } - case 0: - { + case 0: { for (unsigned int n = 0; n < ImageDimension; ++n) { weights[n][0] = -1.0; @@ -316,8 +307,7 @@ BSplineInterpolateImageFunction::SetDer } break; } - case 1: - { + case 1: { for (unsigned int n = 0; n < ImageDimension; ++n) { w = x[n] + 0.5 - static_cast(EvaluateIndex[n][1]); @@ -330,8 +320,7 @@ BSplineInterpolateImageFunction::SetDer } break; } - case 2: - { + case 2: { for (unsigned int n = 0; n < ImageDimension; ++n) { w = x[n] + .5 - static_cast(EvaluateIndex[n][2]); @@ -346,8 +335,7 @@ BSplineInterpolateImageFunction::SetDer } break; } - case 3: - { + case 3: { for (unsigned int n = 0; n < ImageDimension; ++n) { w = x[n] + 0.5 - static_cast(EvaluateIndex[n][2]); @@ -364,8 +352,7 @@ BSplineInterpolateImageFunction::SetDer } break; } - case 4: - { + case 4: { for (unsigned int n = 0; n < ImageDimension; ++n) { w = x[n] + .5 - static_cast(EvaluateIndex[n][3]); @@ -390,8 +377,7 @@ BSplineInterpolateImageFunction::SetDer } break; } - default: - { + default: { // SplineOrder not implemented yet. ExceptionObject err(__FILE__, __LINE__); err.SetLocation(ITK_LOCATION); diff --git a/Modules/Core/ImageFunction/include/itkRayCastInterpolateImageFunction.hxx b/Modules/Core/ImageFunction/include/itkRayCastInterpolateImageFunction.hxx index 497f2e8b698..e080764cbce 100644 --- a/Modules/Core/ImageFunction/include/itkRayCastInterpolateImageFunction.hxx +++ b/Modules/Core/ImageFunction/include/itkRayCastInterpolateImageFunction.hxx @@ -1060,8 +1060,7 @@ RayCastInterpolateImageFunction::RayCastHelper::Initiali switch (m_TraversalDirection) { - case TraversalDirectionEnum::TRANSVERSE_IN_X: - { + case TraversalDirectionEnum::TRANSVERSE_IN_X: { if ((Ix >= 0) && (Ix < m_NumberOfVoxelsInX) && (Iy >= 0) && (Iy + 1 < m_NumberOfVoxelsInY) && (Iz >= 0) && (Iz + 1 < m_NumberOfVoxelsInZ)) { @@ -1093,8 +1092,7 @@ RayCastInterpolateImageFunction::RayCastHelper::Initiali break; } - case TraversalDirectionEnum::TRANSVERSE_IN_Y: - { + case TraversalDirectionEnum::TRANSVERSE_IN_Y: { if ((Ix >= 0) && (Ix + 1 < m_NumberOfVoxelsInX) && (Iy >= 0) && (Iy < m_NumberOfVoxelsInY) && (Iz >= 0) && (Iz + 1 < m_NumberOfVoxelsInZ)) { @@ -1126,8 +1124,7 @@ RayCastInterpolateImageFunction::RayCastHelper::Initiali break; } - case TraversalDirectionEnum::TRANSVERSE_IN_Z: - { + case TraversalDirectionEnum::TRANSVERSE_IN_Z: { if ((Ix >= 0) && (Ix + 1 < m_NumberOfVoxelsInX) && (Iy >= 0) && (Iy + 1 < m_NumberOfVoxelsInY) && (Iz >= 0) && (Iz < m_NumberOfVoxelsInZ)) { @@ -1159,8 +1156,7 @@ RayCastInterpolateImageFunction::RayCastHelper::Initiali break; } - default: - { + default: { itk::ExceptionObject err(__FILE__, __LINE__); err.SetLocation(ITK_LOCATION); err.SetDescription("The ray traversal direction is unset " @@ -1224,26 +1220,22 @@ RayCastInterpolateImageFunction::RayCastHelper::GetCurre switch (m_TraversalDirection) { - case TraversalDirectionEnum::TRANSVERSE_IN_X: - { + case TraversalDirectionEnum::TRANSVERSE_IN_X: { y = m_Position3Dvox[1].GetSum() - std::floor(m_Position3Dvox[1].GetSum()); z = m_Position3Dvox[2].GetSum() - std::floor(m_Position3Dvox[2].GetSum()); break; } - case TraversalDirectionEnum::TRANSVERSE_IN_Y: - { + case TraversalDirectionEnum::TRANSVERSE_IN_Y: { y = m_Position3Dvox[0].GetSum() - std::floor(m_Position3Dvox[0].GetSum()); z = m_Position3Dvox[2].GetSum() - std::floor(m_Position3Dvox[2].GetSum()); break; } - case TraversalDirectionEnum::TRANSVERSE_IN_Z: - { + case TraversalDirectionEnum::TRANSVERSE_IN_Z: { y = m_Position3Dvox[0].GetSum() - std::floor(m_Position3Dvox[0].GetSum()); z = m_Position3Dvox[1].GetSum() - std::floor(m_Position3Dvox[1].GetSum()); break; } - default: - { + default: { itk::ExceptionObject err(__FILE__, __LINE__); err.SetLocation(ITK_LOCATION); err.SetDescription("The ray traversal direction is unset " diff --git a/Modules/Core/ImageFunction/test/itkBSplineInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkBSplineInterpolateImageFunctionTest.cxx index 2eb46b82f29..54327f01426 100644 --- a/Modules/Core/ImageFunction/test/itkBSplineInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkBSplineInterpolateImageFunctionTest.cxx @@ -697,9 +697,9 @@ set1DInterpData(ImageType1D::Pointer imgPtr) SizeType1D size = { { 36 } }; double mydata[36] = { 454.0000, 369.4000, 295.2000, 230.8000, 175.6000, 129.0000, 90.4000, 59.2000, 34.8000, - 16.6000, 4.0000, -3.6000, -6.8000, -6.2000, -2.4000, 4.0000, 12.4000, 22.2000, - 32.8000, 43.6000, 54.0000, 63.4000, 71.2000, 76.8000, 79.6000, 79.0000, 74.4000, - 65.2000, 50.8000, 30.6000, 4.0000, -29.6000, -70.8000, -120.2000, -178.4000, -246.0000 }; + 16.6000, 4.0000, -3.6000, -6.8000, -6.2000, -2.4000, 4.0000, 12.4000, 22.2000, + 32.8000, 43.6000, 54.0000, 63.4000, 71.2000, 76.8000, 79.6000, 79.0000, 74.4000, + 65.2000, 50.8000, 30.6000, 4.0000, -29.6000, -70.8000, -120.2000, -178.4000, -246.0000 }; ImageType1D::RegionType region; region.SetSize(size); diff --git a/Modules/Core/ImageFunction/test/itkLabelImageGaussianInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkLabelImageGaussianInterpolateImageFunctionTest.cxx index fcfcc023858..80207be067a 100644 --- a/Modules/Core/ImageFunction/test/itkLabelImageGaussianInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkLabelImageGaussianInterpolateImageFunctionTest.cxx @@ -106,9 +106,9 @@ itkLabelImageGaussianInterpolateImageFunctionTest(int, char *[]) std::cerr << "Parameters were not returned correctly." << std::endl; } - //######################## - // Now check the results - // The ImageSizeToCompute + // ######################## + // Now check the results + // The ImageSizeToCompute constexpr unsigned char default_background_value = 17; const itk::IndexValueType large_xSize = 5 + 1; constexpr itk::IndexValueType large_ySize = 5; diff --git a/Modules/Core/Mesh/include/itkAutomaticTopologyMeshSource.hxx b/Modules/Core/Mesh/include/itkAutomaticTopologyMeshSource.hxx index 85f394774f5..cce57a4c1af 100644 --- a/Modules/Core/Mesh/include/itkAutomaticTopologyMeshSource.hxx +++ b/Modules/Core/Mesh/include/itkAutomaticTopologyMeshSource.hxx @@ -570,8 +570,9 @@ AutomaticTopologyMeshSource::AddLine(const PointType & p0, const Po template auto -AutomaticTopologyMeshSource::AddTriangle(const PointType & p0, const PointType & p1, const PointType & p2) - -> IdentifierType +AutomaticTopologyMeshSource::AddTriangle(const PointType & p0, + const PointType & p1, + const PointType & p2) -> IdentifierType { Array pointIDs(3); pointIDs[0] = AddPoint(p0); @@ -644,8 +645,8 @@ AutomaticTopologyMeshSource::AddVertex(const CoordinateType * p0) - template auto -AutomaticTopologyMeshSource::AddLine(const CoordinateType * p0, const CoordinateType * p1) - -> IdentifierType +AutomaticTopologyMeshSource::AddLine(const CoordinateType * p0, + const CoordinateType * p1) -> IdentifierType { Array pointIDs(2); pointIDs[0] = AddPoint(p0); diff --git a/Modules/Core/Mesh/include/itkConnectedRegionsMeshFilter.hxx b/Modules/Core/Mesh/include/itkConnectedRegionsMeshFilter.hxx index 266342ed2b0..1d2dd562320 100644 --- a/Modules/Core/Mesh/include/itkConnectedRegionsMeshFilter.hxx +++ b/Modules/Core/Mesh/include/itkConnectedRegionsMeshFilter.hxx @@ -440,7 +440,7 @@ ConnectedRegionsMeshFilter::PropagateConnectedWave() } } } // if visited - } // for all cells in wave + } // for all cells in wave tmpWave = m_Wave; m_Wave = m_Wave2; diff --git a/Modules/Core/Mesh/include/itkImageToMeshFilter.hxx b/Modules/Core/Mesh/include/itkImageToMeshFilter.hxx index dd52325c777..095d282a49a 100644 --- a/Modules/Core/Mesh/include/itkImageToMeshFilter.hxx +++ b/Modules/Core/Mesh/include/itkImageToMeshFilter.hxx @@ -38,7 +38,8 @@ ImageToMeshFilter::ImageToMeshFilter() * Make Output */ template -DataObject::Pointer ImageToMeshFilter::MakeOutput(DataObjectPointerArraySizeType) +DataObject::Pointer +ImageToMeshFilter::MakeOutput(DataObjectPointerArraySizeType) { OutputMeshPointer outputMesh = OutputMeshType::New(); diff --git a/Modules/Core/Mesh/include/itkMesh.hxx b/Modules/Core/Mesh/include/itkMesh.hxx index 55415d0ff45..6ea89f76589 100644 --- a/Modules/Core/Mesh/include/itkMesh.hxx +++ b/Modules/Core/Mesh/include/itkMesh.hxx @@ -743,8 +743,8 @@ Mesh::GetCellBoundaryFeatureNeighbors(int */ template auto -Mesh::GetCellNeighbors(CellIdentifier cellId, std::set * cellSet) - -> CellIdentifier +Mesh::GetCellNeighbors(CellIdentifier cellId, + std::set * cellSet) -> CellIdentifier { /** * Sanity check on mesh status. @@ -1014,22 +1014,19 @@ Mesh::ReleaseCellsMemory() { switch (m_CellsAllocationMethod) { - case MeshClassCellsAllocationMethodEnum::CellsAllocationMethodUndefined: - { + case MeshClassCellsAllocationMethodEnum::CellsAllocationMethodUndefined: { // The user forgot to tell the mesh about how he allocated // the cells. No responsible guess can be made here. Call for help. itkGenericExceptionMacro("Cells Allocation Method was not specified. See SetCellsAllocationMethod()"); break; } - case MeshEnums::MeshClassCellsAllocationMethod::CellsAllocatedAsStaticArray: - { + case MeshEnums::MeshClassCellsAllocationMethod::CellsAllocatedAsStaticArray: { // The cells will be naturally destroyed when // the original array goes out of scope. itkDebugMacro("CellsAllocatedAsStaticArray "); break; } - case MeshEnums::MeshClassCellsAllocationMethod::CellsAllocatedAsADynamicArray: - { + case MeshEnums::MeshClassCellsAllocationMethod::CellsAllocatedAsADynamicArray: { // the pointer to the first Cell is assumed to be the // base pointer of the array CellsContainerIterator first = m_CellsContainer->Begin(); @@ -1039,8 +1036,7 @@ Mesh::ReleaseCellsMemory() itkDebugMacro("CellsAllocatedAsADynamicArray"); break; } - case MeshEnums::MeshClassCellsAllocationMethod::CellsAllocatedDynamicallyCellByCell: - { + case MeshEnums::MeshClassCellsAllocationMethod::CellsAllocatedDynamicallyCellByCell: { itkDebugMacro("CellsAllocatedDynamicallyCellByCell start"); // It is assumed that every cell was allocated independently. // A Cell iterator is created for going through the cells diff --git a/Modules/Core/Mesh/include/itkMeshSource.hxx b/Modules/Core/Mesh/include/itkMeshSource.hxx index b19e4e53ff2..3160b3b6641 100644 --- a/Modules/Core/Mesh/include/itkMeshSource.hxx +++ b/Modules/Core/Mesh/include/itkMeshSource.hxx @@ -37,7 +37,8 @@ MeshSource::MeshSource() } template -typename MeshSource::DataObjectPointer MeshSource::MakeOutput(DataObjectPointerArraySizeType) +typename MeshSource::DataObjectPointer +MeshSource::MakeOutput(DataObjectPointerArraySizeType) { return TOutputMesh::New().GetPointer(); } diff --git a/Modules/Core/Mesh/include/itkSimplexMesh.hxx b/Modules/Core/Mesh/include/itkSimplexMesh.hxx index 0fe9221c08b..e7efc1ca14b 100644 --- a/Modules/Core/Mesh/include/itkSimplexMesh.hxx +++ b/Modules/Core/Mesh/include/itkSimplexMesh.hxx @@ -175,8 +175,8 @@ SimplexMesh::GetDistance(PointIdentifier id template auto -SimplexMesh::AddEdge(PointIdentifier startPointId, PointIdentifier endPointId) - -> CellIdentifier +SimplexMesh::AddEdge(PointIdentifier startPointId, + PointIdentifier endPointId) -> CellIdentifier { CellAutoPointer NewCellPointer(new LineType, true); CellIdentifier edgeId = m_LastCellId; diff --git a/Modules/Core/Mesh/include/itkTriangleMeshToBinaryImageFilter.hxx b/Modules/Core/Mesh/include/itkTriangleMeshToBinaryImageFilter.hxx index b4d4c7ed309..e40e1c9bbb8 100644 --- a/Modules/Core/Mesh/include/itkTriangleMeshToBinaryImageFilter.hxx +++ b/Modules/Core/Mesh/include/itkTriangleMeshToBinaryImageFilter.hxx @@ -376,8 +376,7 @@ TriangleMeshToBinaryImageFilter::RasterizeTriangles() case CellGeometryEnum::LINE_CELL: break; case CellGeometryEnum::TRIANGLE_CELL: - case CellGeometryEnum::POLYGON_CELL: - { + case CellGeometryEnum::POLYGON_CELL: { coords.clear(); while (pointIt != nextCell->PointIdsEnd()) { diff --git a/Modules/Core/QuadEdgeMesh/include/itkQuadEdge.h b/Modules/Core/QuadEdgeMesh/include/itkQuadEdge.h index 3373d0d8320..ab4e51b13b0 100644 --- a/Modules/Core/QuadEdgeMesh/include/itkQuadEdge.h +++ b/Modules/Core/QuadEdgeMesh/include/itkQuadEdge.h @@ -52,65 +52,155 @@ * @param dt Dual edge type. * \todo Should this macro be added to doxygen macros? */ -#define itkQEAccessorsMacro(st, pt, dt) \ - pt * GetOnext() { return (dynamic_cast(this->st::GetOnext())); } \ - \ - dt * GetRot() { return (dynamic_cast
(this->st::GetRot())); } \ - \ - pt * GetSym() { return (dynamic_cast(this->st::GetSym())); } \ - \ - pt * GetLnext() { return (dynamic_cast(this->st::GetLnext())); } \ - \ - pt * GetRnext() { return (dynamic_cast(this->st::GetRnext())); } \ - \ - pt * GetDnext() { return (dynamic_cast(this->st::GetDnext())); } \ - \ - pt * GetOprev() { return (dynamic_cast(this->st::GetOprev())); } \ - \ - pt * GetLprev() { return (dynamic_cast(this->st::GetLprev())); } \ - \ - pt * GetRprev() { return (dynamic_cast(this->st::GetRprev())); } \ - \ - pt * GetDprev() { return (dynamic_cast(this->st::GetDprev())); } \ - \ - dt * GetInvRot() { return (dynamic_cast
(this->st::GetInvRot())); } \ - \ - pt * GetInvOnext() { return (dynamic_cast(this->st::GetInvOnext())); } \ - \ - pt * GetInvLnext() { return (dynamic_cast(this->st::GetInvLnext())); } \ - \ - pt * GetInvRnext() { return (dynamic_cast(this->st::GetInvRnext())); } \ - \ - pt * GetInvDnext() { return (dynamic_cast(this->st::GetInvDnext())); } \ - const pt * GetOnext() const { return (dynamic_cast(this->st::GetOnext())); } \ - \ - const dt * GetRot() const { return (dynamic_cast(this->st::GetRot())); } \ - \ - const pt * GetSym() const { return (dynamic_cast(this->st::GetSym())); } \ - \ - const pt * GetLnext() const { return (dynamic_cast(this->st::GetLnext())); } \ - \ - const pt * GetRnext() const { return (dynamic_cast(this->st::GetRnext())); } \ - \ - const pt * GetDnext() const { return (dynamic_cast(this->st::GetDnext())); } \ - \ - const pt * GetOprev() const { return (dynamic_cast(this->st::GetOprev())); } \ - \ - const pt * GetLprev() const { return (dynamic_cast(this->st::GetLprev())); } \ - \ - const pt * GetRprev() const { return (dynamic_cast(this->st::GetRprev())); } \ - \ - const pt * GetDprev() const { return (dynamic_cast(this->st::GetDprev())); } \ - \ - const dt * GetInvRot() const { return (dynamic_cast(this->st::GetInvRot())); } \ - \ - const pt * GetInvOnext() const { return (dynamic_cast(this->st::GetInvOnext())); } \ - \ - const pt * GetInvLnext() const { return (dynamic_cast(this->st::GetInvLnext())); } \ - \ - const pt * GetInvRnext() const { return (dynamic_cast(this->st::GetInvRnext())); } \ - \ - const pt * GetInvDnext() const { return (dynamic_cast(this->st::GetInvDnext())); } +#define itkQEAccessorsMacro(st, pt, dt) \ + pt * GetOnext() \ + { \ + return (dynamic_cast(this->st::GetOnext())); \ + } \ + \ + dt * GetRot() \ + { \ + return (dynamic_cast
(this->st::GetRot())); \ + } \ + \ + pt * GetSym() \ + { \ + return (dynamic_cast(this->st::GetSym())); \ + } \ + \ + pt * GetLnext() \ + { \ + return (dynamic_cast(this->st::GetLnext())); \ + } \ + \ + pt * GetRnext() \ + { \ + return (dynamic_cast(this->st::GetRnext())); \ + } \ + \ + pt * GetDnext() \ + { \ + return (dynamic_cast(this->st::GetDnext())); \ + } \ + \ + pt * GetOprev() \ + { \ + return (dynamic_cast(this->st::GetOprev())); \ + } \ + \ + pt * GetLprev() \ + { \ + return (dynamic_cast(this->st::GetLprev())); \ + } \ + \ + pt * GetRprev() \ + { \ + return (dynamic_cast(this->st::GetRprev())); \ + } \ + \ + pt * GetDprev() \ + { \ + return (dynamic_cast(this->st::GetDprev())); \ + } \ + \ + dt * GetInvRot() \ + { \ + return (dynamic_cast
(this->st::GetInvRot())); \ + } \ + \ + pt * GetInvOnext() \ + { \ + return (dynamic_cast(this->st::GetInvOnext())); \ + } \ + \ + pt * GetInvLnext() \ + { \ + return (dynamic_cast(this->st::GetInvLnext())); \ + } \ + \ + pt * GetInvRnext() \ + { \ + return (dynamic_cast(this->st::GetInvRnext())); \ + } \ + \ + pt * GetInvDnext() \ + { \ + return (dynamic_cast(this->st::GetInvDnext())); \ + } \ + const pt * GetOnext() const \ + { \ + return (dynamic_cast(this->st::GetOnext())); \ + } \ + \ + const dt * GetRot() const \ + { \ + return (dynamic_cast(this->st::GetRot())); \ + } \ + \ + const pt * GetSym() const \ + { \ + return (dynamic_cast(this->st::GetSym())); \ + } \ + \ + const pt * GetLnext() const \ + { \ + return (dynamic_cast(this->st::GetLnext())); \ + } \ + \ + const pt * GetRnext() const \ + { \ + return (dynamic_cast(this->st::GetRnext())); \ + } \ + \ + const pt * GetDnext() const \ + { \ + return (dynamic_cast(this->st::GetDnext())); \ + } \ + \ + const pt * GetOprev() const \ + { \ + return (dynamic_cast(this->st::GetOprev())); \ + } \ + \ + const pt * GetLprev() const \ + { \ + return (dynamic_cast(this->st::GetLprev())); \ + } \ + \ + const pt * GetRprev() const \ + { \ + return (dynamic_cast(this->st::GetRprev())); \ + } \ + \ + const pt * GetDprev() const \ + { \ + return (dynamic_cast(this->st::GetDprev())); \ + } \ + \ + const dt * GetInvRot() const \ + { \ + return (dynamic_cast(this->st::GetInvRot())); \ + } \ + \ + const pt * GetInvOnext() const \ + { \ + return (dynamic_cast(this->st::GetInvOnext())); \ + } \ + \ + const pt * GetInvLnext() const \ + { \ + return (dynamic_cast(this->st::GetInvLnext())); \ + } \ + \ + const pt * GetInvRnext() const \ + { \ + return (dynamic_cast(this->st::GetInvRnext())); \ + } \ + \ + const pt * GetInvDnext() const \ + { \ + return (dynamic_cast(this->st::GetInvDnext())); \ + } namespace itk { diff --git a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMesh.hxx b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMesh.hxx index 6a5e5ece172..522998990c1 100644 --- a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMesh.hxx +++ b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMesh.hxx @@ -622,8 +622,8 @@ QuadEdgeMesh::FindFirstUnusedCellIndex() -> CellIde */ template auto -QuadEdgeMesh::AddEdge(const PointIdentifier & orgPid, const PointIdentifier & destPid) - -> QEPrimal * +QuadEdgeMesh::AddEdge(const PointIdentifier & orgPid, + const PointIdentifier & destPid) -> QEPrimal * { // Make sure the points are different if (orgPid == destPid) @@ -1116,8 +1116,8 @@ QuadEdgeMesh::FindEdge(const PointIdentifier & pid0 */ template auto -QuadEdgeMesh::FindEdge(const PointIdentifier & pid0, const PointIdentifier & pid1) const - -> QEPrimal * +QuadEdgeMesh::FindEdge(const PointIdentifier & pid0, + const PointIdentifier & pid1) const -> QEPrimal * { QEPrimal * initialEdge = this->GetPoint(pid0).GetEdge(); @@ -1237,8 +1237,8 @@ QuadEdgeMesh::AddFaceWithSecurePointList(const Poin */ template auto -QuadEdgeMesh::AddFaceWithSecurePointList(const PointIdList & points, bool CheckEdges) - -> QEPrimal * +QuadEdgeMesh::AddFaceWithSecurePointList(const PointIdList & points, + bool CheckEdges) -> QEPrimal * { const auto numberOfPoints = static_cast(points.size()); diff --git a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshBaseIterator.h b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshBaseIterator.h index 0e32f3862ee..a8cfb3702fc 100644 --- a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshBaseIterator.h +++ b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshBaseIterator.h @@ -21,31 +21,49 @@ #include "itkMacro.h" // ------------------------------------------------------------------------- -#define itkQEDefineIteratorMethodsMacro(Op) \ - virtual Iterator Begin##Op() { return Iterator(this, Self::Iterator::Operator##Op, true); } \ - \ - virtual ConstIterator Begin##Op() const { return ConstIterator(this, Self::ConstIterator::Operator##Op, true); } \ - \ - virtual Iterator End##Op() { return Iterator(this, Self::Iterator::Operator##Op, false); } \ - \ - virtual ConstIterator End##Op() const { return ConstIterator(this, Self::ConstIterator::Operator##Op, false); } \ +#define itkQEDefineIteratorMethodsMacro(Op) \ + virtual Iterator Begin##Op() \ + { \ + return Iterator(this, Self::Iterator::Operator##Op, true); \ + } \ + \ + virtual ConstIterator Begin##Op() const \ + { \ + return ConstIterator(this, Self::ConstIterator::Operator##Op, true); \ + } \ + \ + virtual Iterator End##Op() \ + { \ + return Iterator(this, Self::Iterator::Operator##Op, false); \ + } \ + \ + virtual ConstIterator End##Op() const \ + { \ + return ConstIterator(this, Self::ConstIterator::Operator##Op, false); \ + } \ ITK_MACROEND_NOOP_STATEMENT // ------------------------------------------------------------------------- -#define itkQEDefineIteratorGeomMethodsMacro(Op) \ - virtual IteratorGeom BeginGeom##Op() { return IteratorGeom(this, Self::IteratorGeom::Operator##Op, true); } \ - \ - virtual ConstIteratorGeom BeginGeom##Op() const \ - { \ - return ConstIteratorGeom(this, Self::ConstIteratorGeom::Operator##Op, true); \ - } \ - \ - virtual IteratorGeom EndGeom##Op() { return IteratorGeom(this, Self::IteratorGeom::Operator##Op, false); } \ - \ - virtual ConstIteratorGeom EndGeom##Op() const \ - { \ - return ConstIteratorGeom(this, Self::ConstIteratorGeom::Operator##Op, false); \ - } \ +#define itkQEDefineIteratorGeomMethodsMacro(Op) \ + virtual IteratorGeom BeginGeom##Op() \ + { \ + return IteratorGeom(this, Self::IteratorGeom::Operator##Op, true); \ + } \ + \ + virtual ConstIteratorGeom BeginGeom##Op() const \ + { \ + return ConstIteratorGeom(this, Self::ConstIteratorGeom::Operator##Op, true); \ + } \ + \ + virtual IteratorGeom EndGeom##Op() \ + { \ + return IteratorGeom(this, Self::IteratorGeom::Operator##Op, false); \ + } \ + \ + virtual ConstIteratorGeom EndGeom##Op() const \ + { \ + return ConstIteratorGeom(this, Self::ConstIteratorGeom::Operator##Op, false); \ + } \ ITK_MACROEND_NOOP_STATEMENT namespace itk @@ -283,7 +301,11 @@ class ITK_TEMPLATE_EXPORT QuadEdgeMeshIteratorGeom : public QuadEdgeMeshIterator QuadEdgeMeshIteratorGeom(const QuadEdgeMeshIteratorGeom &) = default; - OriginRefType operator*() { return (this->m_Iterator->GetOrigin()); } + OriginRefType + operator*() + { + return (this->m_Iterator->GetOrigin()); + } }; /** @@ -371,7 +393,11 @@ class ITK_TEMPLATE_EXPORT QuadEdgeMeshConstIteratorGeom : public QuadEdgeMeshCon return (*this); } - const OriginRefType operator*() const { return (this->m_Iterator->GetOrigin()); } + const OriginRefType + operator*() const + { + return (this->m_Iterator->GetOrigin()); + } }; } // namespace itk diff --git a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorFlipEdgeFunction.h b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorFlipEdgeFunction.h index c4701099318..6919fee60f4 100644 --- a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorFlipEdgeFunction.h +++ b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorFlipEdgeFunction.h @@ -49,7 +49,7 @@ class QuadEdgeMeshEulerOperatorFlipEdgeFunctionEnums }; // Define how to print enumerations extern ITKQuadEdgeMesh_EXPORT std::ostream & - operator<<(std::ostream & out, QuadEdgeMeshEulerOperatorFlipEdgeFunctionEnums::EdgeStatusType value); +operator<<(std::ostream & out, QuadEdgeMeshEulerOperatorFlipEdgeFunctionEnums::EdgeStatusType value); /** * \class QuadEdgeMeshEulerOperatorFlipEdgeFunction diff --git a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshFrontIterator.h b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshFrontIterator.h index 5d81a5ca8cb..4d5d9b283f1 100644 --- a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshFrontIterator.h +++ b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshFrontIterator.h @@ -21,41 +21,56 @@ #include "itkMapContainer.h" // ------------------------------------------------------------------------- -#define itkQEDefineFrontIteratorMethodsMacro(MeshTypeArg) \ - /* Dual definition placed before others because of .NET that cannot */ \ - /* cope with definition of FrontIterator (that further hides the */ \ - /* definition of the template). */ \ - using QEDualType = typename MeshTypeArg::QEDual; \ - using QEPrimalType = typename MeshTypeArg::QEPrimal; \ - using FrontDualIterator = QuadEdgeMeshFrontIterator; \ - using ConstFrontDualIterator = QuadEdgeMeshConstFrontIterator; \ - using FrontIterator = QuadEdgeMeshFrontIterator; \ - using ConstFrontIterator = QuadEdgeMeshConstFrontIterator; \ - \ - virtual FrontIterator BeginFront(QEPrimalType * seed = (QEPrimalType *)0) \ - { \ - return (FrontIterator(this, true, seed)); \ - } \ - \ - virtual ConstFrontIterator BeginFront(QEPrimalType * seed) const { return (ConstFrontIterator(this, true, seed)); } \ - \ - virtual FrontIterator EndFront() { return (FrontIterator(this, false)); } \ - \ - virtual ConstFrontIterator EndFront() const { return (ConstFrontIterator(this, false)); } \ - \ - virtual FrontDualIterator BeginDualFront(QEDualType * seed = (QEDualType *)0) \ - { \ - return (FrontDualIterator(this, true, seed)); \ - } \ - \ - virtual ConstFrontDualIterator BeginDualFront(QEDualType * seed) const \ - { \ - return (ConstFrontDualIterator(this, true, seed)); \ - } \ - \ - virtual FrontDualIterator EndDualFront() { return (FrontDualIterator(this, false)); } \ - \ - virtual ConstFrontDualIterator EndDualFront() const { return (ConstFrontDualIterator(this, false)); } +#define itkQEDefineFrontIteratorMethodsMacro(MeshTypeArg) \ + /* Dual definition placed before others because of .NET that cannot */ \ + /* cope with definition of FrontIterator (that further hides the */ \ + /* definition of the template). */ \ + using QEDualType = typename MeshTypeArg::QEDual; \ + using QEPrimalType = typename MeshTypeArg::QEPrimal; \ + using FrontDualIterator = QuadEdgeMeshFrontIterator; \ + using ConstFrontDualIterator = QuadEdgeMeshConstFrontIterator; \ + using FrontIterator = QuadEdgeMeshFrontIterator; \ + using ConstFrontIterator = QuadEdgeMeshConstFrontIterator; \ + \ + virtual FrontIterator BeginFront(QEPrimalType * seed = (QEPrimalType *)0) \ + { \ + return (FrontIterator(this, true, seed)); \ + } \ + \ + virtual ConstFrontIterator BeginFront(QEPrimalType * seed) const \ + { \ + return (ConstFrontIterator(this, true, seed)); \ + } \ + \ + virtual FrontIterator EndFront() \ + { \ + return (FrontIterator(this, false)); \ + } \ + \ + virtual ConstFrontIterator EndFront() const \ + { \ + return (ConstFrontIterator(this, false)); \ + } \ + \ + virtual FrontDualIterator BeginDualFront(QEDualType * seed = (QEDualType *)0) \ + { \ + return (FrontDualIterator(this, true, seed)); \ + } \ + \ + virtual ConstFrontDualIterator BeginDualFront(QEDualType * seed) const \ + { \ + return (ConstFrontDualIterator(this, true, seed)); \ + } \ + \ + virtual FrontDualIterator EndDualFront() \ + { \ + return (FrontDualIterator(this, false)); \ + } \ + \ + virtual ConstFrontDualIterator EndDualFront() const \ + { \ + return (ConstFrontDualIterator(this, false)); \ + } namespace itk { diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshBasicLayerTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshBasicLayerTest.cxx index efcab2ba58c..373143d0070 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshBasicLayerTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshBasicLayerTest.cxx @@ -105,7 +105,7 @@ itkQuadEdgeMeshBasicLayerTest(int, char *[]) std::cout << "IsOriginSet() nullptr value failed for edge number " << i << ". Failed" << std::endl; return EXIT_FAILURE; } // fi - } // rof + } // rof std::cout << "Passed" << std::endl; ////////////////////////////////////////////////////////// @@ -136,7 +136,7 @@ itkQuadEdgeMeshBasicLayerTest(int, char *[]) << e[i]->GetDestination() << ". Failed" << std::endl; return EXIT_FAILURE; } // fi - } // rof + } // rof std::cout << "Passed" << std::endl; ////////////////////////////////////////////////////////// diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshIteratorTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshIteratorTest.cxx index 1122095e0a1..073dffc63f1 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshIteratorTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshIteratorTest.cxx @@ -50,7 +50,7 @@ itkQuadEdgeMeshIteratorTest(int, char *[]) #define NumEdges 6 MeshType::PixelType a = std::sqrt(3.0) / 2.0; MeshType::PixelType points[NumPoints][3] = { { 1.0, 0.0, 0.0 }, { 0.5, a, 0.0 }, { -0.5, a, 0.0 }, - { -1.0, 0.0, 0.0 }, { -0.5, -a, 0.0 }, { 0.5, -a, 0.0 } }; + { -1.0, 0.0, 0.0 }, { -0.5, -a, 0.0 }, { 0.5, -a, 0.0 } }; MeshType::PointType pnts[NumPoints]; MeshType::PointIdentifier pids[NumPoints]; for (int i = 0; i < NumPoints; ++i) diff --git a/Modules/Core/SpatialObjects/include/itkDTITubeSpatialObjectPoint.h b/Modules/Core/SpatialObjects/include/itkDTITubeSpatialObjectPoint.h index a22a14e2bed..4cec2ce1b08 100644 --- a/Modules/Core/SpatialObjects/include/itkDTITubeSpatialObjectPoint.h +++ b/Modules/Core/SpatialObjects/include/itkDTITubeSpatialObjectPoint.h @@ -45,7 +45,7 @@ to translate the enum to a string */ }; // Define how to print enumeration extern ITKSpatialObjects_EXPORT std::ostream & - operator<<(std::ostream & out, const DTITubeSpatialObjectPointEnums::DTITubeSpatialObjectPointField value); +operator<<(std::ostream & out, const DTITubeSpatialObjectPointEnums::DTITubeSpatialObjectPointField value); /** * \class DTITubeSpatialObjectPoint * \brief Point used for a tube definition diff --git a/Modules/Core/SpatialObjects/include/itkSpatialObject.hxx b/Modules/Core/SpatialObjects/include/itkSpatialObject.hxx index 39d675d8815..025dad23f33 100644 --- a/Modules/Core/SpatialObjects/include/itkSpatialObject.hxx +++ b/Modules/Core/SpatialObjects/include/itkSpatialObject.hxx @@ -720,8 +720,8 @@ SpatialObject::GetChildren(unsigned int depth, const std::string & n template auto -SpatialObject::GetConstChildren(unsigned int depth, const std::string & name) const - -> ChildrenConstListType * +SpatialObject::GetConstChildren(unsigned int depth, + const std::string & name) const -> ChildrenConstListType * { auto * childrenSO = new ChildrenConstListType; diff --git a/Modules/Core/TestKernel/include/itkTestDriverInclude.h b/Modules/Core/TestKernel/include/itkTestDriverInclude.h index e0b655b49e0..2d333d935e5 100644 --- a/Modules/Core/TestKernel/include/itkTestDriverInclude.h +++ b/Modules/Core/TestKernel/include/itkTestDriverInclude.h @@ -160,6 +160,6 @@ extern std::map RegressionTestBaselines(char * baselineFilename); // Needed for explicit instantiate -//#include "itkTestingComparisonImageFilter.hxx" +// #include "itkTestingComparisonImageFilter.hxx" #endif diff --git a/Modules/Core/TestKernel/include/itkTestingExtractSliceImageFilter.hxx b/Modules/Core/TestKernel/include/itkTestingExtractSliceImageFilter.hxx index 1ed56310a79..3d1c3a0230d 100644 --- a/Modules/Core/TestKernel/include/itkTestingExtractSliceImageFilter.hxx +++ b/Modules/Core/TestKernel/include/itkTestingExtractSliceImageFilter.hxx @@ -201,21 +201,18 @@ ExtractSliceImageFilter::GenerateOutputInformation() // length cosine vector, reset the directions to identity. switch (m_DirectionCollaspeStrategy) { - case TestExtractSliceImageFilterCollapseStrategyEnum::DIRECTIONCOLLAPSETOIDENTITY: - { + case TestExtractSliceImageFilterCollapseStrategyEnum::DIRECTIONCOLLAPSETOIDENTITY: { outputDirection.SetIdentity(); } break; - case TestExtractSliceImageFilterCollapseStrategyEnum::DIRECTIONCOLLAPSETOSUBMATRIX: - { + case TestExtractSliceImageFilterCollapseStrategyEnum::DIRECTIONCOLLAPSETOSUBMATRIX: { if (vnl_determinant(outputDirection.GetVnlMatrix()) == 0.0) { itkExceptionMacro("Invalid submatrix extracted for collapsed direction."); } } break; - case TestExtractSliceImageFilterCollapseStrategyEnum::DIRECTIONCOLLAPSETOGUESS: - { + case TestExtractSliceImageFilterCollapseStrategyEnum::DIRECTIONCOLLAPSETOGUESS: { if (vnl_determinant(outputDirection.GetVnlMatrix()) == 0.0) { outputDirection.SetIdentity(); @@ -223,8 +220,7 @@ ExtractSliceImageFilter::GenerateOutputInformation() } break; case TestExtractSliceImageFilterCollapseStrategyEnum::DIRECTIONCOLLAPSETOUNKOWN: - default: - { + default: { itkExceptionMacro( << "It is required that the strategy for collapsing the direction matrix be explicitly specified. " << "Set with either myfilter->SetDirectionCollapseToIdentity() or myfilter->SetDirectionCollapseToSubmatrix() " diff --git a/Modules/Core/TestKernel/src/itkTestDriver.cxx b/Modules/Core/TestKernel/src/itkTestDriver.cxx index e595a8ac34c..15957813a50 100644 --- a/Modules/Core/TestKernel/src/itkTestDriver.cxx +++ b/Modules/Core/TestKernel/src/itkTestDriver.cxx @@ -200,51 +200,43 @@ TestDriverInvokeProcess(const ArgumentsList & args) int state = itksysProcess_GetState(process); switch (state) { - case itksysProcess_State_Error: - { + case itksysProcess_State_Error: { std::cerr << "itkTestDriver: Process error: " << itksysProcess_GetErrorString(process) << std::endl; itksysProcess_Delete(process); return 1; } - case itksysProcess_State_Exception: - { + case itksysProcess_State_Exception: { std::cerr << "itkTestDriver: Process exception: " << itksysProcess_GetExceptionString(process) << std::endl; itksysProcess_Delete(process); return 1; } - case itksysProcess_State_Executing: - { + case itksysProcess_State_Executing: { // this is not a possible state after itksysProcess_WaitForExit std::cerr << "itkTestDriver: Internal error: process can't be in Executing State." << std::endl; itksysProcess_Delete(process); return 1; } - case itksysProcess_State_Exited: - { + case itksysProcess_State_Exited: { // this is the normal case - it is treated later break; } - case itksysProcess_State_Expired: - { + case itksysProcess_State_Expired: { // this is not a possible state after itksysProcess_WaitForExit std::cerr << "itkTestDriver: Internal error: process can't be in Expired State." << std::endl; itksysProcess_Delete(process); return 1; } - case itksysProcess_State_Killed: - { + case itksysProcess_State_Killed: { std::cerr << "itkTestDriver: The process has been killed." << std::endl; itksysProcess_Delete(process); return 1; } - case itksysProcess_State_Disowned: - { + case itksysProcess_State_Disowned: { std::cerr << "itkTestDriver: Process disowned." << std::endl; itksysProcess_Delete(process); return 1; } - default: - { + default: { // this is not a possible state after itksysProcess_WaitForExit std::cerr << "itkTestDriver: Internal error: unknown State." << std::endl; itksysProcess_Delete(process); diff --git a/Modules/Core/Transform/include/itkBSplineTransform.h b/Modules/Core/Transform/include/itkBSplineTransform.h index 8a1b5591912..bf6d58cbe41 100644 --- a/Modules/Core/Transform/include/itkBSplineTransform.h +++ b/Modules/Core/Transform/include/itkBSplineTransform.h @@ -302,14 +302,14 @@ class ITK_TEMPLATE_EXPORT BSplineTransform : public BSplineBaseTransform::ComputeG(const InputVectorTyp template const typename KernelTransform::GMatrixType & - KernelTransform::ComputeReflexiveG(PointsIterator) const +KernelTransform::ComputeReflexiveG(PointsIterator) const { m_GMatrix.fill(TParametersValueType{}); m_GMatrix.fill_diagonal(m_Stiffness); diff --git a/Modules/Core/Transform/include/itkTransform.h b/Modules/Core/Transform/include/itkTransform.h index fa911a5c9b1..8c3205300f5 100644 --- a/Modules/Core/Transform/include/itkTransform.h +++ b/Modules/Core/Transform/include/itkTransform.h @@ -595,7 +595,7 @@ class ITK_TEMPLATE_EXPORT Transform : public TransformBaseTemplate diff --git a/Modules/Core/Transform/test/itkAffineTransformTest.cxx b/Modules/Core/Transform/test/itkAffineTransformTest.cxx index 4d9e911b3ca..a0ea5e5a195 100644 --- a/Modules/Core/Transform/test/itkAffineTransformTest.cxx +++ b/Modules/Core/Transform/test/itkAffineTransformTest.cxx @@ -556,7 +556,7 @@ itkAffineTransformTest(int, char *[]) std::cout << jaffJacobian << std::endl; double data[] = { 5, 10, 15, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 5, 10, 15, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 5, 10, 15, 0, 0, 1 }; + 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 5, 10, 15, 0, 0, 1 }; vnl_matrix vnlData(data, 3, 12); Affine3DType::JacobianType expectedJacobian(vnlData); for (unsigned int i = 0; i < 3; ++i) diff --git a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest2.cxx b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest2.cxx index 305feb34aa0..5ac9afc0f71 100644 --- a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest2.cxx +++ b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest2.cxx @@ -256,18 +256,15 @@ itkBSplineDeformableTransformTest2(int argc, char * argv[]) switch (splineOrder) { - case 1: - { + case 1: { status |= BSplineDeformableTransformTest2Helper<1>::RunTest(argc, argv); break; } - case 2: - { + case 2: { status |= BSplineDeformableTransformTest2Helper<2>::RunTest(argc, argv); break; } - case 3: - { + case 3: { status |= BSplineDeformableTransformTest2Helper<3>::RunTest(argc, argv); break; } diff --git a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest3.cxx b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest3.cxx index f293b506f06..c9d910dcb9b 100644 --- a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest3.cxx +++ b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest3.cxx @@ -264,14 +264,12 @@ itkBSplineDeformableTransformTest3(int argc, char * argv[]) int status = 0; switch (numberOfThreads) { - case 0: - { + case 0: { // Don't invoke MultiThreader at all. status |= BSplineDeformableTransformTest3Helper<3>::RunTest(argc, argv); break; } - default: - { + default: { // Use MultiThreader with argv[6] threads itk::MultiThreaderBase::SetGlobalDefaultNumberOfThreads(numberOfThreads); itk::MultiThreaderBase::SetGlobalMaximumNumberOfThreads(numberOfThreads); diff --git a/Modules/Core/Transform/test/itkBSplineTransformTest2.cxx b/Modules/Core/Transform/test/itkBSplineTransformTest2.cxx index 5546daeb523..14c729dc5e5 100644 --- a/Modules/Core/Transform/test/itkBSplineTransformTest2.cxx +++ b/Modules/Core/Transform/test/itkBSplineTransformTest2.cxx @@ -232,18 +232,15 @@ itkBSplineTransformTest2(int argc, char * argv[]) switch (splineOrder) { - case 1: - { + case 1: { status |= BSplineTransformTest2Helper<1>::RunTest(argc, argv); break; } - case 2: - { + case 2: { status |= BSplineTransformTest2Helper<2>::RunTest(argc, argv); break; } - case 3: - { + case 3: { status |= BSplineTransformTest2Helper<3>::RunTest(argc, argv); break; } diff --git a/Modules/Core/Transform/test/itkBSplineTransformTest3.cxx b/Modules/Core/Transform/test/itkBSplineTransformTest3.cxx index 14cd10ef10d..9b5096a95c6 100644 --- a/Modules/Core/Transform/test/itkBSplineTransformTest3.cxx +++ b/Modules/Core/Transform/test/itkBSplineTransformTest3.cxx @@ -251,14 +251,12 @@ itkBSplineTransformTest3(int argc, char * argv[]) int status = 0; switch (numberOfThreads) { - case 0: - { + case 0: { // Don't invoke MultiThreader at all. status |= BSplineTransformTest3Helper<3>::RunTest(argc, argv); break; } - default: - { + default: { // Use MultiThreader with argv[6] threads itk::MultiThreaderBase::SetGlobalDefaultNumberOfThreads(numberOfThreads); itk::MultiThreaderBase::SetGlobalMaximumNumberOfThreads(numberOfThreads); diff --git a/Modules/Core/Transform/test/itkCenteredRigid2DTransformTest.cxx b/Modules/Core/Transform/test/itkCenteredRigid2DTransformTest.cxx index 94fd5de9275..48dbc8fe5bb 100644 --- a/Modules/Core/Transform/test/itkCenteredRigid2DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkCenteredRigid2DTransformTest.cxx @@ -358,7 +358,7 @@ itkCenteredRigid2DTransformTest(int, char *[]) std::cerr << " [ FAILED ] " << std::endl; return EXIT_FAILURE; } // if - } // for j + } // for j } // for k diff --git a/Modules/Core/Transform/test/itkEuler2DTransformTest.cxx b/Modules/Core/Transform/test/itkEuler2DTransformTest.cxx index 40396d9a483..e0b78a82957 100644 --- a/Modules/Core/Transform/test/itkEuler2DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkEuler2DTransformTest.cxx @@ -332,7 +332,7 @@ itkEuler2DTransformTest(int, char *[]) std::cerr << " [ FAILED ] " << std::endl; return EXIT_FAILURE; } // if - } // for j + } // for j } // for k diff --git a/Modules/Core/Transform/test/itkQuaternionRigidTransformTest.cxx b/Modules/Core/Transform/test/itkQuaternionRigidTransformTest.cxx index 68edfe9d902..5c36ae15f2f 100644 --- a/Modules/Core/Transform/test/itkQuaternionRigidTransformTest.cxx +++ b/Modules/Core/Transform/test/itkQuaternionRigidTransformTest.cxx @@ -462,7 +462,7 @@ itkQuaternionRigidTransformTest(int, char *[]) std::cerr << " [ FAILED ] " << std::endl; return EXIT_FAILURE; } // if - } // for j + } // for j } // for k diff --git a/Modules/Core/Transform/test/itkSimilarity2DTransformTest.cxx b/Modules/Core/Transform/test/itkSimilarity2DTransformTest.cxx index 921823230e3..e43e68c1dc9 100644 --- a/Modules/Core/Transform/test/itkSimilarity2DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkSimilarity2DTransformTest.cxx @@ -415,7 +415,7 @@ itkSimilarity2DTransformTest(int, char *[]) std::cerr << " [ FAILED ] " << std::endl; return EXIT_FAILURE; } // if - } // for j + } // for j } // for k @@ -574,7 +574,7 @@ itkSimilarity2DTransformTest(int, char *[]) std::cerr << " [ FAILED ] " << std::endl; return EXIT_FAILURE; } // if - } // for j + } // for j } // for k diff --git a/Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilter.hxx b/Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilter.hxx index 87590fc928d..c8aaa86e3b3 100644 --- a/Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilter.hxx +++ b/Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilter.hxx @@ -243,10 +243,10 @@ N4BiasFieldCorrectionImageFilter::Generat using CustomBinaryFilter = itk::BinaryGeneratorImageFilter; auto expAndDivFilter = CustomBinaryFilter::New(); auto expAndDivLambda = [](const typename InputImageType::PixelType & input, - const typename RealImageType::PixelType & biasField) -> typename OutputImageType::PixelType - { - return static_cast(input / std::exp(biasField)); - }; + const typename RealImageType::PixelType & biasField) -> + typename OutputImageType::PixelType { + return static_cast(input / std::exp(biasField)); + }; expAndDivFilter->SetFunctor(expAndDivLambda); expAndDivFilter->SetInput1(inputImage); expAndDivFilter->SetInput2(logBiasField); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryDilateImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryDilateImageFilter.hxx index 15e4a7d0b75..03672f4ca34 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryDilateImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryDilateImageFilter.hxx @@ -332,9 +332,9 @@ BinaryDilateImageFilter::GenerateData() progress.CompletedPixel(); } // if( nit.GetPixel( i ) == onTag ) - } // for (i = 0; i < neighborhoodSize; ++i) - } // while ( !propagQueue.empty() ) - } // if( bIsOnContour ) + } // for (i = 0; i < neighborhoodSize; ++i) + } // while ( !propagQueue.empty() ) + } // if( bIsOnContour ) else { tmpRegIndexIt.Set(innerTag); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryErodeImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryErodeImageFilter.hxx index b2ceeba3c5c..6f36f25ec1e 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryErodeImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryErodeImageFilter.hxx @@ -324,9 +324,9 @@ BinaryErodeImageFilter::GenerateData() progress.CompletedPixel(); } // if( nit.GetPixel( i ) == onTag ) - } // for (i = 0; i < neighborhoodSize; ++i) - } // while ( !propagQueue.empty() ) - } // if( bIsOnContour ) + } // for (i = 0; i < neighborhoodSize; ++i) + } // while ( !propagQueue.empty() ) + } // if( bIsOnContour ) else { tmpRegIndexIt.Set(innerTag); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologyImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologyImageFilter.hxx index 204b2f9a3bb..e77c7a62c48 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologyImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologyImageFilter.hxx @@ -197,7 +197,7 @@ BinaryMorphologyImageFilter::AnalyzeKernel() } } } // while ( !propagQueue.empty() ) - } // if( kernelImageItIndex.Get() ) + } // if( kernelImageItIndex.Get() ) ++kernelImageItIndex; ++kernel_it; @@ -300,7 +300,7 @@ BinaryMorphologyImageFilter::AnalyzeKernel() } } } // for( kernelOnElementsIt = kernelOnElements.begin(); ... - } // for( ii = 0; ii < adjNeigh.Size(); ++ii ) + } // for( ii = 0; ii < adjNeigh.Size(); ++ii ) // For the particular case of the m_KernelDifferenceSets at the // center of the kernel ( the difference set is theoretically empty diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryThinningImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryThinningImageFilter.hxx index 36c943ce6cd..1e1b8f9f22b 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryThinningImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryThinningImageFilter.hxx @@ -273,7 +273,7 @@ BinaryThinningImageFilter::ComputeThinImage() thinImage->SetPixel(*pixelsToDeleteIt, 0); } } // end step loop - } // end noChange while loop + } // end noChange while loop itkDebugMacro("ComputeThinImage End"); } diff --git a/Modules/Filtering/Colormap/include/itkScalarToRGBColormapImageFilter.h b/Modules/Filtering/Colormap/include/itkScalarToRGBColormapImageFilter.h index 6fba57d0754..c19b76d6aa3 100644 --- a/Modules/Filtering/Colormap/include/itkScalarToRGBColormapImageFilter.h +++ b/Modules/Filtering/Colormap/include/itkScalarToRGBColormapImageFilter.h @@ -74,7 +74,7 @@ static constexpr RGBColormapFilterEnum OverUnder = RGBColormapFilterEnum::OverUn #endif /** Define how to print enumerations */ extern ITKColormap_EXPORT std::ostream & - operator<<(std::ostream & out, const ScalarToRGBColormapImageFilterEnums::RGBColormapFilter value); +operator<<(std::ostream & out, const ScalarToRGBColormapImageFilterEnums::RGBColormapFilter value); /** * \class ScalarToRGBColormapImageFilter * \brief Implements pixel-wise intensity->rgb mapping operation on one image. diff --git a/Modules/Filtering/Colormap/include/itkScalarToRGBColormapImageFilter.hxx b/Modules/Filtering/Colormap/include/itkScalarToRGBColormapImageFilter.hxx index 71f5d63e57b..9901dc522f8 100644 --- a/Modules/Filtering/Colormap/include/itkScalarToRGBColormapImageFilter.hxx +++ b/Modules/Filtering/Colormap/include/itkScalarToRGBColormapImageFilter.hxx @@ -128,100 +128,86 @@ ScalarToRGBColormapImageFilter::SetColormap(RGBColorm { switch (map) { - case RGBColormapFilterEnum::Red: - { + case RGBColormapFilterEnum::Red: { using SpecificColormapType = Function::RedColormapFunction; auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } - case RGBColormapFilterEnum::Green: - { + case RGBColormapFilterEnum::Green: { using SpecificColormapType = Function::GreenColormapFunction; auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } - case RGBColormapFilterEnum::Blue: - { + case RGBColormapFilterEnum::Blue: { using SpecificColormapType = Function::BlueColormapFunction; auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } case RGBColormapFilterEnum::Grey: - default: - { + default: { using SpecificColormapType = Function::GreyColormapFunction; auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } - case RGBColormapFilterEnum::Hot: - { + case RGBColormapFilterEnum::Hot: { using SpecificColormapType = Function::HotColormapFunction; auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } - case RGBColormapFilterEnum::Cool: - { + case RGBColormapFilterEnum::Cool: { using SpecificColormapType = Function::CoolColormapFunction; auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } - case RGBColormapFilterEnum::Spring: - { + case RGBColormapFilterEnum::Spring: { using SpecificColormapType = Function::SpringColormapFunction; auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } - case RGBColormapFilterEnum::Summer: - { + case RGBColormapFilterEnum::Summer: { using SpecificColormapType = Function::SummerColormapFunction; auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } - case RGBColormapFilterEnum::Autumn: - { + case RGBColormapFilterEnum::Autumn: { using SpecificColormapType = Function::AutumnColormapFunction; auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } - case RGBColormapFilterEnum::Winter: - { + case RGBColormapFilterEnum::Winter: { using SpecificColormapType = Function::WinterColormapFunction; auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } - case RGBColormapFilterEnum::Copper: - { + case RGBColormapFilterEnum::Copper: { using SpecificColormapType = Function::CopperColormapFunction; auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } - case RGBColormapFilterEnum::Jet: - { + case RGBColormapFilterEnum::Jet: { using SpecificColormapType = Function::JetColormapFunction; auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } - case RGBColormapFilterEnum::HSV: - { + case RGBColormapFilterEnum::HSV: { using SpecificColormapType = Function::HSVColormapFunction; auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } - case RGBColormapFilterEnum::OverUnder: - { + case RGBColormapFilterEnum::OverUnder: { using SpecificColormapType = Function::OverUnderColormapFunction; auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); diff --git a/Modules/Filtering/Convolution/include/itkConvolutionImageFilterBase.h b/Modules/Filtering/Convolution/include/itkConvolutionImageFilterBase.h index 9ffdb5e605a..85fe006bb0e 100644 --- a/Modules/Filtering/Convolution/include/itkConvolutionImageFilterBase.h +++ b/Modules/Filtering/Convolution/include/itkConvolutionImageFilterBase.h @@ -44,7 +44,7 @@ class ConvolutionImageFilterBaseEnums }; /** Define how to print enumerations */ extern ITKConvolution_EXPORT std::ostream & - operator<<(std::ostream & out, const ConvolutionImageFilterBaseEnums::ConvolutionImageFilterOutputRegion value); +operator<<(std::ostream & out, const ConvolutionImageFilterBaseEnums::ConvolutionImageFilterOutputRegion value); /** * \class ConvolutionImageFilterBase @@ -154,7 +154,7 @@ class ITK_TEMPLATE_EXPORT ConvolutionImageFilterBase : public ImageToImageFilter /** Default superclass implementation ensures that input images * occupy same physical space. This is not needed for this filter. */ void - VerifyInputInformation() ITKv5_CONST override{}; + VerifyInputInformation() ITKv5_CONST override {}; private: bool m_Normalize{ false }; diff --git a/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowFunction.hxx b/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowFunction.hxx index f35b5d4ca81..56fcf7e4f3a 100644 --- a/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowFunction.hxx +++ b/Modules/Filtering/CurvatureFlow/include/itkMinMaxCurvatureFlowFunction.hxx @@ -117,8 +117,8 @@ MinMaxCurvatureFlowFunction::InitializeStencilOperator() template auto -MinMaxCurvatureFlowFunction::ComputeThreshold(const DispatchBase &, const NeighborhoodType & it) const - -> PixelType +MinMaxCurvatureFlowFunction::ComputeThreshold(const DispatchBase &, + const NeighborhoodType & it) const -> PixelType { PixelType threshold{}; @@ -214,8 +214,8 @@ MinMaxCurvatureFlowFunction::ComputeThreshold(const DispatchBase &, cons template auto -MinMaxCurvatureFlowFunction::ComputeThreshold(const Dispatch<2> &, const NeighborhoodType & it) const - -> PixelType +MinMaxCurvatureFlowFunction::ComputeThreshold(const Dispatch<2> &, + const NeighborhoodType & it) const -> PixelType { constexpr unsigned int imageDimension = 2; @@ -276,8 +276,8 @@ MinMaxCurvatureFlowFunction::ComputeThreshold(const Dispatch<2> &, const template auto -MinMaxCurvatureFlowFunction::ComputeThreshold(const Dispatch<3> &, const NeighborhoodType & it) const - -> PixelType +MinMaxCurvatureFlowFunction::ComputeThreshold(const Dispatch<3> &, + const NeighborhoodType & it) const -> PixelType { constexpr unsigned int imageDimension = 3; diff --git a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingBaseImageFilter.h b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingBaseImageFilter.h index 1a02e0f46cb..3fa77ae658c 100644 --- a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingBaseImageFilter.h +++ b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingBaseImageFilter.h @@ -75,12 +75,12 @@ class PatchBasedDenoisingBaseImageFilterEnums }; // Define how to print enumeration extern ITKDenoising_EXPORT std::ostream & - operator<<(std::ostream & out, const PatchBasedDenoisingBaseImageFilterEnums::NoiseModel value); +operator<<(std::ostream & out, const PatchBasedDenoisingBaseImageFilterEnums::NoiseModel value); extern ITKDenoising_EXPORT std::ostream & - operator<<(std::ostream & out, const PatchBasedDenoisingBaseImageFilterEnums::ComponentSpace value); +operator<<(std::ostream & out, const PatchBasedDenoisingBaseImageFilterEnums::ComponentSpace value); // Define how to print enumeration extern ITKDenoising_EXPORT std::ostream & - operator<<(std::ostream & out, const PatchBasedDenoisingBaseImageFilterEnums::FilterState value); +operator<<(std::ostream & out, const PatchBasedDenoisingBaseImageFilterEnums::FilterState value); /** * \class PatchBasedDenoisingBaseImageFilter * \brief Base class for patch-based denoising algorithms. diff --git a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingBaseImageFilter.hxx b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingBaseImageFilter.hxx index 2366bd90485..62affe75b42 100644 --- a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingBaseImageFilter.hxx +++ b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingBaseImageFilter.hxx @@ -283,7 +283,8 @@ PatchBasedDenoisingBaseImageFilter::PrintSelf(std::os os << indent << "NoiseModelEnum::POISSON" << std::endl; } else - {} + { + } os << indent << "SmoothingWeight: " << m_SmoothingWeight << std::endl; os << indent << "NoiseModelFidelityWeight: " << m_NoiseModelFidelityWeight << std::endl; @@ -306,7 +307,8 @@ PatchBasedDenoisingBaseImageFilter::PrintSelf(std::os os << indent << "ComponentSpace: RIEMANNIAN" << std::endl; } else - {} + { + } if (m_ManualReinitialization) { diff --git a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx index 3b6b61cfeca..7f3e2d50d8e 100644 --- a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx +++ b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx @@ -745,7 +745,7 @@ typename PatchBasedDenoisingImageFilter::ThreadDataSt } foundMinMax = true; } // end for each pixel in the region - } // end for each region + } // end for each region if (foundMinMax) { threadData.validNorms[0] = 1; @@ -1143,8 +1143,8 @@ PatchBasedDenoisingImageFilter::ComputeLogMapAndWeigh template auto -PatchBasedDenoisingImageFilter::AddEuclideanUpdate(const RealType & a, const RealType & b) - -> RealType +PatchBasedDenoisingImageFilter::AddEuclideanUpdate(const RealType & a, + const RealType & b) -> RealType { RealType result = m_ZeroPixel; @@ -1751,7 +1751,7 @@ PatchBasedDenoisingImageFilter::ThreadedComputeSigmaU (3.0 * distancePatchEntropySquared / pow(sigmaKernel, 4.0))); } } // end for each independent pixel component - } // end for each selected patch + } // end for each selected patch for (unsigned int ic = 0; ic < m_NumIndependentComponents; ++ic) { @@ -1786,8 +1786,8 @@ PatchBasedDenoisingImageFilter::ThreadedComputeSigmaU itk::Math::sqr(probPatchEntropyFirstDerivative[ic] / probPatchEntropy[ic]); } } // end if independent component hasn't converged yet - } // end for each independent component - } // end for each pixel in the sample + } // end for each independent component + } // end for each pixel in the sample for (unsigned int ic = 0; ic < m_NumIndependentComponents; ++ic) { @@ -2030,13 +2030,11 @@ PatchBasedDenoisingImageFilter::ThreadedComputeImageU const PixelType out = outputIt.Get(); switch (this->GetNoiseModel()) { - case Superclass::NoiseModelEnum::NOMODEL: - { + case Superclass::NoiseModelEnum::NOMODEL: { // Do nothing break; } - case Superclass::NoiseModelEnum::GAUSSIAN: - { + case Superclass::NoiseModelEnum::GAUSSIAN: { for (unsigned int pc = 0; pc < m_NumPixelComponents; ++pc) { const RealValueType gradientFidelity = 2.0 * (this->GetComponent(in, pc) - this->GetComponent(out, pc)); @@ -2046,8 +2044,7 @@ PatchBasedDenoisingImageFilter::ThreadedComputeImageU } break; } - case Superclass::NoiseModelEnum::RICIAN: - { + case Superclass::NoiseModelEnum::RICIAN: { for (unsigned int pc = 0; pc < m_NumPixelComponents; ++pc) { const PixelValueType inVal = this->GetComponent(in, pc); @@ -2066,8 +2063,7 @@ PatchBasedDenoisingImageFilter::ThreadedComputeImageU } break; } - case Superclass::NoiseModelEnum::POISSON: - { + case Superclass::NoiseModelEnum::POISSON: { for (unsigned int pc = 0; pc < m_NumPixelComponents; ++pc) { const PixelValueType inVal = this->GetComponent(in, pc); @@ -2084,8 +2080,7 @@ PatchBasedDenoisingImageFilter::ThreadedComputeImageU } break; } - default: - { + default: { itkExceptionMacro("Unexpected noise model " << this->GetNoiseModel() << " specified."); break; } @@ -2110,7 +2105,7 @@ PatchBasedDenoisingImageFilter::ThreadedComputeImageU progress.CompletedPixel(); } // end for each pixel in the sample - } // end for each face in the face list + } // end for each face in the face list return threadData; } diff --git a/Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.h b/Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.h index 5f1ebde8e1b..a79338229dc 100644 --- a/Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.h +++ b/Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.h @@ -51,7 +51,7 @@ class DiffusionTensor3DReconstructionImageFilterEnums }; // Define how to print enumeration extern ITKDiffusionTensorImage_EXPORT std::ostream & - operator<<(std::ostream & out, const DiffusionTensor3DReconstructionImageFilterEnums::GradientImageFormat value); +operator<<(std::ostream & out, const DiffusionTensor3DReconstructionImageFilterEnums::GradientImageFormat value); /** \class DiffusionTensor3DReconstructionImageFilter * \brief This class takes as input one or more reference image (acquired in the diff --git a/Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.hxx b/Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.hxx index 57d5cc73366..d644753a5a5 100644 --- a/Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.hxx +++ b/Modules/Filtering/DiffusionTensorImage/include/itkDiffusionTensor3DReconstructionImageFilter.hxx @@ -484,7 +484,7 @@ DiffusionTensor3DReconstructionImageFilter::AddGradientImage(const GradientDirectionType & - gradientDirection, + gradientDirection, const GradientImageType * gradientImage) { // Make sure crazy users did not call both AddGradientImage and @@ -520,7 +520,7 @@ DiffusionTensor3DReconstructionImageFilter::SetGradientImage(GradientDirectionContainerType * - gradientDirection, + gradientDirection, const GradientImagesType * gradientImage) { // Make sure crazy users did not call both AddGradientImage and diff --git a/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx b/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx index 1a0c17faa55..a0209b33fd9 100644 --- a/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx @@ -109,7 +109,7 @@ InvertDisplacementFieldImageFilter::GenerateData() float oldProgress = 0.0f; - while (iteration++ < this->m_MaximumNumberOfIterations && this->m_MaxErrorNorm > this->m_MaxErrorToleranceThreshold && + while (iteration++m_MaximumNumberOfIterations && this->m_MaxErrorNorm> this->m_MaxErrorToleranceThreshold && this->m_MeanErrorNorm > this->m_MeanErrorToleranceThreshold) { itkDebugMacro("Iteration " << iteration << ": mean error norm = " << this->m_MeanErrorNorm diff --git a/Modules/Filtering/DisplacementField/include/itkIterativeInverseDisplacementFieldImageFilter.hxx b/Modules/Filtering/DisplacementField/include/itkIterativeInverseDisplacementFieldImageFilter.hxx index 88207e2c8b4..a281df0b097 100644 --- a/Modules/Filtering/DisplacementField/include/itkIterativeInverseDisplacementFieldImageFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkIterativeInverseDisplacementFieldImageFilter.hxx @@ -232,7 +232,7 @@ IterativeInverseDisplacementFieldImageFilter::Generat progress.CompletedPixel(); } // end while loop - } // end else + } // end else time.Stop(); m_Time = time.GetMean(); diff --git a/Modules/Filtering/DisplacementField/include/itkVelocityFieldTransform.h b/Modules/Filtering/DisplacementField/include/itkVelocityFieldTransform.h index 5e972935eea..e44fca74a95 100644 --- a/Modules/Filtering/DisplacementField/include/itkVelocityFieldTransform.h +++ b/Modules/Filtering/DisplacementField/include/itkVelocityFieldTransform.h @@ -166,7 +166,7 @@ class ITK_TEMPLATE_EXPORT VelocityFieldTransform : public DisplacementFieldTrans /** Trigger the computation of the displacement field by integrating the velocity field. */ virtual void - IntegrateVelocityField(){}; + IntegrateVelocityField() {}; /** * Set the lower time bound defining the integration domain of the transform. diff --git a/Modules/Filtering/DistanceMap/include/itkIsoContourDistanceImageFilter.hxx b/Modules/Filtering/DistanceMap/include/itkIsoContourDistanceImageFilter.hxx index a7cead5271b..e15c07cf12e 100644 --- a/Modules/Filtering/DistanceMap/include/itkIsoContourDistanceImageFilter.hxx +++ b/Modules/Filtering/DistanceMap/include/itkIsoContourDistanceImageFilter.hxx @@ -388,7 +388,7 @@ IsoContourDistanceImageFilter::ComputeValue(const Inp itkExceptionMacro("Gradient norm is lower than pixel precision"); } } // end if (sign != signNeigh) - } // end for n + } // end for n } } // namespace itk diff --git a/Modules/Filtering/DistanceMap/include/itkSignedDanielssonDistanceMapImageFilter.h b/Modules/Filtering/DistanceMap/include/itkSignedDanielssonDistanceMapImageFilter.h index e81b23d540b..233deb17493 100644 --- a/Modules/Filtering/DistanceMap/include/itkSignedDanielssonDistanceMapImageFilter.h +++ b/Modules/Filtering/DistanceMap/include/itkSignedDanielssonDistanceMapImageFilter.h @@ -235,8 +235,8 @@ class ITK_TEMPLATE_EXPORT SignedDanielssonDistanceMapImageFilter : public ImageT bool m_SquaredDistance{}; bool m_UseImageSpacing{ true }; bool m_InsideIsPositive{}; // ON is treated as inside pixels -}; // end of SignedDanielssonDistanceMapImageFilter - // class +}; // end of SignedDanielssonDistanceMapImageFilter + // class } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION diff --git a/Modules/Filtering/FFT/include/itkComplexToComplexFFTImageFilter.h b/Modules/Filtering/FFT/include/itkComplexToComplexFFTImageFilter.h index 9dde3c92a7d..7cc1995ce7a 100644 --- a/Modules/Filtering/FFT/include/itkComplexToComplexFFTImageFilter.h +++ b/Modules/Filtering/FFT/include/itkComplexToComplexFFTImageFilter.h @@ -46,7 +46,7 @@ class ComplexToComplexFFTImageFilterEnums }; // Define how to print enumeration extern ITKFFT_EXPORT std::ostream & - operator<<(std::ostream & out, const ComplexToComplexFFTImageFilterEnums::TransformDirection value); +operator<<(std::ostream & out, const ComplexToComplexFFTImageFilterEnums::TransformDirection value); /** * \class ComplexToComplexFFTImageFilter diff --git a/Modules/Filtering/FFT/include/itkFFTWHalfHermitianToRealInverseFFTImageFilter.hxx b/Modules/Filtering/FFT/include/itkFFTWHalfHermitianToRealInverseFFTImageFilter.hxx index da6102149b9..864bd3e43c9 100644 --- a/Modules/Filtering/FFT/include/itkFFTWHalfHermitianToRealInverseFFTImageFilter.hxx +++ b/Modules/Filtering/FFT/include/itkFFTWHalfHermitianToRealInverseFFTImageFilter.hxx @@ -75,8 +75,7 @@ FFTWHalfHermitianToRealInverseFFTImageFilter::BeforeT // FFTW_PRESERVE_INPUT flag at this time. So if the input can't be // destroyed, we have to copy the input data to a buffer before // running the IFFT. - typename FFTWProxyType::ComplexType * const in = [&]() -> typename FFTWProxyType::ComplexType * - { + typename FFTWProxyType::ComplexType * const in = [&]() -> typename FFTWProxyType::ComplexType * { if (m_CanUseDestructiveAlgorithm) { // Ok, so lets use the input buffer directly, to save some memory. @@ -88,8 +87,7 @@ FFTWHalfHermitianToRealInverseFFTImageFilter::BeforeT // We must use a buffer where fftw can work and destroy what it wants. return new typename FFTWProxyType::ComplexType[totalInputSize]; } - } - (); + }(); OutputPixelType * out = outputPtr->GetBufferPointer(); typename FFTWProxyType::PlanType plan; diff --git a/Modules/Filtering/FFT/src/itkFFTWFFTImageFilterInitFactory.cxx b/Modules/Filtering/FFT/src/itkFFTWFFTImageFilterInitFactory.cxx index 1b34d742f6c..facd514c8d1 100644 --- a/Modules/Filtering/FFT/src/itkFFTWFFTImageFilterInitFactory.cxx +++ b/Modules/Filtering/FFT/src/itkFFTWFFTImageFilterInitFactory.cxx @@ -60,7 +60,7 @@ FFTWFFTImageFilterInitFactory::RegisterFactories() // DO NOT CALL DIRECTLY. // TODO CMake parsing currently does not allow "InitFactory" void ITKFFT_EXPORT - FFTWFFTImageFilterInitFactoryRegister__Private() +FFTWFFTImageFilterInitFactoryRegister__Private() { FFTWFFTImageFilterInitFactory::RegisterFactories(); } diff --git a/Modules/Filtering/FFT/src/itkFFTWGlobalConfiguration.cxx b/Modules/Filtering/FFT/src/itkFFTWGlobalConfiguration.cxx index 07e37cc8e96..d448a22a817 100644 --- a/Modules/Filtering/FFT/src/itkFFTWGlobalConfiguration.cxx +++ b/Modules/Filtering/FFT/src/itkFFTWGlobalConfiguration.cxx @@ -45,7 +45,7 @@ namespace itk struct FFTWGlobalConfigurationGlobals { FFTWGlobalConfigurationGlobals() - : m_Instance(nullptr){}; + : m_Instance(nullptr) {}; FFTWGlobalConfiguration::Pointer m_Instance; std::mutex m_CreationMutex; diff --git a/Modules/Filtering/FFT/src/itkVnlFFTImageFilterInitFactory.cxx b/Modules/Filtering/FFT/src/itkVnlFFTImageFilterInitFactory.cxx index a20f04a6a91..00577f95556 100644 --- a/Modules/Filtering/FFT/src/itkVnlFFTImageFilterInitFactory.cxx +++ b/Modules/Filtering/FFT/src/itkVnlFFTImageFilterInitFactory.cxx @@ -56,7 +56,7 @@ VnlFFTImageFilterInitFactory::RegisterFactories() // DO NOT CALL DIRECTLY. // TODO CMake parsing currently does not allow "InitFactory" void ITKFFT_EXPORT - VnlFFTImageFilterInitFactoryRegister__Private() +VnlFFTImageFilterInitFactoryRegister__Private() { VnlFFTImageFilterInitFactory::RegisterFactories(); } diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingExtensionImageFilter.hxx b/Modules/Filtering/FastMarching/include/itkFastMarchingExtensionImageFilter.hxx index fee2a254da1..fd61280f597 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingExtensionImageFilter.hxx +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingExtensionImageFilter.hxx @@ -169,7 +169,7 @@ FastMarchingExtensionImageFilterm_AuxImages[k]->SetPixel(node.GetIndex(), auxVec[k]); } } // end container loop - } // if AuxAliveValues set + } // if AuxAliveValues set if (m_AuxTrialValues) { @@ -193,7 +193,7 @@ FastMarchingExtensionImageFilterm_AuxImages[k]->SetPixel(node.GetIndex(), auxVec[k]); } } // end container loop - } // if AuxTrialValues set + } // if AuxTrialValues set } template diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingExtensionImageFilterBase.hxx b/Modules/Filtering/FastMarching/include/itkFastMarchingExtensionImageFilterBase.hxx index 31f42ad9a3d..51122c1428b 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingExtensionImageFilterBase.hxx +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingExtensionImageFilterBase.hxx @@ -166,7 +166,7 @@ FastMarchingExtensionImageFilterBase: ++pointsIter; ++auxIter; } // end container while - } // if AuxAliveValues set + } // if AuxAliveValues set if (m_AuxiliaryTrialValues) { @@ -190,7 +190,7 @@ FastMarchingExtensionImageFilterBase: ++pointsIter; ++auxIter; } // end container loop - } // if AuxTrialValues set + } // if AuxTrialValues set } template diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilterBase.hxx b/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilterBase.hxx index f3e78068841..b5502769277 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilterBase.hxx +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilterBase.hxx @@ -124,8 +124,8 @@ FastMarchingImageFilterBase::SetOutputValue(OutputImageType * template auto -FastMarchingImageFilterBase::GetOutputValue(OutputImageType * oImage, const NodeType & iNode) const - -> const OutputPixelType +FastMarchingImageFilterBase::GetOutputValue(OutputImageType * oImage, + const NodeType & iNode) const -> const OutputPixelType { return oImage->GetPixel(iNode); } diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingImageToNodePairContainerAdaptor.hxx b/Modules/Filtering/FastMarching/include/itkFastMarchingImageToNodePairContainerAdaptor.hxx index af6888ce1f8..7f5c6027ee3 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingImageToNodePairContainerAdaptor.hxx +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingImageToNodePairContainerAdaptor.hxx @@ -142,7 +142,7 @@ FastMarchingImageToNodePairContainerAdaptor::SetPointsF { nodes->push_back(NodePairType(it.GetIndex(), iValue)); } // end if image iterator > zero - } // end for each pixel + } // end for each pixel } else { @@ -153,7 +153,7 @@ FastMarchingImageToNodePairContainerAdaptor::SetPointsF { nodes->push_back(NodePairType(it.GetIndex(), iValue)); } // end if image iterator > zero - } // end for each pixel + } // end for each pixel } switch (iLabel) diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingReachedTargetNodesStoppingCriterion.h b/Modules/Filtering/FastMarching/include/itkFastMarchingReachedTargetNodesStoppingCriterion.h index f5c6365b401..ce7e0d2f119 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingReachedTargetNodesStoppingCriterion.h +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingReachedTargetNodesStoppingCriterion.h @@ -45,7 +45,7 @@ class FastMarchingReachedTargetNodesStoppingCriterionEnums }; // Define how to print enumeration extern ITKFastMarching_EXPORT std::ostream & - operator<<(std::ostream & out, const FastMarchingReachedTargetNodesStoppingCriterionEnums::TargetCondition value); +operator<<(std::ostream & out, const FastMarchingReachedTargetNodesStoppingCriterionEnums::TargetCondition value); /** * \class FastMarchingReachedTargetNodesStoppingCriterion * \brief Stopping criterion for FastMarchingFilterBase. diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilter.h b/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilter.h index f479b88b8b2..67af2b37e1c 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilter.h +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingUpwindGradientImageFilter.h @@ -47,7 +47,7 @@ class FastMarchingUpwindGradientImageFilterEnums }; /** Define how to print enumeration values. */ extern ITKFastMarching_EXPORT std::ostream & - operator<<(std::ostream & out, const FastMarchingUpwindGradientImageFilterEnums::TargetCondition value); +operator<<(std::ostream & out, const FastMarchingUpwindGradientImageFilterEnums::TargetCondition value); /** diff --git a/Modules/Filtering/GPUThresholding/test/itkGPUImageFilterTest.cxx b/Modules/Filtering/GPUThresholding/test/itkGPUImageFilterTest.cxx index 63da4708975..625d6558b4c 100644 --- a/Modules/Filtering/GPUThresholding/test/itkGPUImageFilterTest.cxx +++ b/Modules/Filtering/GPUThresholding/test/itkGPUImageFilterTest.cxx @@ -22,7 +22,7 @@ * This program creates a GPU Mean filter and a CPU threshold filter using * object factory framework and test pipelining of GPU and CPU filters. */ -//#include "pathToOpenCLSourceCode.h" +// #include "pathToOpenCLSourceCode.h" #include "itkImageFileReader.h" #include "itkImageFileWriter.h" diff --git a/Modules/Filtering/ImageCompose/include/itkJoinImageFilter.h b/Modules/Filtering/ImageCompose/include/itkJoinImageFilter.h index 9576841112c..65dd34b10f7 100644 --- a/Modules/Filtering/ImageCompose/include/itkJoinImageFilter.h +++ b/Modules/Filtering/ImageCompose/include/itkJoinImageFilter.h @@ -127,7 +127,8 @@ class JoinFunctor } /** Copier function specific to a scalar first pixel. */ - void FirstCopier(CopierDispatch<1>, JoinType & out, unsigned int idx, const TPixel1 & A) const + void + FirstCopier(CopierDispatch<1>, JoinType & out, unsigned int idx, const TPixel1 & A) const { out[idx] = static_cast(A); } @@ -154,7 +155,8 @@ class JoinFunctor } /** Copier function specific to a scalar second pixel. */ - void SecondCopier(CopierDispatch<1>, JoinType & out, unsigned int idx, const TPixel2 & B) const + void + SecondCopier(CopierDispatch<1>, JoinType & out, unsigned int idx, const TPixel2 & B) const { out[idx] = static_cast(B); } diff --git a/Modules/Filtering/ImageFeature/include/itkHoughTransform2DLinesImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkHoughTransform2DLinesImageFilter.hxx index 1810db52459..d39139f7e2a 100644 --- a/Modules/Filtering/ImageFeature/include/itkHoughTransform2DLinesImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkHoughTransform2DLinesImageFilter.hxx @@ -64,9 +64,9 @@ HoughTransform2DLinesImageFilter::GenerateOut // Compute the size of the output image Size<2> size; - size[0] = (SizeValueType)( - std::sqrt(m_AngleResolution * m_AngleResolution + - input->GetLargestPossibleRegion().GetSize()[0] * input->GetLargestPossibleRegion().GetSize()[0])); + size[0] = (SizeValueType)(std::sqrt(m_AngleResolution * m_AngleResolution + + input->GetLargestPossibleRegion().GetSize()[0] * + input->GetLargestPossibleRegion().GetSize()[0])); size[1] = (SizeValueType)m_AngleResolution; const typename InputImageType::RegionType region(input->GetLargestPossibleRegion().GetIndex(), size); diff --git a/Modules/Filtering/ImageFeature/include/itkMultiScaleHessianBasedMeasureImageFilter.h b/Modules/Filtering/ImageFeature/include/itkMultiScaleHessianBasedMeasureImageFilter.h index 02e2a432905..990db42de3c 100644 --- a/Modules/Filtering/ImageFeature/include/itkMultiScaleHessianBasedMeasureImageFilter.h +++ b/Modules/Filtering/ImageFeature/include/itkMultiScaleHessianBasedMeasureImageFilter.h @@ -44,7 +44,7 @@ class MultiScaleHessianBasedMeasureImageFilterEnums }; // Define how to print enumeration extern ITKImageFeature_EXPORT std::ostream & - operator<<(std::ostream & out, const MultiScaleHessianBasedMeasureImageFilterEnums::SigmaStepMethod value); +operator<<(std::ostream & out, const MultiScaleHessianBasedMeasureImageFilterEnums::SigmaStepMethod value); /** \class MultiScaleHessianBasedMeasureImageFilter * \brief A filter to enhance structures using Hessian eigensystem-based diff --git a/Modules/Filtering/ImageFeature/include/itkMultiScaleHessianBasedMeasureImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkMultiScaleHessianBasedMeasureImageFilter.hxx index e735432d327..68ff87de5ce 100644 --- a/Modules/Filtering/ImageFeature/include/itkMultiScaleHessianBasedMeasureImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkMultiScaleHessianBasedMeasureImageFilter.hxx @@ -285,14 +285,12 @@ MultiScaleHessianBasedMeasureImageFilter(result); } }; // end UnsharpMaskingFunctor -}; // end UnsharpMaskImageFilter +}; // end UnsharpMaskImageFilter } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION diff --git a/Modules/Filtering/ImageFilterBase/include/itkNullImageToImageFilterDriver.hxx b/Modules/Filtering/ImageFilterBase/include/itkNullImageToImageFilterDriver.hxx index 3114dd8d294..ead3532257e 100644 --- a/Modules/Filtering/ImageFilterBase/include/itkNullImageToImageFilterDriver.hxx +++ b/Modules/Filtering/ImageFilterBase/include/itkNullImageToImageFilterDriver.hxx @@ -48,7 +48,7 @@ class NullImageToImageFilterDriver { public: NullImageToImageFilterDriver() - : m_Filter(nullptr){}; + : m_Filter(nullptr) {}; using ImageSizeType = typename TInputImage::SizeType; using InputPixelType = typename TInputImage::PixelType; diff --git a/Modules/Filtering/ImageFilterBase/test/itkCastImageFilterTest.cxx b/Modules/Filtering/ImageFilterBase/test/itkCastImageFilterTest.cxx index e9e9d771f28..ba286e4f62f 100644 --- a/Modules/Filtering/ImageFilterBase/test/itkCastImageFilterTest.cxx +++ b/Modules/Filtering/ImageFilterBase/test/itkCastImageFilterTest.cxx @@ -94,8 +94,8 @@ GetCastTypeName() // static_cast_is_well_defined function returns true if the result of the static cast is well defined // and false if the result is undefined. template -static std::enable_if_t && std::is_integral_v, bool> static_cast_is_well_defined( - TInput) +static std::enable_if_t && std::is_integral_v, bool> +static_cast_is_well_defined(TInput) { return true; // casting from int to int types employes deterministic 2's complement behavior } @@ -104,7 +104,7 @@ template static std::enable_if_t && (std::is_floating_point_v || std::is_integral_v), bool> - static_cast_is_well_defined(TInput) +static_cast_is_well_defined(TInput) { return true; // Floating point to floating point static casts are always consistently defined. } diff --git a/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.hxx index 0f1010adb3c..dca6081edce 100644 --- a/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.hxx @@ -292,28 +292,23 @@ BSplineControlPointImageFilter::CollapsePhiLattice(Po RealType B = 0.0; switch (this->m_SplineOrder[dimension]) { - case 0: - { + case 0: { B = this->m_KernelOrder0->Evaluate(v); break; } - case 1: - { + case 1: { B = this->m_KernelOrder1->Evaluate(v); break; } - case 2: - { + case 2: { B = this->m_KernelOrder2->Evaluate(v); break; } - case 3: - { + case 3: { B = this->m_KernelOrder3->Evaluate(v); break; } - default: - { + default: { B = this->m_Kernel[dimension]->Evaluate(v); break; } diff --git a/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFunction.hxx b/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFunction.hxx index 417959ef0d2..a4d47853aca 100644 --- a/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFunction.hxx +++ b/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFunction.hxx @@ -205,28 +205,23 @@ BSplineControlPointImageFunction::Evaluate(const PointTy CoordRepType B = 1.0; switch (this->m_SplineOrder[i]) { - case 0: - { + case 0: { B = this->m_KernelOrder0->Evaluate(u); break; } - case 1: - { + case 1: { B = this->m_KernelOrder1->Evaluate(u); break; } - case 2: - { + case 2: { B = this->m_KernelOrder2->Evaluate(u); break; } - case 3: - { + case 3: { B = this->m_KernelOrder3->Evaluate(u); break; } - default: - { + default: { B = this->m_Kernel[i]->Evaluate(u); break; } @@ -369,28 +364,23 @@ BSplineControlPointImageFunction::EvaluateGradient(const { switch (this->m_SplineOrder[i]) { - case 0: - { + case 0: { B = this->m_KernelOrder0->Evaluate(u); break; } - case 1: - { + case 1: { B = this->m_KernelOrder1->Evaluate(u); break; } - case 2: - { + case 2: { B = this->m_KernelOrder2->Evaluate(u); break; } - case 3: - { + case 3: { B = this->m_KernelOrder3->Evaluate(u); break; } - default: - { + default: { B = this->m_Kernel[i]->Evaluate(u); break; } @@ -544,28 +534,23 @@ BSplineControlPointImageFunction::EvaluateHessian(const { switch (this->m_SplineOrder[i]) { - case 0: - { + case 0: { B = this->m_KernelOrder0->Evaluate(u); break; } - case 1: - { + case 1: { B = this->m_KernelOrder1->Evaluate(u); break; } - case 2: - { + case 2: { B = this->m_KernelOrder2->Evaluate(u); break; } - case 3: - { + case 3: { B = this->m_KernelOrder3->Evaluate(u); break; } - default: - { + default: { B = this->m_Kernel[i]->Evaluate(u); break; } diff --git a/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx index a503a96d68e..ff950794922 100644 --- a/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx @@ -492,28 +492,23 @@ BSplineScatteredDataPointSetToImageFilter::Threade switch (this->m_SplineOrder[i]) { - case 0: - { + case 0: { B *= this->m_KernelOrder0->Evaluate(u); break; } - case 1: - { + case 1: { B *= this->m_KernelOrder1->Evaluate(u); break; } - case 2: - { + case 2: { B *= this->m_KernelOrder2->Evaluate(u); break; } - case 3: - { + case 3: { B *= this->m_KernelOrder3->Evaluate(u); break; } - default: - { + default: { B *= this->m_Kernel[i]->Evaluate(u); break; } @@ -1012,28 +1007,23 @@ BSplineScatteredDataPointSetToImageFilter::Collaps RealType B = 0.0; switch (this->m_SplineOrder[dimension]) { - case 0: - { + case 0: { B = this->m_KernelOrder0->Evaluate(v); break; } - case 1: - { + case 1: { B = this->m_KernelOrder1->Evaluate(v); break; } - case 2: - { + case 2: { B = this->m_KernelOrder2->Evaluate(v); break; } - case 3: - { + case 3: { B = this->m_KernelOrder3->Evaluate(v); break; } - default: - { + default: { B = this->m_Kernel[dimension]->Evaluate(v); break; } diff --git a/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.hxx index 43f8701267b..eedc4f46d3e 100644 --- a/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.hxx @@ -346,7 +346,7 @@ OrientImageFilter::NeedToFlip() return false; } -//#define DefinedDebugOrient +// #define DefinedDebugOrient #if defined(DefinedDebugOrient) # define DEBUG_EXECUTE(X) X @@ -453,8 +453,7 @@ SO_OrientationToString(SO_OrientationType in) return std::string("AIL"); case SO_OrientationType::ITK_COORDINATE_ORIENTATION_ASL: return "ASL"; - default: - { + default: { std::stringstream x; x << (in & 0xff) << ", " << ((in >> 8) & 0xff) << ", " << ((in >> 16) && 0xff); return x.str(); diff --git a/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx index d38942210c1..39daa27dc76 100644 --- a/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx @@ -315,8 +315,9 @@ ResampleImageFilter(maxPixelComponent); // Clamp the value between minPixelComponent and maxPixelComponent: - return (value <= minComponent) ? minPixelComponent - : (value >= maxComponent) ? maxPixelComponent : static_cast(value); + return (value <= minComponent) ? minPixelComponent + : (value >= maxComponent) ? maxPixelComponent + : static_cast(value); } diff --git a/Modules/Filtering/LabelMap/include/itkLabelMapUtilities.h b/Modules/Filtering/LabelMap/include/itkLabelMapUtilities.h index 385834c585f..54588741e1e 100644 --- a/Modules/Filtering/LabelMap/include/itkLabelMapUtilities.h +++ b/Modules/Filtering/LabelMap/include/itkLabelMapUtilities.h @@ -28,92 +28,79 @@ */ #define itkShapeLabelMapFilterDispatchMacro() \ - case LabelObjectType::LABEL: \ - { \ + case LabelObjectType::LABEL: { \ using AccessorType = typename Functor::LabelLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::NUMBER_OF_PIXELS: \ - { \ + case LabelObjectType::NUMBER_OF_PIXELS: { \ using AccessorType = typename Functor::NumberOfPixelsLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::PHYSICAL_SIZE: \ - { \ + case LabelObjectType::PHYSICAL_SIZE: { \ using AccessorType = typename Functor::PhysicalSizeLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::NUMBER_OF_PIXELS_ON_BORDER: \ - { \ + case LabelObjectType::NUMBER_OF_PIXELS_ON_BORDER: { \ using AccessorType = typename Functor::NumberOfPixelsOnBorderLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::PERIMETER_ON_BORDER: \ - { \ + case LabelObjectType::PERIMETER_ON_BORDER: { \ using AccessorType = typename Functor::PerimeterOnBorderLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::FERET_DIAMETER: \ - { \ + case LabelObjectType::FERET_DIAMETER: { \ using AccessorType = typename Functor::FeretDiameterLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::ELONGATION: \ - { \ + case LabelObjectType::ELONGATION: { \ using AccessorType = typename Functor::ElongationLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::PERIMETER: \ - { \ + case LabelObjectType::PERIMETER: { \ using AccessorType = typename Functor::PerimeterLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::ROUNDNESS: \ - { \ + case LabelObjectType::ROUNDNESS: { \ using AccessorType = typename Functor::RoundnessLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::EQUIVALENT_SPHERICAL_RADIUS: \ - { \ + case LabelObjectType::EQUIVALENT_SPHERICAL_RADIUS: { \ using AccessorType = typename Functor::EquivalentSphericalRadiusLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::EQUIVALENT_SPHERICAL_PERIMETER: \ - { \ + case LabelObjectType::EQUIVALENT_SPHERICAL_PERIMETER: { \ using AccessorType = typename Functor::EquivalentSphericalPerimeterLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::FLATNESS: \ - { \ + case LabelObjectType::FLATNESS: { \ using AccessorType = typename Functor::FlatnessLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::PERIMETER_ON_BORDER_RATIO: \ - { \ + case LabelObjectType::PERIMETER_ON_BORDER_RATIO: { \ using AccessorType = typename Functor::PerimeterOnBorderRatioLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ @@ -122,78 +109,67 @@ #define itkStatisticsLabelMapFilterDispatchMacro() \ - case LabelObjectType::MINIMUM: \ - { \ + case LabelObjectType::MINIMUM: { \ using AccessorType = typename Functor::MinimumLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::MAXIMUM: \ - { \ + case LabelObjectType::MAXIMUM: { \ using AccessorType = typename Functor::MaximumLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::MEAN: \ - { \ + case LabelObjectType::MEAN: { \ using AccessorType = typename Functor::MeanLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::SUM: \ - { \ + case LabelObjectType::SUM: { \ using AccessorType = typename Functor::SumLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::STANDARD_DEVIATION: \ - { \ + case LabelObjectType::STANDARD_DEVIATION: { \ using AccessorType = typename Functor::StandardDeviationLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::VARIANCE: \ - { \ + case LabelObjectType::VARIANCE: { \ using AccessorType = typename Functor::VarianceLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::MEDIAN: \ - { \ + case LabelObjectType::MEDIAN: { \ using AccessorType = typename Functor::MedianLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::KURTOSIS: \ - { \ + case LabelObjectType::KURTOSIS: { \ using AccessorType = typename Functor::KurtosisLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::SKEWNESS: \ - { \ + case LabelObjectType::SKEWNESS: { \ using AccessorType = typename Functor::SkewnessLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::WEIGHTED_ELONGATION: \ - { \ + case LabelObjectType::WEIGHTED_ELONGATION: { \ using AccessorType = typename Functor::WeightedElongationLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ break; \ } \ - case LabelObjectType::WEIGHTED_FLATNESS: \ - { \ + case LabelObjectType::WEIGHTED_FLATNESS: { \ using AccessorType = typename Functor::WeightedFlatnessLabelObjectAccessor; \ AccessorType accessor; \ this->TemplatedGenerateData(accessor); \ diff --git a/Modules/Filtering/LabelMap/include/itkMergeLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkMergeLabelMapFilter.hxx index 15599ba5e12..a1b6a8677c9 100644 --- a/Modules/Filtering/LabelMap/include/itkMergeLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkMergeLabelMapFilter.hxx @@ -38,28 +38,23 @@ MergeLabelMapFilter::GenerateData() switch (this->m_Method) { - case ChoiceMethodEnum::KEEP: - { + case ChoiceMethodEnum::KEEP: { this->MergeWithKeep(); break; } - case ChoiceMethodEnum::AGGREGATE: - { + case ChoiceMethodEnum::AGGREGATE: { this->MergeWithAggregate(); break; } - case ChoiceMethodEnum::PACK: - { + case ChoiceMethodEnum::PACK: { this->MergeWithPack(); break; } - case ChoiceMethodEnum::STRICT: - { + case ChoiceMethodEnum::STRICT: { this->MergeWithStrict(); break; } - default: - { + default: { itkExceptionMacro("No such method: " << this->m_Method); } } diff --git a/Modules/Filtering/LabelMap/include/itkShapePositionLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkShapePositionLabelMapFilter.hxx index e3b880320a5..3d274b76ab3 100644 --- a/Modules/Filtering/LabelMap/include/itkShapePositionLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkShapePositionLabelMapFilter.hxx @@ -37,8 +37,7 @@ ShapePositionLabelMapFilter::ThreadedProcessLabelObject(LabelObjectType { switch (m_Attribute) { - case LabelObjectType::CENTROID: - { + case LabelObjectType::CENTROID: { using AccessorType = typename Functor::CentroidLabelObjectAccessor; AccessorType accessor; this->TemplatedThreadedProcessLabelObject(accessor, true, labelObject); diff --git a/Modules/Filtering/LabelMap/include/itkStatisticsPositionLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkStatisticsPositionLabelMapFilter.hxx index fb8af46b3b5..7e59c96291c 100644 --- a/Modules/Filtering/LabelMap/include/itkStatisticsPositionLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkStatisticsPositionLabelMapFilter.hxx @@ -38,22 +38,19 @@ StatisticsPositionLabelMapFilter::ThreadedProcessLabelObject(LabelObject { switch (this->m_Attribute) { - case LabelObjectType::MAXIMUM_INDEX: - { + case LabelObjectType::MAXIMUM_INDEX: { using AccessorType = typename Functor::MaximumIndexLabelObjectAccessor; AccessorType accessor; this->TemplatedThreadedProcessLabelObject(accessor, false, labelObject); break; } - case LabelObjectType::MINIMUM_INDEX: - { + case LabelObjectType::MINIMUM_INDEX: { using AccessorType = typename Functor::MinimumIndexLabelObjectAccessor; AccessorType accessor; this->TemplatedThreadedProcessLabelObject(accessor, false, labelObject); break; } - case LabelObjectType::CENTER_OF_GRAVITY: - { + case LabelObjectType::CENTER_OF_GRAVITY: { using AccessorType = typename Functor::CenterOfGravityLabelObjectAccessor; AccessorType accessor; this->TemplatedThreadedProcessLabelObject(accessor, true, labelObject); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkAnchorOpenCloseLine.h b/Modules/Filtering/MathematicalMorphology/include/itkAnchorOpenCloseLine.h index dc0fe5ad655..81e4f01644c 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkAnchorOpenCloseLine.h +++ b/Modules/Filtering/MathematicalMorphology/include/itkAnchorOpenCloseLine.h @@ -21,7 +21,7 @@ #include "itkMorphologyHistogram.h" #include "itkIndent.h" -//#define RAWHIST +// #define RAWHIST namespace itk { diff --git a/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.h b/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.h index 71642b23a63..099c10719c0 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.h +++ b/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.h @@ -237,9 +237,11 @@ class ITK_TEMPLATE_EXPORT FlatStructuringElement : public Neighborhood static void - GeneratePolygon(TStructuringElement & res, TRadius radius, unsigned int lines); - static void GeneratePolygon(itk::FlatStructuringElement<2> & res, itk::Size<2> radius, unsigned int lines); - static void GeneratePolygon(itk::FlatStructuringElement<3> & res, itk::Size<3> radius, unsigned int lines); + GeneratePolygon(TStructuringElement & res, TRadius radius, unsigned int lines); + static void + GeneratePolygon(itk::FlatStructuringElement<2> & res, itk::Size<2> radius, unsigned int lines); + static void + GeneratePolygon(itk::FlatStructuringElement<3> & res, itk::Size<3> radius, unsigned int lines); using LType2 = Vector; diff --git a/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.hxx b/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.hxx index f1d1ad4654b..36986539941 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.hxx @@ -55,9 +55,10 @@ FlatStructuringElement::GeneratePolygon(TStructuringElement &, TRadi } template -void FlatStructuringElement::GeneratePolygon(itk::FlatStructuringElement<2> & res, - itk::Size<2> radius, - unsigned int lines) +void +FlatStructuringElement::GeneratePolygon(itk::FlatStructuringElement<2> & res, + itk::Size<2> radius, + unsigned int lines) { // radial decomposition method from "Radial Decomposition of Discs // and Spheres" - CVGIP: Graphical Models and Image Processing @@ -126,9 +127,10 @@ void FlatStructuringElement::GeneratePolygon(itk::FlatStructuringEle // O[2] = k3 * std::sin(theta); template -void FlatStructuringElement::GeneratePolygon(itk::FlatStructuringElement<3> & res, - itk::Size<3> radius, - unsigned int lines) +void +FlatStructuringElement::GeneratePolygon(itk::FlatStructuringElement<3> & res, + itk::Size<3> radius, + unsigned int lines) { res.SetRadius(radius); res.SetDecomposable(true); @@ -146,8 +148,7 @@ void FlatStructuringElement::GeneratePolygon(itk::FlatStructuringEle } switch (faces) { - case 12: - { + case 12: { // dodecahedron float phi = (1.0 + std::sqrt(5.0)) / 2.0; float b = 1.0 / phi; @@ -351,8 +352,7 @@ void FlatStructuringElement::GeneratePolygon(itk::FlatStructuringEle } } break; - case 14: - { + case 14: { // cube with the corners cut off LType3 A; // The axes @@ -401,8 +401,7 @@ void FlatStructuringElement::GeneratePolygon(itk::FlatStructuringEle res.AddLine(A); } break; - case 20: - { + case 20: { // Icosahedron float phi = (1.0 + std::sqrt(5.0)) / 2.0; float a = 0.5; @@ -717,8 +716,7 @@ void FlatStructuringElement::GeneratePolygon(itk::FlatStructuringEle } } break; - case 32: - { + case 32: { iterations = 1; // 2 iterations leads to 128 faces, which is too many // subdivision of octahedron diff --git a/Modules/Filtering/MathematicalMorphology/include/itkMathematicalMorphologyEnums.h b/Modules/Filtering/MathematicalMorphology/include/itkMathematicalMorphologyEnums.h index c3675ad7367..f0094fae724 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkMathematicalMorphologyEnums.h +++ b/Modules/Filtering/MathematicalMorphology/include/itkMathematicalMorphologyEnums.h @@ -50,7 +50,7 @@ class MathematicalMorphologyEnums /** Define how to print enumeration values. */ extern ITKMathematicalMorphology_EXPORT std::ostream & - operator<<(std::ostream & out, const MathematicalMorphologyEnums::Algorithm value); +operator<<(std::ostream & out, const MathematicalMorphologyEnums::Algorithm value); } // end namespace itk diff --git a/Modules/Filtering/MathematicalMorphology/include/itkReconstructionImageFilter.h b/Modules/Filtering/MathematicalMorphology/include/itkReconstructionImageFilter.h index 0072c465076..84db113495c 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkReconstructionImageFilter.h +++ b/Modules/Filtering/MathematicalMorphology/include/itkReconstructionImageFilter.h @@ -24,7 +24,7 @@ #include "itkProgressReporter.h" #include -//#define BASIC +// #define BASIC #define COPY #ifdef COPY diff --git a/Modules/Filtering/MathematicalMorphology/test/itkTopHatImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkTopHatImageFilterTest.cxx index f474bf89062..6a5ac4308a9 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkTopHatImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkTopHatImageFilterTest.cxx @@ -121,8 +121,7 @@ itkTopHatImageFilterTest(int argc, char * argv[]) switch (std::stoi(argv[3])) { - case 0: - { + case 0: { // Create the filter using BlackFilterType = itk::BlackTopHatImageFilter; auto filter = BlackFilterType::New(); @@ -136,8 +135,7 @@ itkTopHatImageFilterTest(int argc, char * argv[]) break; } - case 1: - { + case 1: { // Create the filter using WhiteFilterType = itk::WhiteTopHatImageFilter; auto filter = WhiteFilterType::New(); diff --git a/Modules/Filtering/Path/include/itkContourExtractor2DImageFilter.hxx b/Modules/Filtering/Path/include/itkContourExtractor2DImageFilter.hxx index a08a642dfe9..cce8cb25b48 100644 --- a/Modules/Filtering/Path/include/itkContourExtractor2DImageFilter.hxx +++ b/Modules/Filtering/Path/include/itkContourExtractor2DImageFilter.hxx @@ -371,7 +371,7 @@ ContourExtractor2DImageFilter::GenerateDataForLabels() // all 9 pixels of the extended region. const InputIndexType extendedIndex{ { bbox.min[0] - 1, bbox.min[1] - 1 } }; const InputSizeType extendedSize{ { static_cast(bbox.max[0] - bbox.min[0]) + 2, - static_cast(bbox.max[1] - bbox.min[1]) + 2 } }; + static_cast(bbox.max[1] - bbox.min[1]) + 2 } }; const InputRegionType extendedRegion{ extendedIndex, extendedSize }; totalPixelCount += extendedRegion.GetNumberOfPixels(); labelsRegions[label] = extendedRegion; diff --git a/Modules/Filtering/Path/include/itkHilbertPath.hxx b/Modules/Filtering/Path/include/itkHilbertPath.hxx index ad823f8cc37..58dab5ae922 100644 --- a/Modules/Filtering/Path/include/itkHilbertPath.hxx +++ b/Modules/Filtering/Path/include/itkHilbertPath.hxx @@ -131,16 +131,18 @@ HilbertPath::GetBitRange(const PathIndexType x, template auto -HilbertPath::GetLeftBitRotation(PathIndexType x, PathIndexType i, const PathIndexType width) - -> PathIndexType +HilbertPath::GetLeftBitRotation(PathIndexType x, + PathIndexType i, + const PathIndexType width) -> PathIndexType { return (((x << (i % width)) | (x >> (width - (i % width)))) & ((1 << width) - 1)); } template auto -HilbertPath::GetRightBitRotation(PathIndexType x, PathIndexType i, const PathIndexType width) - -> PathIndexType +HilbertPath::GetRightBitRotation(PathIndexType x, + PathIndexType i, + const PathIndexType width) -> PathIndexType { return (((x >> (i % width)) | (x << (width - (i % width)))) & ((1 << width) - 1)); } @@ -194,8 +196,8 @@ HilbertPath::GetInverseGrayCode(const PathIndexType x) template auto -HilbertPath::GetTrailingSetBits(const PathIndexType x, const PathIndexType width) - -> PathIndexType +HilbertPath::GetTrailingSetBits(const PathIndexType x, + const PathIndexType width) -> PathIndexType { PathIndexType i = 0; PathIndexType y = x; diff --git a/Modules/Filtering/Path/include/itkPathSource.hxx b/Modules/Filtering/Path/include/itkPathSource.hxx index 281a1b51d72..36916ee6906 100644 --- a/Modules/Filtering/Path/include/itkPathSource.hxx +++ b/Modules/Filtering/Path/include/itkPathSource.hxx @@ -111,7 +111,8 @@ PathSource::GraftNthOutput(unsigned int idx, TOutputPath * graft) * */ template -typename PathSource::DataObjectPointer PathSource::MakeOutput(DataObjectPointerArraySizeType) +typename PathSource::DataObjectPointer +PathSource::MakeOutput(DataObjectPointerArraySizeType) { return itkDynamicCastInDebugMode(TOutputPath::New().GetPointer()); } diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkBorderQuadEdgeMeshFilter.h b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkBorderQuadEdgeMeshFilter.h index f20d1d26d3c..c1a7014576e 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkBorderQuadEdgeMeshFilter.h +++ b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkBorderQuadEdgeMeshFilter.h @@ -53,9 +53,9 @@ class BorderQuadEdgeMeshFilterEnums }; // Define how to print enumeration extern ITKQuadEdgeMeshFiltering_EXPORT std::ostream & - operator<<(std::ostream & out, const BorderQuadEdgeMeshFilterEnums::BorderTransform value); +operator<<(std::ostream & out, const BorderQuadEdgeMeshFilterEnums::BorderTransform value); extern ITKQuadEdgeMeshFiltering_EXPORT std::ostream & - operator<<(std::ostream & out, const BorderQuadEdgeMeshFilterEnums::BorderPick value); +operator<<(std::ostream & out, const BorderQuadEdgeMeshFilterEnums::BorderPick value); /** * \class BorderQuadEdgeMeshFilter * \brief Transform one border of a QuadEdgeMesh into either a circle diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkBorderQuadEdgeMeshFilter.hxx b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkBorderQuadEdgeMeshFilter.hxx index 17b6cc4b8bf..5dc8b97fd4c 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkBorderQuadEdgeMeshFilter.hxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkBorderQuadEdgeMeshFilter.hxx @@ -326,13 +326,11 @@ BorderQuadEdgeMeshFilter::ComputeTransform() switch (this->m_TransformType) { default: - case BorderTransformEnum::SQUARE_BORDER_TRANSFORM: - { + case BorderTransformEnum::SQUARE_BORDER_TRANSFORM: { this->ArcLengthSquareTransform(); break; } - case BorderTransformEnum::DISK_BORDER_TRANSFORM: - { + case BorderTransformEnum::DISK_BORDER_TRANSFORM: { this->DiskTransform(); break; } diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkEdgeDecimationQuadEdgeMeshFilter.hxx b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkEdgeDecimationQuadEdgeMeshFilter.hxx index 97035d77222..66e98474fb5 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkEdgeDecimationQuadEdgeMeshFilter.hxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkEdgeDecimationQuadEdgeMeshFilter.hxx @@ -414,8 +414,8 @@ EdgeDecimationQuadEdgeMeshFilter::CheckQEProcessing // from the top the drawing of that case looks like an Eye itkDebugMacro("RemoveEye"); return 2; - } // end else if( OriginOrderIsTwo && DestinationOrderIsTwo ) - } // end if( OriginOrderIsTwo || DestinationOrderIsTwo ) + } // end else if( OriginOrderIsTwo && DestinationOrderIsTwo ) + } // end if( OriginOrderIsTwo || DestinationOrderIsTwo ) else // if( OriginOrderIsTwo || DestinationOrderIsTwo ) { if (NumberOfCommonVerticesIn0Ring() > 2) @@ -428,15 +428,15 @@ EdgeDecimationQuadEdgeMeshFilter::CheckQEProcessing { return 0; } - } // end else if( OriginOrderIsTwo || DestinationOrderIsTwo ) - } // end if( LeftIsTriangle && RightIsTriangle ) + } // end else if( OriginOrderIsTwo || DestinationOrderIsTwo ) + } // end if( LeftIsTriangle && RightIsTriangle ) else // if( LeftIsTriangle && RightIsTriangle ) { if (NumberOfCommonVerticesIn0Ring() > 1) { itkDebugMacro("NumberOfCommonVerticesIn0Ring( ) > 1"); return 4; - } // end if( NumberOfCommonVerticesIn0Ring( ) > 1 ) + } // end if( NumberOfCommonVerticesIn0Ring( ) > 1 ) else // if( NumberOfCommonVerticesIn0Ring( ) > 1 ) { if (RightIsTriangle) @@ -448,9 +448,9 @@ EdgeDecimationQuadEdgeMeshFilter::CheckQEProcessing return 6; } } // end else if( NumberOfCommonVerticesIn0Ring( ) > 1 ) - } // end else if( LeftIsTriangle && RightIsTriangle ) - } // end if( LeftIsTriangle || RightIsTriangle ) - else // if( LeftIsTriangle || RightIsTriangle ) + } // end else if( LeftIsTriangle && RightIsTriangle ) + } // end if( LeftIsTriangle || RightIsTriangle ) + else // if( LeftIsTriangle || RightIsTriangle ) { if (NumberOfCommonVerticesIn0Ring() > 0) { diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkLaplacianDeformationQuadEdgeMeshFilter.h b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkLaplacianDeformationQuadEdgeMeshFilter.h index fde213a53a0..87811dc4dd7 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkLaplacianDeformationQuadEdgeMeshFilter.h +++ b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkLaplacianDeformationQuadEdgeMeshFilter.h @@ -48,7 +48,7 @@ class LaplacianDeformationQuadEdgeMeshFilterEnums }; // Define how to print enumeration extern ITKQuadEdgeMeshFiltering_EXPORT std::ostream & - operator<<(std::ostream & out, const LaplacianDeformationQuadEdgeMeshFilterEnums::Area value); +operator<<(std::ostream & out, const LaplacianDeformationQuadEdgeMeshFilterEnums::Area value); /** \class LaplacianDeformationQuadEdgeMeshFilter * diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkNormalQuadEdgeMeshFilter.h b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkNormalQuadEdgeMeshFilter.h index d7e73d7e04f..0c35a242ad6 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkNormalQuadEdgeMeshFilter.h +++ b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkNormalQuadEdgeMeshFilter.h @@ -43,7 +43,7 @@ class NormalQuadEdgeMeshFilterEnums }; // Define how to print enumeration extern ITKQuadEdgeMeshFiltering_EXPORT std::ostream & - operator<<(std::ostream & out, const NormalQuadEdgeMeshFilterEnums::Weight value); +operator<<(std::ostream & out, const NormalQuadEdgeMeshFilterEnums::Weight value); /** \class NormalQuadEdgeMeshFilter * diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkNormalQuadEdgeMeshFilter.hxx b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkNormalQuadEdgeMeshFilter.hxx index a9ea5825ce4..c615f0a96ad 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkNormalQuadEdgeMeshFilter.hxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkNormalQuadEdgeMeshFilter.hxx @@ -158,12 +158,10 @@ NormalQuadEdgeMeshFilter::Weight(const OutputPointIdent switch (m_Weight) { default: - case WeightEnum::GOURAUD: - { + case WeightEnum::GOURAUD: { return static_cast(1.); } - case WeightEnum::THURMER: - { + case WeightEnum::THURMER: { // this implementation may be included inside itkTriangle switch (internal_id) { @@ -195,8 +193,7 @@ NormalQuadEdgeMeshFilter::Weight(const OutputPointIdent } return static_cast(std::acos(u * v)); } - case WeightEnum::AREA: - { + case WeightEnum::AREA: { return static_cast(TriangleType::ComputeArea(pt[0], pt[1], pt[2])); } } diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkQuadEdgeMeshDecimationQuadricElementHelper.h b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkQuadEdgeMeshDecimationQuadricElementHelper.h index 0546ab9b285..540b42ebec7 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/include/itkQuadEdgeMeshDecimationQuadricElementHelper.h +++ b/Modules/Filtering/QuadEdgeMeshFiltering/include/itkQuadEdgeMeshDecimationQuadricElementHelper.h @@ -236,7 +236,8 @@ class QuadEdgeMeshDecimationQuadricElementHelper return *this; } - Self operator*(const CoordType & iV) const + Self + operator*(const CoordType & iV) const { Self oElement(this->m_Coefficients * iV); diff --git a/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx index 8836f88b3bd..97926961a0f 100644 --- a/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx @@ -227,8 +227,8 @@ BinomialBlurImageFilter::GenerateData() ++tempReverseIt; } // end walk the image backwards - } // end dimension loop - } // end number of repetitions loop + } // end dimension loop + } // end number of repetitions loop // Now, copy the temporary image to the output image. Note that the temp // buffer iterator walks a region defined by the output diff --git a/Modules/Filtering/Smoothing/include/itkFFTDiscreteGaussianImageFilter.h b/Modules/Filtering/Smoothing/include/itkFFTDiscreteGaussianImageFilter.h index 8dcfd3dcc6d..e9857486f42 100644 --- a/Modules/Filtering/Smoothing/include/itkFFTDiscreteGaussianImageFilter.h +++ b/Modules/Filtering/Smoothing/include/itkFFTDiscreteGaussianImageFilter.h @@ -56,7 +56,7 @@ class FFTDiscreteGaussianImageFilterEnums }; // Define how to print enumeration extern ITKSmoothing_EXPORT std::ostream & - operator<<(std::ostream & out, const FFTDiscreteGaussianImageFilterEnums::KernelSource value); +operator<<(std::ostream & out, const FFTDiscreteGaussianImageFilterEnums::KernelSource value); /** * \class FFTDiscreteGaussianImageFilter diff --git a/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.hxx index b8bbb4bb1fb..f16317d832d 100644 --- a/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkRecursiveGaussianImageFilter.hxx @@ -123,8 +123,7 @@ RecursiveGaussianImageFilter::SetUp(ScalarRealType sp switch (m_Order) { - case GaussianOrderEnum::ZeroOrder: - { + case GaussianOrderEnum::ZeroOrder: { // Approximation of convolution with a gaussian. ComputeNCoefficients( sigmad, A1[0], B1[0], W1, L1, A2[0], B2[0], W2, L2, this->m_N0, this->m_N1, this->m_N2, this->m_N3, SN, DN, EN); @@ -138,8 +137,7 @@ RecursiveGaussianImageFilter::SetUp(ScalarRealType sp this->ComputeRemainingCoefficients(symmetric); break; } - case GaussianOrderEnum::FirstOrder: - { + case GaussianOrderEnum::FirstOrder: { if (this->GetNormalizeAcrossScale()) { across_scale_normalization = m_Sigma; @@ -161,8 +159,7 @@ RecursiveGaussianImageFilter::SetUp(ScalarRealType sp this->ComputeRemainingCoefficients(symmetric); break; } - case GaussianOrderEnum::SecondOrder: - { + case GaussianOrderEnum::SecondOrder: { if (this->GetNormalizeAcrossScale()) { across_scale_normalization = itk::Math::sqr(m_Sigma); @@ -198,8 +195,7 @@ RecursiveGaussianImageFilter::SetUp(ScalarRealType sp this->ComputeRemainingCoefficients(symmetric); break; } - default: - { + default: { itkExceptionMacro("Unknown Order"); } } diff --git a/Modules/Filtering/Thresholding/include/itkHistogramThresholdCalculator.h b/Modules/Filtering/Thresholding/include/itkHistogramThresholdCalculator.h index 52fdf9fed20..2a512d64dc8 100644 --- a/Modules/Filtering/Thresholding/include/itkHistogramThresholdCalculator.h +++ b/Modules/Filtering/Thresholding/include/itkHistogramThresholdCalculator.h @@ -95,7 +95,8 @@ class HistogramThresholdCalculator : public ProcessObject } using Superclass::MakeOutput; - typename DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType) override + typename DataObject::Pointer + MakeOutput(DataObjectPointerArraySizeType) override { return DecoratedOutputType::New().GetPointer(); } diff --git a/Modules/Filtering/Thresholding/include/itkLiThresholdCalculator.hxx b/Modules/Filtering/Thresholding/include/itkLiThresholdCalculator.hxx index e19c533be00..ddfbf4b3092 100644 --- a/Modules/Filtering/Thresholding/include/itkLiThresholdCalculator.hxx +++ b/Modules/Filtering/Thresholding/include/itkLiThresholdCalculator.hxx @@ -121,7 +121,7 @@ LiThresholdCalculator::GenerateData() // return ( int ) ( IS_NEG ( x ) ? x - .5 : x + .5 ); //} // - //#define IS_NEG( x ) ( ( x ) < -DBL_EPSILON ) + // #define IS_NEG( x ) ( ( x ) < -DBL_EPSILON ) // // Shift the mean by the minimum to have the range start at zero, diff --git a/Modules/IO/BMP/src/itkBMPImageIO.cxx b/Modules/IO/BMP/src/itkBMPImageIO.cxx index 31ae8b11e41..d20f814bce0 100644 --- a/Modules/IO/BMP/src/itkBMPImageIO.cxx +++ b/Modules/IO/BMP/src/itkBMPImageIO.cxx @@ -563,8 +563,7 @@ BMPImageIO::ReadImageInformation() { case 1: case 4: - case 8: - { + case 8: { if (this->GetExpandRGBPalette()) { this->SetNumberOfComponents(3); @@ -578,14 +577,12 @@ BMPImageIO::ReadImageInformation() } break; } - case 24: - { + case 24: { this->SetNumberOfComponents(3); m_PixelType = IOPixelEnum::RGB; break; } - case 32: - { + case 32: { this->SetNumberOfComponents(4); m_PixelType = IOPixelEnum::RGBA; break; @@ -600,8 +597,7 @@ BMPImageIO::SwapBytesIfNecessary(void * buffer, SizeValueType numberOfPixels) { switch (m_ComponentType) { - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { if (m_ByteOrder == IOByteOrderEnum::LittleEndian) { ByteSwapper::SwapRangeFromSystemToLittleEndian((char *)buffer, numberOfPixels); @@ -612,8 +608,7 @@ BMPImageIO::SwapBytesIfNecessary(void * buffer, SizeValueType numberOfPixels) } break; } - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { if (m_ByteOrder == IOByteOrderEnum::LittleEndian) { ByteSwapper::SwapRangeFromSystemToLittleEndian((unsigned char *)buffer, numberOfPixels); @@ -624,8 +619,7 @@ BMPImageIO::SwapBytesIfNecessary(void * buffer, SizeValueType numberOfPixels) } break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { if (m_ByteOrder == IOByteOrderEnum::LittleEndian) { ByteSwapper::SwapRangeFromSystemToLittleEndian((short *)buffer, numberOfPixels); @@ -636,8 +630,7 @@ BMPImageIO::SwapBytesIfNecessary(void * buffer, SizeValueType numberOfPixels) } break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { if (m_ByteOrder == IOByteOrderEnum::LittleEndian) { ByteSwapper::SwapRangeFromSystemToLittleEndian((unsigned short *)buffer, numberOfPixels); diff --git a/Modules/IO/BMP/src/itkBMPImageIOFactory.cxx b/Modules/IO/BMP/src/itkBMPImageIOFactory.cxx index b24f4f9a849..bf8682b2f4d 100644 --- a/Modules/IO/BMP/src/itkBMPImageIOFactory.cxx +++ b/Modules/IO/BMP/src/itkBMPImageIOFactory.cxx @@ -44,7 +44,7 @@ BMPImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOBMP_EXPORT - BMPImageIOFactoryRegister__Private() +BMPImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/BioRad/src/itkBioRadImageIOFactory.cxx b/Modules/IO/BioRad/src/itkBioRadImageIOFactory.cxx index 524b2876858..5193a6a701d 100644 --- a/Modules/IO/BioRad/src/itkBioRadImageIOFactory.cxx +++ b/Modules/IO/BioRad/src/itkBioRadImageIOFactory.cxx @@ -54,7 +54,7 @@ BioRadImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOBioRad_EXPORT - BioRadImageIOFactoryRegister__Private() +BioRadImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/Bruker/src/itkBruker2dseqImageIOFactory.cxx b/Modules/IO/Bruker/src/itkBruker2dseqImageIOFactory.cxx index 9573d17f0c0..58caa877192 100644 --- a/Modules/IO/Bruker/src/itkBruker2dseqImageIOFactory.cxx +++ b/Modules/IO/Bruker/src/itkBruker2dseqImageIOFactory.cxx @@ -57,7 +57,7 @@ Bruker2dseqImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOBruker_EXPORT - Bruker2dseqImageIOFactoryRegister__Private() +Bruker2dseqImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/DCMTK/src/itkDCMTKImageIOFactory.cxx b/Modules/IO/DCMTK/src/itkDCMTKImageIOFactory.cxx index 177cd5bc3ab..68a5b9676f3 100644 --- a/Modules/IO/DCMTK/src/itkDCMTKImageIOFactory.cxx +++ b/Modules/IO/DCMTK/src/itkDCMTKImageIOFactory.cxx @@ -44,7 +44,7 @@ DCMTKImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIODCMTK_EXPORT - DCMTKImageIOFactoryRegister__Private() +DCMTKImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/GDCM/src/itkGDCMImageIO.cxx b/Modules/IO/GDCM/src/itkGDCMImageIO.cxx index 9ff147e5c3b..9358cb066c4 100644 --- a/Modules/IO/GDCM/src/itkGDCMImageIO.cxx +++ b/Modules/IO/GDCM/src/itkGDCMImageIO.cxx @@ -643,8 +643,7 @@ GDCMImageIO::InternalReadImageInformation() case gdcm::MediaStorage::UltrasoundMultiFrameImageStorage: case gdcm::MediaStorage::UltrasoundImageStorage: // ?? case gdcm::MediaStorage::UltrasoundImageStorageRetired: - case gdcm::MediaStorage::UltrasoundMultiFrameImageStorageRetired: - { + case gdcm::MediaStorage::UltrasoundMultiFrameImageStorageRetired: { std::vector sp; gdcm::Tag spacingTag(0x0028, 0x0030); if (ds.FindDataElement(spacingTag) && !ds.GetDataElement(spacingTag).IsEmpty()) @@ -679,8 +678,7 @@ GDCMImageIO::InternalReadImageInformation() spacing[2] = 1.0; // punt? } break; - default: - { + default: { const double * sp; sp = image.GetSpacing(); spacing[0] = sp[0]; diff --git a/Modules/IO/GDCM/src/itkGDCMImageIOFactory.cxx b/Modules/IO/GDCM/src/itkGDCMImageIOFactory.cxx index 875d907d404..a8d3e535618 100644 --- a/Modules/IO/GDCM/src/itkGDCMImageIOFactory.cxx +++ b/Modules/IO/GDCM/src/itkGDCMImageIOFactory.cxx @@ -44,7 +44,7 @@ GDCMImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOGDCM_EXPORT - GDCMImageIOFactoryRegister__Private() +GDCMImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/GE/src/itkGE4ImageIOFactory.cxx b/Modules/IO/GE/src/itkGE4ImageIOFactory.cxx index 71ae577f3be..b699384a7a7 100644 --- a/Modules/IO/GE/src/itkGE4ImageIOFactory.cxx +++ b/Modules/IO/GE/src/itkGE4ImageIOFactory.cxx @@ -48,7 +48,7 @@ GE4ImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOGE_EXPORT - GE4ImageIOFactoryRegister__Private() +GE4ImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/GE/src/itkGE5ImageIOFactory.cxx b/Modules/IO/GE/src/itkGE5ImageIOFactory.cxx index bae43aac4ef..25a3173ebea 100644 --- a/Modules/IO/GE/src/itkGE5ImageIOFactory.cxx +++ b/Modules/IO/GE/src/itkGE5ImageIOFactory.cxx @@ -48,7 +48,7 @@ GE5ImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOGE_EXPORT - GE5ImageIOFactoryRegister__Private() +GE5ImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/GE/src/itkGEAdwImageIOFactory.cxx b/Modules/IO/GE/src/itkGEAdwImageIOFactory.cxx index 78640abfe03..4fa05f06bb2 100644 --- a/Modules/IO/GE/src/itkGEAdwImageIOFactory.cxx +++ b/Modules/IO/GE/src/itkGEAdwImageIOFactory.cxx @@ -48,7 +48,7 @@ GEAdwImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOGE_EXPORT - GEAdwImageIOFactoryRegister__Private() +GEAdwImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/GIPL/src/itkGiplImageIO.cxx b/Modules/IO/GIPL/src/itkGiplImageIO.cxx index e3c0da1b838..d24323badaa 100644 --- a/Modules/IO/GIPL/src/itkGiplImageIO.cxx +++ b/Modules/IO/GIPL/src/itkGiplImageIO.cxx @@ -614,8 +614,7 @@ GiplImageIO::SwapBytesIfNecessary(void * buffer, SizeValueType numberOfPixels) { switch (m_ComponentType) { - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { if (m_ByteOrder == IOByteOrderEnum::LittleEndian) { ByteSwapper::SwapRangeFromSystemToLittleEndian((char *)buffer, numberOfPixels); @@ -626,8 +625,7 @@ GiplImageIO::SwapBytesIfNecessary(void * buffer, SizeValueType numberOfPixels) } break; } - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { if (m_ByteOrder == IOByteOrderEnum::LittleEndian) { ByteSwapper::SwapRangeFromSystemToLittleEndian((unsigned char *)buffer, numberOfPixels); @@ -638,8 +636,7 @@ GiplImageIO::SwapBytesIfNecessary(void * buffer, SizeValueType numberOfPixels) } break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { if (m_ByteOrder == IOByteOrderEnum::LittleEndian) { ByteSwapper::SwapRangeFromSystemToLittleEndian((short *)buffer, numberOfPixels); @@ -650,8 +647,7 @@ GiplImageIO::SwapBytesIfNecessary(void * buffer, SizeValueType numberOfPixels) } break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { if (m_ByteOrder == IOByteOrderEnum::LittleEndian) { ByteSwapper::SwapRangeFromSystemToLittleEndian((unsigned short *)buffer, numberOfPixels); @@ -662,8 +658,7 @@ GiplImageIO::SwapBytesIfNecessary(void * buffer, SizeValueType numberOfPixels) } break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { if (m_ByteOrder == IOByteOrderEnum::LittleEndian) { ByteSwapper::SwapRangeFromSystemToLittleEndian((float *)buffer, numberOfPixels); @@ -674,8 +669,7 @@ GiplImageIO::SwapBytesIfNecessary(void * buffer, SizeValueType numberOfPixels) } break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { if (m_ByteOrder == IOByteOrderEnum::LittleEndian) { ByteSwapper::SwapRangeFromSystemToLittleEndian((double *)buffer, numberOfPixels); diff --git a/Modules/IO/GIPL/src/itkGiplImageIOFactory.cxx b/Modules/IO/GIPL/src/itkGiplImageIOFactory.cxx index 4266557ece5..d75f996f564 100644 --- a/Modules/IO/GIPL/src/itkGiplImageIOFactory.cxx +++ b/Modules/IO/GIPL/src/itkGiplImageIOFactory.cxx @@ -44,7 +44,7 @@ GiplImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOGIPL_EXPORT - GiplImageIOFactoryRegister__Private() +GiplImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/HDF5/src/itkHDF5ImageIOFactory.cxx b/Modules/IO/HDF5/src/itkHDF5ImageIOFactory.cxx index bcf77763909..16608693a53 100644 --- a/Modules/IO/HDF5/src/itkHDF5ImageIOFactory.cxx +++ b/Modules/IO/HDF5/src/itkHDF5ImageIOFactory.cxx @@ -48,7 +48,7 @@ HDF5ImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOHDF5_EXPORT - HDF5ImageIOFactoryRegister__Private() +HDF5ImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/IPL/include/itkIPLFileNameList.h b/Modules/IO/IPL/include/itkIPLFileNameList.h index 53edc5133b9..0f92776ffc5 100644 --- a/Modules/IO/IPL/include/itkIPLFileNameList.h +++ b/Modules/IO/IPL/include/itkIPLFileNameList.h @@ -55,7 +55,10 @@ #define IPLGetMacroDeclaration(name, type) virtual type Get##name(); #define IPLGetMacroDefinition(class, name, type) \ - type class ::Get##name() { return this->m_##name; } + type class ::Get##name() \ + { \ + return this->m_##name; \ + } namespace itk { @@ -162,7 +165,8 @@ class ITKIOIPL_EXPORT IPLFileNameList return m_List.end(); } - IPLFileSortInfo * operator[](unsigned int __n) + IPLFileSortInfo * + operator[](unsigned int __n) { auto it = begin(); auto itend = end(); diff --git a/Modules/IO/ImageBase/include/itkConvertPixelBuffer.hxx b/Modules/IO/ImageBase/include/itkConvertPixelBuffer.hxx index 1f1918d18e2..5f868e3f500 100644 --- a/Modules/IO/ImageBase/include/itkConvertPixelBuffer.hxx +++ b/Modules/IO/ImageBase/include/itkConvertPixelBuffer.hxx @@ -52,8 +52,7 @@ ConvertPixelBuffer::Conver switch (OutputConvertTraits::GetNumberOfComponents()) { // output number of components is 1 - case 1: - { + case 1: { switch (inputNumberOfComponents) { case 1: @@ -72,8 +71,7 @@ ConvertPixelBuffer::Conver break; } // handle the complex case - case 2: - { + case 2: { switch (inputNumberOfComponents) { case 1: @@ -90,8 +88,7 @@ ConvertPixelBuffer::Conver } // output number of components is 3 RGB - case 3: - { + case 3: { switch (inputNumberOfComponents) { case 1: @@ -109,8 +106,7 @@ ConvertPixelBuffer::Conver break; } // output number of components is 4 RGBA - case 4: - { + case 4: { switch (inputNumberOfComponents) { case 1: @@ -128,8 +124,7 @@ ConvertPixelBuffer::Conver break; } // output number of components is 6 (SymmetricSecondRankTensor) - case 6: - { + case 6: { switch (inputNumberOfComponents) { case 6: @@ -145,8 +140,7 @@ ConvertPixelBuffer::Conver } break; } - default: - { + default: { if (inputNumberOfComponents == static_cast(OutputConvertTraits::GetNumberOfComponents())) { ConvertVectorToVector(inputData, inputNumberOfComponents, outputData, size); diff --git a/Modules/IO/ImageBase/src/itkImageIOBase.cxx b/Modules/IO/ImageBase/src/itkImageIOBase.cxx index 24e26d9aec9..e98ec613282 100644 --- a/Modules/IO/ImageBase/src/itkImageIOBase.cxx +++ b/Modules/IO/ImageBase/src/itkImageIOBase.cxx @@ -726,95 +726,83 @@ ImageIOBase::WriteBufferAsASCII(std::ostream & os, { switch (ctype) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { using Type = const unsigned char *; auto buf = static_cast(buffer); WriteBuffer(os, buf, numComp); } break; - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { using Type = const char *; auto buf = static_cast(buffer); WriteBuffer(os, buf, numComp); } break; - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { using Type = const unsigned short *; auto buf = static_cast(buffer); WriteBuffer(os, buf, numComp); } break; - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { using Type = const short *; auto buf = static_cast(buffer); WriteBuffer(os, buf, numComp); } break; - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { using Type = const unsigned int *; auto buf = static_cast(buffer); WriteBuffer(os, buf, numComp); } break; - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { using Type = const int *; auto buf = static_cast(buffer); WriteBuffer(os, buf, numComp); } break; - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { using Type = const unsigned long *; auto buf = static_cast(buffer); WriteBuffer(os, buf, numComp); } break; - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { using Type = const long *; auto buf = static_cast(buffer); WriteBuffer(os, buf, numComp); } break; - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { using Type = const unsigned long long *; auto buf = static_cast(buffer); WriteBuffer(os, buf, numComp); } break; - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { using Type = const long long *; auto buf = static_cast(buffer); WriteBuffer(os, buf, numComp); } break; - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { using Type = const float *; auto buf = static_cast(buffer); WriteBuffer(os, buf, numComp); } break; - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { using Type = const double *; auto buf = static_cast(buffer); WriteBuffer(os, buf, numComp); @@ -847,84 +835,72 @@ ImageIOBase::ReadBufferAsASCII(std::istream & is, void * buffer, IOComponentEnum { switch (ctype) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { auto * buf = static_cast(buffer); ReadBuffer(is, buf, numComp); } break; - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { auto * buf = static_cast(buffer); ReadBuffer(is, buf, numComp); } break; - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { auto * buf = static_cast(buffer); ReadBuffer(is, buf, numComp); } break; - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { auto * buf = static_cast(buffer); ReadBuffer(is, buf, numComp); } break; - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { auto * buf = static_cast(buffer); ReadBuffer(is, buf, numComp); } break; - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { auto * buf = static_cast(buffer); ReadBuffer(is, buf, numComp); } break; - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { auto * buf = static_cast(buffer); ReadBuffer(is, buf, numComp); } break; - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { auto * buf = static_cast(buffer); ReadBuffer(is, buf, numComp); } break; - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { auto * buf = static_cast(buffer); ReadBuffer(is, buf, numComp); } break; - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { auto * buf = static_cast(buffer); ReadBuffer(is, buf, numComp); } break; - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { auto * buf = static_cast(buffer); ReadBuffer(is, buf, numComp); } break; - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { auto * buf = static_cast(buffer); ReadBuffer(is, buf, numComp); } diff --git a/Modules/IO/ImageBase/test/itkImageIOBaseTest.cxx b/Modules/IO/ImageBase/test/itkImageIOBaseTest.cxx index 6359df5105b..8aa6279a8b3 100644 --- a/Modules/IO/ImageBase/test/itkImageIOBaseTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageIOBaseTest.cxx @@ -133,35 +133,35 @@ itkImageIOBaseTest(int, char *[]) itk::IOComponentEnum::FLOAT, itk::IOComponentEnum::DOUBLE }; const char * listComponentTypeString[] = { "unknown", "unsigned_char", "char", "unsigned_short", - "short", "unsigned_int", "int", "unsigned_long", - "long", "unsigned_long_long", "long_long", "float", - "double" }; + "short", "unsigned_int", "int", "unsigned_long", + "long", "unsigned_long_long", "long_long", "float", + "double" }; itk::IOPixelEnum listIOPixelType[] = { itk::IOPixelEnum::UNKNOWNPIXELTYPE, - itk::IOPixelEnum::SCALAR, - itk::IOPixelEnum::RGB, - itk::IOPixelEnum::RGBA, - itk::IOPixelEnum::OFFSET, - itk::IOPixelEnum::VECTOR, - itk::IOPixelEnum::POINT, - itk::IOPixelEnum::COVARIANTVECTOR, - itk::IOPixelEnum::SYMMETRICSECONDRANKTENSOR, - itk::IOPixelEnum::DIFFUSIONTENSOR3D, - itk::IOPixelEnum::COMPLEX, - itk::IOPixelEnum::FIXEDARRAY, - itk::IOPixelEnum::MATRIX }; + itk::IOPixelEnum::SCALAR, + itk::IOPixelEnum::RGB, + itk::IOPixelEnum::RGBA, + itk::IOPixelEnum::OFFSET, + itk::IOPixelEnum::VECTOR, + itk::IOPixelEnum::POINT, + itk::IOPixelEnum::COVARIANTVECTOR, + itk::IOPixelEnum::SYMMETRICSECONDRANKTENSOR, + itk::IOPixelEnum::DIFFUSIONTENSOR3D, + itk::IOPixelEnum::COMPLEX, + itk::IOPixelEnum::FIXEDARRAY, + itk::IOPixelEnum::MATRIX }; const char * listIOPixelTypeString[] = { "unknown", - "scalar", - "rgb", - "rgba", - "offset", - "vector", - "point", - "covariant_vector", - "symmetric_second_rank_tensor", - "diffusion_tensor_3D", - "complex", - "fixed_array", - "matrix" }; + "scalar", + "rgb", + "rgba", + "offset", + "vector", + "point", + "covariant_vector", + "symmetric_second_rank_tensor", + "diffusion_tensor_3D", + "complex", + "fixed_array", + "matrix" }; // Compile time verification that the array lengths are correct for type and name static_assert(std::size(listComponentType) == std::size(listComponentTypeString), "listComponentType and listComponentTypeString must be same length"); diff --git a/Modules/IO/ImageBase/test/itkUnicodeIOTest.cxx b/Modules/IO/ImageBase/test/itkUnicodeIOTest.cxx index 833c97c6e00..f28c177213d 100644 --- a/Modules/IO/ImageBase/test/itkUnicodeIOTest.cxx +++ b/Modules/IO/ImageBase/test/itkUnicodeIOTest.cxx @@ -43,7 +43,7 @@ checkAlphaExists() utf8_str.append(1, '\xCE'); utf8_str.append(1, '\xB1'); utf8_str += ".txt"; - FILE * tmp = fopen(utf8_str.c_str(), "r"); + FILE * tmp = fopen(utf8_str.c_str(), "r"); #endif if (tmp != nullptr) { diff --git a/Modules/IO/JPEG/src/itkJPEGImageIOFactory.cxx b/Modules/IO/JPEG/src/itkJPEGImageIOFactory.cxx index 23e67e734c2..73770ed702a 100644 --- a/Modules/IO/JPEG/src/itkJPEGImageIOFactory.cxx +++ b/Modules/IO/JPEG/src/itkJPEGImageIOFactory.cxx @@ -44,7 +44,7 @@ JPEGImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOJPEG_EXPORT - JPEGImageIOFactoryRegister__Private() +JPEGImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx b/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx index 3592573d7fd..bf7f83fe119 100644 --- a/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx +++ b/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx @@ -182,8 +182,7 @@ JPEG2000ImageIO::ReadImageInformation() switch (this->m_Internal->m_DecompressionParameters.decod_format) { - case static_cast(JPEG2000ImageIOInternal::DecodingFormatEnum::J2K_CFMT): - { + case static_cast(JPEG2000ImageIOInternal::DecodingFormatEnum::J2K_CFMT): { /* JPEG-2000 codestream */ /* get a decoder handle */ @@ -198,8 +197,7 @@ JPEG2000ImageIO::ReadImageInformation() } break; } - case static_cast(JPEG2000ImageIOInternal::DecodingFormatEnum::JP2_CFMT): - { + case static_cast(JPEG2000ImageIOInternal::DecodingFormatEnum::JP2_CFMT): { /* JPEG 2000 compressed image data */ /* get a decoder handle */ this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JP2); @@ -213,8 +211,7 @@ JPEG2000ImageIO::ReadImageInformation() } break; } - case static_cast(JPEG2000ImageIOInternal::DecodingFormatEnum::JPT_CFMT): - { + case static_cast(JPEG2000ImageIOInternal::DecodingFormatEnum::JPT_CFMT): { /* JPEG 2000, JPIP */ /* get a decoder handle */ this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JPT); @@ -393,8 +390,7 @@ JPEG2000ImageIO::Read(void * buffer) /* ---------------------- */ switch (this->m_Internal->m_DecompressionParameters.decod_format) { - case static_cast(JPEG2000ImageIOInternal::DecodingFormatEnum::J2K_CFMT): - { + case static_cast(JPEG2000ImageIOInternal::DecodingFormatEnum::J2K_CFMT): { /* JPEG-2000 codestream */ /* get a decoder handle */ this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_J2K); @@ -406,8 +402,7 @@ JPEG2000ImageIO::Read(void * buffer) } break; } - case static_cast(JPEG2000ImageIOInternal::DecodingFormatEnum::JP2_CFMT): - { + case static_cast(JPEG2000ImageIOInternal::DecodingFormatEnum::JP2_CFMT): { /* JPEG 2000 compressed image data */ /* get a decoder handle */ this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JP2); @@ -419,8 +414,7 @@ JPEG2000ImageIO::Read(void * buffer) } break; } - case static_cast(JPEG2000ImageIOInternal::DecodingFormatEnum::JPT_CFMT): - { + case static_cast(JPEG2000ImageIOInternal::DecodingFormatEnum::JPT_CFMT): { /* JPEG 2000, JPIP */ /* get a decoder handle */ this->m_Internal->m_Dinfo = opj_create_decompress(CODEC_JPT); diff --git a/Modules/IO/JPEG2000/src/itkJPEG2000ImageIOFactory.cxx b/Modules/IO/JPEG2000/src/itkJPEG2000ImageIOFactory.cxx index 3da92e2332b..ed491b569fc 100644 --- a/Modules/IO/JPEG2000/src/itkJPEG2000ImageIOFactory.cxx +++ b/Modules/IO/JPEG2000/src/itkJPEG2000ImageIOFactory.cxx @@ -45,7 +45,7 @@ JPEG2000ImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOJPEG2000_EXPORT - JPEG2000ImageIOFactoryRegister__Private() +JPEG2000ImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/LSM/src/itkLSMImageIOFactory.cxx b/Modules/IO/LSM/src/itkLSMImageIOFactory.cxx index 1f9b918186a..6ee139a92a0 100644 --- a/Modules/IO/LSM/src/itkLSMImageIOFactory.cxx +++ b/Modules/IO/LSM/src/itkLSMImageIOFactory.cxx @@ -54,7 +54,7 @@ LSMImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOLSM_EXPORT - LSMImageIOFactoryRegister__Private() +LSMImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/MINC/src/itkMINCImageIO.cxx b/Modules/IO/MINC/src/itkMINCImageIO.cxx index c22ea94a3f1..7275228e2b6 100644 --- a/Modules/IO/MINC/src/itkMINCImageIO.cxx +++ b/Modules/IO/MINC/src/itkMINCImageIO.cxx @@ -629,7 +629,7 @@ MINCImageIO::ReadImageInformation() else { this->SetPixelType(IOPixelEnum::VECTOR); // TODO: handle more types (i.e matrix, - } // tensor etc) + } // tensor etc) break; case MI_CLASS_INT: if (numberOfComponents == 1) @@ -639,7 +639,7 @@ MINCImageIO::ReadImageInformation() else { this->SetPixelType(IOPixelEnum::VECTOR); // TODO: handle more types (i.e matrix, - } // tensor etc) + } // tensor etc) break; case MI_CLASS_LABEL: if (numberOfComponents == 1) @@ -776,8 +776,7 @@ MINCImageIO::ReadImageInformation() { switch (att_data_type) { - case MI_TYPE_STRING: - { + case MI_TYPE_STRING: { const auto tmp = make_unique_for_overwrite(att_length + 1); if (miget_attr_values( m_MINCPImpl->m_Volume, att_data_type, group_name, attribute, att_length + 1, tmp.get()) == @@ -787,8 +786,7 @@ MINCImageIO::ReadImageInformation() } } break; - case MI_TYPE_FLOAT: - { + case MI_TYPE_FLOAT: { Array tmp(att_length); if (miget_attr_values( m_MINCPImpl->m_Volume, att_data_type, group_name, attribute, att_length, tmp.data_block()) == @@ -809,8 +807,7 @@ MINCImageIO::ReadImageInformation() } } break; - case MI_TYPE_DOUBLE: - { + case MI_TYPE_DOUBLE: { Array tmp(att_length); if (miget_attr_values( m_MINCPImpl->m_Volume, att_data_type, group_name, attribute, att_length, tmp.data_block()) == @@ -827,8 +824,7 @@ MINCImageIO::ReadImageInformation() } } break; - case MI_TYPE_INT: - { + case MI_TYPE_INT: { Array tmp(att_length); if (miget_attr_values( m_MINCPImpl->m_Volume, att_data_type, group_name, attribute, att_length, tmp.data_block()) == diff --git a/Modules/IO/MINC/src/itkMINCImageIOFactory.cxx b/Modules/IO/MINC/src/itkMINCImageIOFactory.cxx index dd398b10dce..d8b8ce5e58e 100644 --- a/Modules/IO/MINC/src/itkMINCImageIOFactory.cxx +++ b/Modules/IO/MINC/src/itkMINCImageIOFactory.cxx @@ -44,7 +44,7 @@ MINCImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOMINC_EXPORT - MINCImageIOFactoryRegister__Private() +MINCImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/MRC/src/itkMRCImageIO.cxx b/Modules/IO/MRC/src/itkMRCImageIO.cxx index ce9c38d159a..436cbbf1aa1 100644 --- a/Modules/IO/MRC/src/itkMRCImageIO.cxx +++ b/Modules/IO/MRC/src/itkMRCImageIO.cxx @@ -133,8 +133,7 @@ MRCImageIO::ReadImageInformation() // fixed types defined by header switch (header.mode) { - case MRCHeaderObject::MRCHEADER_MODE_INT8: - { + case MRCHeaderObject::MRCHEADER_MODE_INT8: { // There has been some confusion and inconsistency whether this // mode is signed or unsigned, but now MRC2014 clearly defines it // as signed. @@ -150,22 +149,19 @@ MRCImageIO::ReadImageInformation() this->SetPixelType(IOPixelEnum::SCALAR); break; } - case MRCHeaderObject::MRCHEADER_MODE_IN16: - { + case MRCHeaderObject::MRCHEADER_MODE_IN16: { this->SetComponentType(IOComponentEnum::SHORT); this->SetNumberOfComponents(1); this->SetPixelType(IOPixelEnum::SCALAR); break; } - case MRCHeaderObject::MRCHEADER_MODE_FLOAT: - { + case MRCHeaderObject::MRCHEADER_MODE_FLOAT: { this->SetComponentType(IOComponentEnum::FLOAT); this->SetNumberOfComponents(1); this->SetPixelType(IOPixelEnum::SCALAR); break; } - case MRCHeaderObject::MRCHEADER_MODE_COMPLEX_INT16: - { + case MRCHeaderObject::MRCHEADER_MODE_COMPLEX_INT16: { // ITK does not support short complex well // but if the program has gotten this far we can just write it out this->SetComponentType(IOComponentEnum::SHORT); @@ -173,29 +169,25 @@ MRCImageIO::ReadImageInformation() this->SetPixelType(IOPixelEnum::COMPLEX); break; } - case MRCHeaderObject::MRCHEADER_MODE_COMPLEX_FLOAT: - { + case MRCHeaderObject::MRCHEADER_MODE_COMPLEX_FLOAT: { this->SetComponentType(IOComponentEnum::FLOAT); this->SetNumberOfComponents(2); this->SetPixelType(IOPixelEnum::COMPLEX); break; } - case MRCHeaderObject::MRCHEADER_MODE_UINT16: - { + case MRCHeaderObject::MRCHEADER_MODE_UINT16: { this->SetComponentType(IOComponentEnum::USHORT); this->SetNumberOfComponents(1); this->SetPixelType(IOPixelEnum::SCALAR); break; } - case MRCHeaderObject::MRCHEADER_MODE_RGB_BYTE: - { + case MRCHeaderObject::MRCHEADER_MODE_RGB_BYTE: { this->SetComponentType(IOComponentEnum::UCHAR); this->SetNumberOfComponents(3); this->SetPixelType(IOPixelEnum::RGB); break; } - default: - { + default: { itkExceptionMacro("Unrecognized mode"); } } @@ -470,26 +462,22 @@ MRCImageIO::UpdateHeaderWithMinMaxMean(const void * bufferBegin) switch (header.mode) { - case 0: - { + case 0: { // scalar unsigned char this->UpdateHeaderWithMinMaxMean(static_cast(bufferBegin)); break; } - case 1: - { + case 1: { // scalar short this->UpdateHeaderWithMinMaxMean(static_cast(bufferBegin)); break; } - case 2: - { + case 2: { // scalar float this->UpdateHeaderWithMinMaxMean(static_cast(bufferBegin)); break; } - case 3: - { + case 3: { // complex short // What is the best way to map complex to float? @@ -499,8 +487,7 @@ MRCImageIO::UpdateHeaderWithMinMaxMean(const void * bufferBegin) m_MRCHeader->m_Header.amean = 0.0f; break; } - case 4: - { + case 4: { // complex float // What is the best way to map complex to float? @@ -510,14 +497,12 @@ MRCImageIO::UpdateHeaderWithMinMaxMean(const void * bufferBegin) m_MRCHeader->m_Header.amean = 0.0f; break; } - case 6: - { + case 6: { // scalar unsigned short this->UpdateHeaderWithMinMaxMean(static_cast(bufferBegin)); break; } - case 16: - { + case 16: { // RGB of unsigned char // just set resonable values @@ -526,8 +511,7 @@ MRCImageIO::UpdateHeaderWithMinMaxMean(const void * bufferBegin) m_MRCHeader->m_Header.amean = 127.5f; break; } - default: - { + default: { itkExceptionMacro("Unrecognized mode"); } } diff --git a/Modules/IO/MRC/src/itkMRCImageIOFactory.cxx b/Modules/IO/MRC/src/itkMRCImageIOFactory.cxx index b2dcb68a1dd..90cb152a08c 100644 --- a/Modules/IO/MRC/src/itkMRCImageIOFactory.cxx +++ b/Modules/IO/MRC/src/itkMRCImageIOFactory.cxx @@ -54,7 +54,7 @@ MRCImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOMRC_EXPORT - MRCImageIOFactoryRegister__Private() +MRCImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/MeshBYU/src/itkBYUMeshIO.cxx b/Modules/IO/MeshBYU/src/itkBYUMeshIO.cxx index 6b5dd033876..5f8a49c7f91 100644 --- a/Modules/IO/MeshBYU/src/itkBYUMeshIO.cxx +++ b/Modules/IO/MeshBYU/src/itkBYUMeshIO.cxx @@ -327,85 +327,71 @@ BYUMeshIO::WritePoints(void * buffer) // Write points switch (this->m_PointComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { WritePoints(static_cast(buffer), outputFile); break; } - default: - { + default: { itkExceptionMacro("Unknown point pixel component type" << std::endl); } } @@ -435,73 +421,59 @@ BYUMeshIO::WriteCells(void * buffer) // Write polygons switch (this->m_CellComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { WriteCells(static_cast(buffer), outputFile); break; } - default: - { + default: { itkExceptionMacro("Unknown cell pixel component type" << std::endl); } } diff --git a/Modules/IO/MeshBYU/src/itkBYUMeshIOFactory.cxx b/Modules/IO/MeshBYU/src/itkBYUMeshIOFactory.cxx index 661c946a911..d379396fb1a 100644 --- a/Modules/IO/MeshBYU/src/itkBYUMeshIOFactory.cxx +++ b/Modules/IO/MeshBYU/src/itkBYUMeshIOFactory.cxx @@ -53,7 +53,7 @@ BYUMeshIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOMeshBYU_EXPORT - BYUMeshIOFactoryRegister__Private() +BYUMeshIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/MeshBase/include/itkMeshFileReader.hxx b/Modules/IO/MeshBase/include/itkMeshFileReader.hxx index 11adb7c5c5c..88874436e86 100644 --- a/Modules/IO/MeshBase/include/itkMeshFileReader.hxx +++ b/Modules/IO/MeshBase/include/itkMeshFileReader.hxx @@ -131,8 +131,7 @@ MeshFileReader::Re auto type = static_cast(static_cast(buffer[index++])); switch (type) { - case CellGeometryEnum::VERTEX_CELL: - { + case CellGeometryEnum::VERTEX_CELL: { auto numberOfPoints = static_cast(buffer[index++]); if (numberOfPoints != OutputVertexCellType::NumberOfPoints) { @@ -149,8 +148,7 @@ MeshFileReader::Re output->SetCell(id++, cell); break; } - case CellGeometryEnum::LINE_CELL: - { + case CellGeometryEnum::LINE_CELL: { // for polylines will be loaded as individual edges. auto numberOfPoints = static_cast(buffer[index++]); if (numberOfPoints < 2) @@ -170,8 +168,7 @@ MeshFileReader::Re } break; } - case CellGeometryEnum::POLYLINE_CELL: - { + case CellGeometryEnum::POLYLINE_CELL: { auto numberOfPoints = static_cast(buffer[index++]); if (numberOfPoints < 2) { @@ -190,8 +187,7 @@ MeshFileReader::Re output->SetCell(id++, cell); break; } - case CellGeometryEnum::TRIANGLE_CELL: - { + case CellGeometryEnum::TRIANGLE_CELL: { auto numberOfPoints = static_cast(buffer[index++]); if (numberOfPoints != OutputTriangleCellType::NumberOfPoints) { @@ -209,8 +205,7 @@ MeshFileReader::Re output->SetCell(id++, cell); break; } - case CellGeometryEnum::QUADRILATERAL_CELL: - { + case CellGeometryEnum::QUADRILATERAL_CELL: { auto numberOfPoints = static_cast(buffer[index++]); if (numberOfPoints != OutputQuadrilateralCellType::NumberOfPoints) { @@ -228,8 +223,7 @@ MeshFileReader::Re output->SetCell(id++, cell); break; } - case CellGeometryEnum::POLYGON_CELL: - { + case CellGeometryEnum::POLYGON_CELL: { // For polyhedron, if the number of points is 3, then we treat it as // triangle cell OutputCellAutoPointer cell; @@ -256,8 +250,7 @@ MeshFileReader::Re output->SetCell(id++, cell); break; } - case CellGeometryEnum::TETRAHEDRON_CELL: - { + case CellGeometryEnum::TETRAHEDRON_CELL: { auto numberOfPoints = static_cast(buffer[index++]); if (numberOfPoints != OutputTetrahedronCellType::NumberOfPoints) { @@ -275,8 +268,7 @@ MeshFileReader::Re output->SetCell(id++, cell); break; } - case CellGeometryEnum::HEXAHEDRON_CELL: - { + case CellGeometryEnum::HEXAHEDRON_CELL: { auto numberOfPoints = static_cast(buffer[index++]); if (numberOfPoints != OutputHexahedronCellType::NumberOfPoints) { @@ -294,8 +286,7 @@ MeshFileReader::Re output->SetCell(id++, cell); break; } - case CellGeometryEnum::QUADRATIC_EDGE_CELL: - { + case CellGeometryEnum::QUADRATIC_EDGE_CELL: { auto numberOfPoints = static_cast(buffer[index++]); if (numberOfPoints != OutputQuadraticEdgeCellType::NumberOfPoints) { @@ -313,8 +304,7 @@ MeshFileReader::Re output->SetCell(id++, cell); break; } - case CellGeometryEnum::QUADRATIC_TRIANGLE_CELL: - { + case CellGeometryEnum::QUADRATIC_TRIANGLE_CELL: { auto numberOfPoints = static_cast(buffer[index++]); if (numberOfPoints != OutputQuadraticTriangleCellType::NumberOfPoints) { @@ -332,8 +322,7 @@ MeshFileReader::Re output->SetCell(id++, cell); break; } - default: - { + default: { itkExceptionMacro("Unknown cell type"); } } @@ -511,74 +500,60 @@ MeshFileReader::Ge { switch (m_MeshIO->GetPointComponentType()) { - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { Self::ReadPointsUsingMeshIO(); break; } - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { Self::ReadPointsUsingMeshIO(); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { Self::ReadPointsUsingMeshIO(); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { Self::ReadPointsUsingMeshIO(); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { Self::ReadPointsUsingMeshIO(); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { Self::ReadPointsUsingMeshIO(); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { Self::ReadPointsUsingMeshIO(); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { Self::ReadPointsUsingMeshIO(); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { Self::ReadPointsUsingMeshIO(); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { Self::ReadPointsUsingMeshIO(); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { Self::ReadPointsUsingMeshIO(); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { Self::ReadPointsUsingMeshIO(); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { Self::ReadPointsUsingMeshIO(); break; } case IOComponentEnum::UNKNOWNCOMPONENTTYPE: - default: - { + default: { itkExceptionMacro("Unknown point component type"); } } @@ -589,74 +564,60 @@ MeshFileReader::Ge { switch (m_MeshIO->GetCellComponentType()) { - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { Self::ReadCellsUsingMeshIO(); break; } - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { Self::ReadCellsUsingMeshIO(); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { Self::ReadCellsUsingMeshIO(); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { Self::ReadCellsUsingMeshIO(); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { Self::ReadCellsUsingMeshIO(); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { Self::ReadCellsUsingMeshIO(); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { Self::ReadCellsUsingMeshIO(); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { Self::ReadCellsUsingMeshIO(); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { Self::ReadCellsUsingMeshIO(); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { Self::ReadCellsUsingMeshIO(); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { Self::ReadCellsUsingMeshIO(); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { Self::ReadCellsUsingMeshIO(); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { Self::ReadCellsUsingMeshIO(); break; } case IOComponentEnum::UNKNOWNCOMPONENTTYPE: - default: - { + default: { itkExceptionMacro("Unknown cell component type"); } } diff --git a/Modules/IO/MeshFreeSurfer/src/itkFreeSurferAsciiMeshIO.cxx b/Modules/IO/MeshFreeSurfer/src/itkFreeSurferAsciiMeshIO.cxx index 93f79ca1c5d..fa93965f5bc 100644 --- a/Modules/IO/MeshFreeSurfer/src/itkFreeSurferAsciiMeshIO.cxx +++ b/Modules/IO/MeshFreeSurfer/src/itkFreeSurferAsciiMeshIO.cxx @@ -243,85 +243,71 @@ FreeSurferAsciiMeshIO::WritePoints(void * buffer) // Write points switch (this->m_PointComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { WritePoints(static_cast(buffer), outputFile); break; } - default: - { + default: { itkExceptionMacro("Unknown point pixel component type" << std::endl); } } @@ -351,73 +337,59 @@ FreeSurferAsciiMeshIO::WriteCells(void * buffer) // Write triangles switch (this->m_CellComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { WriteCells(static_cast(buffer), outputFile); break; } - default: - { + default: { itkExceptionMacro("Unknown cell pixel component type" << std::endl); } } diff --git a/Modules/IO/MeshFreeSurfer/src/itkFreeSurferAsciiMeshIOFactory.cxx b/Modules/IO/MeshFreeSurfer/src/itkFreeSurferAsciiMeshIOFactory.cxx index 4c95b3af450..e0fffe4b8c5 100644 --- a/Modules/IO/MeshFreeSurfer/src/itkFreeSurferAsciiMeshIOFactory.cxx +++ b/Modules/IO/MeshFreeSurfer/src/itkFreeSurferAsciiMeshIOFactory.cxx @@ -53,7 +53,7 @@ FreeSurferAsciiMeshIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOMeshFreeSurfer_EXPORT - FreeSurferAsciiMeshIOFactoryRegister__Private() +FreeSurferAsciiMeshIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/MeshFreeSurfer/src/itkFreeSurferBinaryMeshIO.cxx b/Modules/IO/MeshFreeSurfer/src/itkFreeSurferBinaryMeshIO.cxx index e50bb88cc35..c242b4dc90e 100644 --- a/Modules/IO/MeshFreeSurfer/src/itkFreeSurferBinaryMeshIO.cxx +++ b/Modules/IO/MeshFreeSurfer/src/itkFreeSurferBinaryMeshIO.cxx @@ -348,85 +348,71 @@ FreeSurferBinaryMeshIO::WritePoints(void * buffer) // Write points switch (this->m_PointComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { WritePoints(static_cast(buffer), outputFile); break; } - default: - { + default: { itkExceptionMacro("Unknown point pixel component type" << std::endl); } } @@ -456,73 +442,59 @@ FreeSurferBinaryMeshIO::WriteCells(void * buffer) // Write triangles switch (this->m_CellComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { WriteCells(static_cast(buffer), outputFile); break; } - default: - { + default: { itkExceptionMacro("Unknown cell component type" << std::endl); } } @@ -552,85 +524,71 @@ FreeSurferBinaryMeshIO::WritePointData(void * buffer) // Write point data switch (this->m_PointPixelComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { WritePointData(static_cast(buffer), outputFile); break; } - default: - { + default: { itkExceptionMacro("Unknown point data pixel component type" << std::endl); } } diff --git a/Modules/IO/MeshFreeSurfer/src/itkFreeSurferBinaryMeshIOFactory.cxx b/Modules/IO/MeshFreeSurfer/src/itkFreeSurferBinaryMeshIOFactory.cxx index f25a8cab6ec..1fa62a382ba 100644 --- a/Modules/IO/MeshFreeSurfer/src/itkFreeSurferBinaryMeshIOFactory.cxx +++ b/Modules/IO/MeshFreeSurfer/src/itkFreeSurferBinaryMeshIOFactory.cxx @@ -53,7 +53,7 @@ FreeSurferBinaryMeshIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOMeshFreeSurfer_EXPORT - FreeSurferBinaryMeshIOFactoryRegister__Private() +FreeSurferBinaryMeshIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/MeshGifti/src/itkGiftiMeshIO.cxx b/Modules/IO/MeshGifti/src/itkGiftiMeshIO.cxx index a5414b79870..6b4e821254c 100644 --- a/Modules/IO/MeshGifti/src/itkGiftiMeshIO.cxx +++ b/Modules/IO/MeshGifti/src/itkGiftiMeshIO.cxx @@ -37,7 +37,11 @@ class GiftiMeshIO::GiftiImageProxy operator gifti_image *() { return m_ptr; } - gifti_image * operator->() { return m_ptr; } + gifti_image * + operator->() + { + return m_ptr; + } }; @@ -483,8 +487,7 @@ GiftiMeshIO::ReadCells(void * buffer) { switch (this->m_CellComponentType) { - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { this->WriteCellsBuffer(static_cast(m_GiftiImage->darray[ii]->data), static_cast(buffer), CellGeometryEnum::TRIANGLE_CELL, @@ -492,8 +495,7 @@ GiftiMeshIO::ReadCells(void * buffer) this->m_NumberOfCells); break; } - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { this->WriteCellsBuffer(static_cast(m_GiftiImage->darray[ii]->data), static_cast(buffer), CellGeometryEnum::TRIANGLE_CELL, @@ -501,8 +503,7 @@ GiftiMeshIO::ReadCells(void * buffer) this->m_NumberOfCells); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { this->WriteCellsBuffer(static_cast(m_GiftiImage->darray[ii]->data), static_cast(buffer), CellGeometryEnum::TRIANGLE_CELL, @@ -510,8 +511,7 @@ GiftiMeshIO::ReadCells(void * buffer) this->m_NumberOfCells); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { this->WriteCellsBuffer(static_cast(m_GiftiImage->darray[ii]->data), static_cast(buffer), CellGeometryEnum::TRIANGLE_CELL, @@ -519,8 +519,7 @@ GiftiMeshIO::ReadCells(void * buffer) this->m_NumberOfCells); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { this->WriteCellsBuffer(static_cast(m_GiftiImage->darray[ii]->data), static_cast(buffer), CellGeometryEnum::TRIANGLE_CELL, @@ -528,8 +527,7 @@ GiftiMeshIO::ReadCells(void * buffer) this->m_NumberOfCells); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { this->WriteCellsBuffer(static_cast(m_GiftiImage->darray[ii]->data), static_cast(buffer), CellGeometryEnum::TRIANGLE_CELL, @@ -537,8 +535,7 @@ GiftiMeshIO::ReadCells(void * buffer) this->m_NumberOfCells); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { this->WriteCellsBuffer(static_cast(m_GiftiImage->darray[ii]->data), static_cast(buffer), CellGeometryEnum::TRIANGLE_CELL, @@ -546,8 +543,7 @@ GiftiMeshIO::ReadCells(void * buffer) this->m_NumberOfCells); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { this->WriteCellsBuffer(static_cast(m_GiftiImage->darray[ii]->data), static_cast(buffer), CellGeometryEnum::TRIANGLE_CELL, @@ -555,8 +551,7 @@ GiftiMeshIO::ReadCells(void * buffer) this->m_NumberOfCells); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { this->WriteCellsBuffer(static_cast(m_GiftiImage->darray[ii]->data), static_cast(buffer), CellGeometryEnum::TRIANGLE_CELL, @@ -564,8 +559,7 @@ GiftiMeshIO::ReadCells(void * buffer) this->m_NumberOfCells); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { this->WriteCellsBuffer(static_cast(m_GiftiImage->darray[ii]->data), static_cast(buffer), CellGeometryEnum::TRIANGLE_CELL, @@ -573,8 +567,7 @@ GiftiMeshIO::ReadCells(void * buffer) this->m_NumberOfCells); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { this->WriteCellsBuffer(static_cast(m_GiftiImage->darray[ii]->data), static_cast(buffer), CellGeometryEnum::TRIANGLE_CELL, @@ -582,8 +575,7 @@ GiftiMeshIO::ReadCells(void * buffer) this->m_NumberOfCells); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { this->WriteCellsBuffer(static_cast(m_GiftiImage->darray[ii]->data), static_cast(buffer), CellGeometryEnum::TRIANGLE_CELL, @@ -591,8 +583,7 @@ GiftiMeshIO::ReadCells(void * buffer) this->m_NumberOfCells); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { this->WriteCellsBuffer(static_cast(m_GiftiImage->darray[ii]->data), static_cast(buffer), CellGeometryEnum::TRIANGLE_CELL, @@ -600,8 +591,7 @@ GiftiMeshIO::ReadCells(void * buffer) this->m_NumberOfCells); break; } - default: - { + default: { gifti_free_image(m_GiftiImage); itkExceptionMacro("Unknown cell data pixel component type" << std::endl); } @@ -1065,91 +1055,77 @@ GiftiMeshIO::WritePoints(void * buffer) { switch (this->m_PointComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointsBufferSize); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointsBufferSize); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointsBufferSize); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointsBufferSize); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointsBufferSize); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointsBufferSize); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointsBufferSize); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointsBufferSize); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointsBufferSize); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointsBufferSize); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointsBufferSize); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointsBufferSize); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointsBufferSize); break; } - default: - { + default: { gifti_free_image(m_GiftiImage); itkExceptionMacro("Unknown point component type" << std::endl); } @@ -1168,80 +1144,66 @@ GiftiMeshIO::WriteCells(void * buffer) { switch (this->m_CellComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { this->ReadCellsBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data)); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { this->ReadCellsBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data)); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { this->ReadCellsBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data)); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { this->ReadCellsBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data)); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { this->ReadCellsBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data)); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { this->ReadCellsBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data)); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { this->ReadCellsBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data)); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { this->ReadCellsBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data)); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { this->ReadCellsBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data)); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { this->ReadCellsBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data)); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { this->ReadCellsBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data)); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { this->ReadCellsBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data)); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { this->ReadCellsBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data)); break; } - default: - { + default: { gifti_free_image(m_GiftiImage); itkExceptionMacro("Unknown cell component type" << std::endl); } @@ -1264,93 +1226,79 @@ GiftiMeshIO::WritePointData(void * buffer) const SizeValueType pointDataBufferSize = this->m_NumberOfPointPixels * this->m_NumberOfPointPixelComponents; switch (this->m_PointPixelComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - default: - { + default: { gifti_free_image(m_GiftiImage); itkExceptionMacro("Unknown point data pixel component type" << std::endl); } @@ -1365,93 +1313,79 @@ GiftiMeshIO::WritePointData(void * buffer) switch (this->m_PointPixelComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), pointDataBufferSize); break; } - default: - { + default: { gifti_free_image(m_GiftiImage); itkExceptionMacro("Unknown point data pixel component type" << std::endl); } @@ -1475,93 +1409,79 @@ GiftiMeshIO::WriteCellData(void * buffer) const SizeValueType cellDataBufferSize = this->m_NumberOfCellPixels * this->m_NumberOfCellPixelComponents; switch (this->m_CellPixelComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - default: - { + default: { gifti_free_image(m_GiftiImage); itkExceptionMacro("Unknown cell data pixel component type" << std::endl); } @@ -1576,92 +1496,78 @@ GiftiMeshIO::WriteCellData(void * buffer) switch (this->m_CellPixelComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { ConvertBuffer( static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { ConvertBuffer(static_cast(buffer), static_cast(m_GiftiImage->darray[ii]->data), cellDataBufferSize); break; } - default: - { + default: { gifti_free_image(m_GiftiImage); itkExceptionMacro("Unknown cell data pixel component type" << std::endl); } diff --git a/Modules/IO/MeshGifti/src/itkGiftiMeshIOFactory.cxx b/Modules/IO/MeshGifti/src/itkGiftiMeshIOFactory.cxx index 84ccbc0f3f6..c36384cdc19 100644 --- a/Modules/IO/MeshGifti/src/itkGiftiMeshIOFactory.cxx +++ b/Modules/IO/MeshGifti/src/itkGiftiMeshIOFactory.cxx @@ -50,7 +50,7 @@ GiftiMeshIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOMeshGifti_EXPORT - GiftiMeshIOFactoryRegister__Private() +GiftiMeshIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/MeshOBJ/src/itkOBJMeshIO.cxx b/Modules/IO/MeshOBJ/src/itkOBJMeshIO.cxx index 5cc1aef2e7a..c9ab97547a0 100644 --- a/Modules/IO/MeshOBJ/src/itkOBJMeshIO.cxx +++ b/Modules/IO/MeshOBJ/src/itkOBJMeshIO.cxx @@ -392,85 +392,71 @@ OBJMeshIO::WritePoints(void * buffer) // Write points switch (this->m_PointComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { WritePoints(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { WritePoints(static_cast(buffer), outputFile); break; } - default: - { + default: { itkExceptionMacro("Unknown point component type" << std::endl); } } @@ -501,73 +487,59 @@ OBJMeshIO::WriteCells(void * buffer) switch (this->m_CellComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { WriteCells(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { WriteCells(static_cast(buffer), outputFile); break; } - default: - { + default: { itkExceptionMacro("Unknown cell component type" << std::endl); } } @@ -605,85 +577,71 @@ OBJMeshIO::WritePointData(void * buffer) // Write point data switch (this->m_PointPixelComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { WritePointData(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { WritePointData(static_cast(buffer), outputFile); break; } - default: - { + default: { itkExceptionMacro("Unknown point data pixel component type" << std::endl); } } diff --git a/Modules/IO/MeshOBJ/src/itkOBJMeshIOFactory.cxx b/Modules/IO/MeshOBJ/src/itkOBJMeshIOFactory.cxx index 302e7cd7025..5dbab165f9e 100644 --- a/Modules/IO/MeshOBJ/src/itkOBJMeshIOFactory.cxx +++ b/Modules/IO/MeshOBJ/src/itkOBJMeshIOFactory.cxx @@ -49,7 +49,7 @@ OBJMeshIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOMeshOBJ_EXPORT - OBJMeshIOFactoryRegister__Private() +OBJMeshIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/MeshOFF/src/itkOFFMeshIO.cxx b/Modules/IO/MeshOFF/src/itkOFFMeshIO.cxx index 9aea1c22428..c210671562d 100644 --- a/Modules/IO/MeshOFF/src/itkOFFMeshIO.cxx +++ b/Modules/IO/MeshOFF/src/itkOFFMeshIO.cxx @@ -414,85 +414,71 @@ OFFMeshIO::WritePoints(void * buffer) { switch (this->m_PointComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { WriteBufferAsAscii(static_cast(buffer), outputFile, m_NumberOfPoints, m_PointDimension); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { WriteBufferAsAscii(static_cast(buffer), outputFile, m_NumberOfPoints, m_PointDimension); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { WriteBufferAsAscii(static_cast(buffer), outputFile, m_NumberOfPoints, m_PointDimension); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { WriteBufferAsAscii(static_cast(buffer), outputFile, m_NumberOfPoints, m_PointDimension); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { WriteBufferAsAscii(static_cast(buffer), outputFile, m_NumberOfPoints, m_PointDimension); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { WriteBufferAsAscii(static_cast(buffer), outputFile, m_NumberOfPoints, m_PointDimension); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { WriteBufferAsAscii(static_cast(buffer), outputFile, m_NumberOfPoints, m_PointDimension); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { WriteBufferAsAscii(static_cast(buffer), outputFile, m_NumberOfPoints, m_PointDimension); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { WriteBufferAsAscii(static_cast(buffer), outputFile, m_NumberOfPoints, m_PointDimension); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { WriteBufferAsAscii(static_cast(buffer), outputFile, m_NumberOfPoints, m_PointDimension); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { WriteBufferAsAscii(static_cast(buffer), outputFile, m_NumberOfPoints, m_PointDimension); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { WriteBufferAsAscii(static_cast(buffer), outputFile, m_NumberOfPoints, m_PointDimension); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { WriteBufferAsAscii(static_cast(buffer), outputFile, m_NumberOfPoints, m_PointDimension); break; } - default: - { + default: { itkExceptionMacro("Unknown point pixel component type" << std::endl); } } @@ -501,90 +487,76 @@ OFFMeshIO::WritePoints(void * buffer) { switch (this->m_PointComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { WriteBufferAsBinary( static_cast(buffer), outputFile, m_NumberOfPoints * m_PointDimension); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { WriteBufferAsBinary(static_cast(buffer), outputFile, m_NumberOfPoints * m_PointDimension); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { WriteBufferAsBinary( static_cast(buffer), outputFile, m_NumberOfPoints * m_PointDimension); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { WriteBufferAsBinary(static_cast(buffer), outputFile, m_NumberOfPoints * m_PointDimension); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { WriteBufferAsBinary( static_cast(buffer), outputFile, m_NumberOfPoints * m_PointDimension); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { WriteBufferAsBinary(static_cast(buffer), outputFile, m_NumberOfPoints * m_PointDimension); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { WriteBufferAsBinary( static_cast(buffer), outputFile, m_NumberOfPoints * m_PointDimension); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { WriteBufferAsBinary(static_cast(buffer), outputFile, m_NumberOfPoints * m_PointDimension); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { WriteBufferAsBinary( static_cast(buffer), outputFile, m_NumberOfPoints * m_PointDimension); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { WriteBufferAsBinary(static_cast(buffer), outputFile, m_NumberOfPoints * m_PointDimension); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { WriteBufferAsBinary(static_cast(buffer), outputFile, m_NumberOfPoints * m_PointDimension); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { WriteBufferAsBinary(static_cast(buffer), outputFile, m_NumberOfPoints * m_PointDimension); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { WriteBufferAsBinary(static_cast(buffer), outputFile, m_NumberOfPoints * m_PointDimension); break; } - default: - { + default: { itkExceptionMacro("Unknown point pixel component type" << std::endl); } } @@ -625,86 +597,72 @@ OFFMeshIO::WriteCells(void * buffer) { switch (this->m_CellComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { WriteCellsAsAscii(static_cast(buffer), outputFile); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { WriteCellsAsAscii(static_cast(buffer), outputFile); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { WriteCellsAsAscii(static_cast(buffer), outputFile); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { WriteCellsAsAscii(static_cast(buffer), outputFile); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { WriteCellsAsAscii(static_cast(buffer), outputFile); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { WriteCellsAsAscii(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { WriteCellsAsAscii(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { WriteCellsAsAscii(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { WriteCellsAsAscii(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { WriteCellsAsAscii(static_cast(buffer), outputFile); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { WriteCellsAsAscii(static_cast(buffer), outputFile); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { WriteCellsAsAscii(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { WriteCellsAsAscii(static_cast(buffer), outputFile); break; } - default: - { + default: { itkExceptionMacro("Unknown cell pixel component type" << std::endl); } } @@ -713,86 +671,72 @@ OFFMeshIO::WriteCells(void * buffer) { switch (this->m_CellComponentType) { - case IOComponentEnum::UCHAR: - { + case IOComponentEnum::UCHAR: { WriteCellsAsBinary(static_cast(buffer), outputFile); break; } - case IOComponentEnum::CHAR: - { + case IOComponentEnum::CHAR: { WriteCellsAsBinary(static_cast(buffer), outputFile); break; } - case IOComponentEnum::USHORT: - { + case IOComponentEnum::USHORT: { WriteCellsAsBinary(static_cast(buffer), outputFile); break; } - case IOComponentEnum::SHORT: - { + case IOComponentEnum::SHORT: { WriteCellsAsBinary(static_cast(buffer), outputFile); break; } - case IOComponentEnum::UINT: - { + case IOComponentEnum::UINT: { WriteCellsAsBinary(static_cast(buffer), outputFile); break; } - case IOComponentEnum::INT: - { + case IOComponentEnum::INT: { WriteCellsAsBinary(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONG: - { + case IOComponentEnum::ULONG: { WriteCellsAsBinary(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONG: - { + case IOComponentEnum::LONG: { WriteCellsAsBinary(static_cast(buffer), outputFile); break; } - case IOComponentEnum::ULONGLONG: - { + case IOComponentEnum::ULONGLONG: { WriteCellsAsBinary(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LONGLONG: - { + case IOComponentEnum::LONGLONG: { WriteCellsAsBinary(static_cast(buffer), outputFile); break; } - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { WriteCellsAsBinary(static_cast(buffer), outputFile); break; } - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { WriteCellsAsBinary(static_cast(buffer), outputFile); break; } - case IOComponentEnum::LDOUBLE: - { + case IOComponentEnum::LDOUBLE: { WriteCellsAsBinary(static_cast(buffer), outputFile); break; } - default: - { + default: { itkExceptionMacro("Unknown cell pixel component type" << std::endl); } } diff --git a/Modules/IO/MeshOFF/src/itkOFFMeshIOFactory.cxx b/Modules/IO/MeshOFF/src/itkOFFMeshIOFactory.cxx index 52461d5b2e9..68208d8db25 100644 --- a/Modules/IO/MeshOFF/src/itkOFFMeshIOFactory.cxx +++ b/Modules/IO/MeshOFF/src/itkOFFMeshIOFactory.cxx @@ -49,7 +49,7 @@ OFFMeshIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOMeshOFF_EXPORT - OFFMeshIOFactoryRegister__Private() +OFFMeshIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/MeshVTK/include/itkVTKPolyDataMeshIO.h b/Modules/IO/MeshVTK/include/itkVTKPolyDataMeshIO.h index 0e2ac1fe137..73a778a3fe2 100644 --- a/Modules/IO/MeshVTK/include/itkVTKPolyDataMeshIO.h +++ b/Modules/IO/MeshVTK/include/itkVTKPolyDataMeshIO.h @@ -682,8 +682,7 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase outputFile << "POINT_DATA " << this->m_NumberOfPointPixels << '\n'; switch (this->m_PointPixelType) { - case IOPixelEnum::SCALAR: - { + case IOPixelEnum::SCALAR: { outputFile << "SCALARS "; ExposeMetaData(metaDic, "pointScalarDataName", dataName); outputFile << dataName << " "; @@ -692,24 +691,21 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase case IOPixelEnum::OFFSET: case IOPixelEnum::POINT: case IOPixelEnum::COVARIANTVECTOR: - case IOPixelEnum::VECTOR: - { + case IOPixelEnum::VECTOR: { outputFile << "VECTORS "; ExposeMetaData(metaDic, "pointVectorDataName", dataName); outputFile << dataName << " "; break; } case IOPixelEnum::SYMMETRICSECONDRANKTENSOR: - case IOPixelEnum::DIFFUSIONTENSOR3D: - { + case IOPixelEnum::DIFFUSIONTENSOR3D: { outputFile << "TENSORS "; ExposeMetaData(metaDic, "pointTensorDataName", dataName); outputFile << dataName << " "; break; } case IOPixelEnum::ARRAY: - case IOPixelEnum::VARIABLELENGTHVECTOR: - { + case IOPixelEnum::VARIABLELENGTHVECTOR: { outputFile << "COLOR_SCALARS "; ExposeMetaData(metaDic, "pointColorScalarDataName", dataName); outputFile << dataName << " "; @@ -717,8 +713,7 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase outputFile, buffer, this->m_NumberOfPointPixelComponents, this->m_NumberOfPointPixels); return; } - default: - { + default: { itkExceptionMacro("Unknown point pixel type"); } } @@ -813,8 +808,7 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase outputFile << "POINT_DATA " << this->m_NumberOfPointPixels << '\n'; switch (this->m_PointPixelType) { - case IOPixelEnum::SCALAR: - { + case IOPixelEnum::SCALAR: { outputFile << "SCALARS "; ExposeMetaData(metaDic, "pointScalarDataName", dataName); outputFile << dataName << " "; @@ -823,24 +817,21 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase case IOPixelEnum::OFFSET: case IOPixelEnum::POINT: case IOPixelEnum::COVARIANTVECTOR: - case IOPixelEnum::VECTOR: - { + case IOPixelEnum::VECTOR: { outputFile << "VECTORS "; ExposeMetaData(metaDic, "pointVectorDataName", dataName); outputFile << dataName << " "; break; } case IOPixelEnum::SYMMETRICSECONDRANKTENSOR: - case IOPixelEnum::DIFFUSIONTENSOR3D: - { + case IOPixelEnum::DIFFUSIONTENSOR3D: { outputFile << "TENSORS "; ExposeMetaData(metaDic, "pointTensorDataName", dataName); outputFile << dataName << " "; break; } case IOPixelEnum::ARRAY: - case IOPixelEnum::VARIABLELENGTHVECTOR: - { + case IOPixelEnum::VARIABLELENGTHVECTOR: { outputFile << "COLOR_SCALARS "; ExposeMetaData(metaDic, "pointColorScalarDataName", dataName); outputFile << dataName << " "; @@ -848,8 +839,7 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase outputFile, buffer, this->m_NumberOfPointPixelComponents, this->m_NumberOfPointPixels); return; } - default: - { + default: { itkExceptionMacro("Unknown point pixel type"); } } @@ -876,8 +866,7 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase outputFile << "CELL_DATA " << this->m_NumberOfCellPixels << '\n'; switch (this->m_CellPixelType) { - case IOPixelEnum::SCALAR: - { + case IOPixelEnum::SCALAR: { outputFile << "SCALARS "; ExposeMetaData(metaDic, "cellScalarDataName", dataName); outputFile << dataName << " "; @@ -886,24 +875,21 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase case IOPixelEnum::OFFSET: case IOPixelEnum::POINT: case IOPixelEnum::COVARIANTVECTOR: - case IOPixelEnum::VECTOR: - { + case IOPixelEnum::VECTOR: { outputFile << "VECTORS "; ExposeMetaData(metaDic, "cellVectorDataName", dataName); outputFile << dataName << " "; break; } case IOPixelEnum::SYMMETRICSECONDRANKTENSOR: - case IOPixelEnum::DIFFUSIONTENSOR3D: - { + case IOPixelEnum::DIFFUSIONTENSOR3D: { outputFile << "TENSORS "; ExposeMetaData(metaDic, "cellTensorDataName", dataName); outputFile << dataName << " "; break; } case IOPixelEnum::ARRAY: - case IOPixelEnum::VARIABLELENGTHVECTOR: - { + case IOPixelEnum::VARIABLELENGTHVECTOR: { outputFile << "COLOR_SCALARS "; ExposeMetaData(metaDic, "cellColorScalarDataName", dataName); outputFile << dataName << " "; @@ -911,8 +897,7 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase outputFile, buffer, this->m_NumberOfCellPixelComponents, this->m_NumberOfCellPixels); return; } - default: - { + default: { itkExceptionMacro("Unknown cell pixel type"); } } @@ -1003,8 +988,7 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase outputFile << "CELL_DATA " << this->m_NumberOfCellPixels << '\n'; switch (this->m_CellPixelType) { - case IOPixelEnum::SCALAR: - { + case IOPixelEnum::SCALAR: { outputFile << "SCALARS "; ExposeMetaData(metaDic, "cellScalarDataName", dataName); outputFile << dataName << " "; @@ -1013,24 +997,21 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase case IOPixelEnum::OFFSET: case IOPixelEnum::POINT: case IOPixelEnum::COVARIANTVECTOR: - case IOPixelEnum::VECTOR: - { + case IOPixelEnum::VECTOR: { outputFile << "VECTORS "; ExposeMetaData(metaDic, "cellVectorDataName", dataName); outputFile << dataName << " "; break; } case IOPixelEnum::SYMMETRICSECONDRANKTENSOR: - case IOPixelEnum::DIFFUSIONTENSOR3D: - { + case IOPixelEnum::DIFFUSIONTENSOR3D: { outputFile << "TENSORS "; ExposeMetaData(metaDic, "cellTensorDataName", dataName); outputFile << dataName << " "; break; } case IOPixelEnum::ARRAY: - case IOPixelEnum::VARIABLELENGTHVECTOR: - { + case IOPixelEnum::VARIABLELENGTHVECTOR: { outputFile << "COLOR_SCALARS "; ExposeMetaData(metaDic, "cellColorScalarDataName", dataName); outputFile << dataName << " "; @@ -1038,8 +1019,7 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase outputFile, buffer, this->m_NumberOfCellPixelComponents, this->m_NumberOfCellPixels); return; } - default: - { + default: { itkExceptionMacro("Unknown cell pixel type"); } } diff --git a/Modules/IO/MeshVTK/src/itkVTKPolyDataMeshIO.cxx b/Modules/IO/MeshVTK/src/itkVTKPolyDataMeshIO.cxx index bf36aa3e588..c567c14dc66 100644 --- a/Modules/IO/MeshVTK/src/itkVTKPolyDataMeshIO.cxx +++ b/Modules/IO/MeshVTK/src/itkVTKPolyDataMeshIO.cxx @@ -744,68 +744,55 @@ VTKPolyDataMeshIO::ReadMeshInformation() } #define CASE_INVOKE_BY_TYPE(function, param) \ - case IOComponentEnum::UCHAR: \ - { \ + case IOComponentEnum::UCHAR: { \ function(param, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::CHAR: \ - { \ + case IOComponentEnum::CHAR: { \ function(param, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::USHORT: \ - { \ + case IOComponentEnum::USHORT: { \ function(param, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::SHORT: \ - { \ + case IOComponentEnum::SHORT: { \ function(param, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::UINT: \ - { \ + case IOComponentEnum::UINT: { \ function(param, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::INT: \ - { \ + case IOComponentEnum::INT: { \ function(param, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::ULONG: \ - { \ + case IOComponentEnum::ULONG: { \ function(param, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::LONG: \ - { \ + case IOComponentEnum::LONG: { \ function(param, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::ULONGLONG: \ - { \ + case IOComponentEnum::ULONGLONG: { \ function(param, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::LONGLONG: \ - { \ + case IOComponentEnum::LONGLONG: { \ function(param, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::FLOAT: \ - { \ + case IOComponentEnum::FLOAT: { \ function(param, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::DOUBLE: \ - { \ + case IOComponentEnum::DOUBLE: { \ function(param, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::LDOUBLE: \ - { \ + case IOComponentEnum::LDOUBLE: { \ function(param, static_cast(buffer)); \ break; \ } @@ -838,8 +825,7 @@ VTKPolyDataMeshIO::ReadPoints(void * buffer) { CASE_INVOKE_BY_TYPE(ReadPointsBufferAsASCII, inputFile) - default: - { + default: { itkExceptionMacro("Unknown point component type"); } } @@ -850,8 +836,7 @@ VTKPolyDataMeshIO::ReadPoints(void * buffer) { CASE_INVOKE_BY_TYPE(ReadPointsBufferAsBINARY, inputFile) - default: - { + default: { itkExceptionMacro("Unknown point component type"); } } @@ -1081,8 +1066,7 @@ VTKPolyDataMeshIO::ReadPointData(void * buffer) { CASE_INVOKE_BY_TYPE(ReadPointDataBufferAsASCII, inputFile) - default: - { + default: { itkExceptionMacro("Unknown point pixel component"); } } @@ -1093,8 +1077,7 @@ VTKPolyDataMeshIO::ReadPointData(void * buffer) { CASE_INVOKE_BY_TYPE(ReadPointDataBufferAsBINARY, inputFile) - default: - { + default: { itkExceptionMacro("Unknown point pixel component"); } } @@ -1135,8 +1118,7 @@ VTKPolyDataMeshIO::ReadCellData(void * buffer) { CASE_INVOKE_BY_TYPE(ReadCellDataBufferAsASCII, inputFile) - default: - { + default: { itkExceptionMacro("Unknown cell pixel component"); } } @@ -1147,8 +1129,7 @@ VTKPolyDataMeshIO::ReadCellData(void * buffer) { CASE_INVOKE_BY_TYPE(ReadCellDataBufferAsBINARY, inputFile) - default: - { + default: { itkExceptionMacro("Unknown cell pixel component"); } } @@ -1210,68 +1191,55 @@ VTKPolyDataMeshIO::WriteMeshInformation() } #define CASE_INVOKE_WITH_COMPONENT_TYPE(function) \ - case IOComponentEnum::UCHAR: \ - { \ + case IOComponentEnum::UCHAR: { \ function(outputFile, static_cast(buffer), " unsigned_char"); \ break; \ } \ - case IOComponentEnum::CHAR: \ - { \ + case IOComponentEnum::CHAR: { \ function(outputFile, static_cast(buffer), " char"); \ break; \ } \ - case IOComponentEnum::USHORT: \ - { \ + case IOComponentEnum::USHORT: { \ function(outputFile, static_cast(buffer), " unsigned_short"); \ break; \ } \ - case IOComponentEnum::SHORT: \ - { \ + case IOComponentEnum::SHORT: { \ function(outputFile, static_cast(buffer), " short"); \ break; \ } \ - case IOComponentEnum::UINT: \ - { \ + case IOComponentEnum::UINT: { \ function(outputFile, static_cast(buffer), " unsigned_int"); \ break; \ } \ - case IOComponentEnum::INT: \ - { \ + case IOComponentEnum::INT: { \ function(outputFile, static_cast(buffer), " int"); \ break; \ } \ - case IOComponentEnum::ULONG: \ - { \ + case IOComponentEnum::ULONG: { \ function(outputFile, static_cast(buffer), " unsigned_long"); \ break; \ } \ - case IOComponentEnum::LONG: \ - { \ + case IOComponentEnum::LONG: { \ function(outputFile, static_cast(buffer), " long"); \ break; \ } \ - case IOComponentEnum::ULONGLONG: \ - { \ + case IOComponentEnum::ULONGLONG: { \ function(outputFile, static_cast(buffer), " vtktypeuint64"); \ break; \ } \ - case IOComponentEnum::LONGLONG: \ - { \ + case IOComponentEnum::LONGLONG: { \ function(outputFile, static_cast(buffer), " vtktypeint64"); \ break; \ } \ - case IOComponentEnum::FLOAT: \ - { \ + case IOComponentEnum::FLOAT: { \ function(outputFile, static_cast(buffer), " float"); \ break; \ } \ - case IOComponentEnum::DOUBLE: \ - { \ + case IOComponentEnum::DOUBLE: { \ function(outputFile, static_cast(buffer), " double"); \ break; \ } \ - case IOComponentEnum::LDOUBLE: \ - { \ + case IOComponentEnum::LDOUBLE: { \ function(outputFile, static_cast(buffer), " long_double"); \ break; \ } @@ -1332,80 +1300,67 @@ VTKPolyDataMeshIO::WritePoints(void * buffer) } #define CASE_UPDATE_AND_WRITE(function) \ - case IOComponentEnum::UCHAR: \ - { \ + case IOComponentEnum::UCHAR: { \ UpdateCellInformation(static_cast(buffer)); \ function(outputFile, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::CHAR: \ - { \ + case IOComponentEnum::CHAR: { \ UpdateCellInformation(static_cast(buffer)); \ function(outputFile, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::USHORT: \ - { \ + case IOComponentEnum::USHORT: { \ UpdateCellInformation(static_cast(buffer)); \ function(outputFile, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::SHORT: \ - { \ + case IOComponentEnum::SHORT: { \ UpdateCellInformation(static_cast(buffer)); \ function(outputFile, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::UINT: \ - { \ + case IOComponentEnum::UINT: { \ UpdateCellInformation(static_cast(buffer)); \ function(outputFile, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::INT: \ - { \ + case IOComponentEnum::INT: { \ UpdateCellInformation(static_cast(buffer)); \ function(outputFile, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::ULONG: \ - { \ + case IOComponentEnum::ULONG: { \ UpdateCellInformation(static_cast(buffer)); \ function(outputFile, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::LONG: \ - { \ + case IOComponentEnum::LONG: { \ UpdateCellInformation(static_cast(buffer)); \ function(outputFile, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::ULONGLONG: \ - { \ + case IOComponentEnum::ULONGLONG: { \ UpdateCellInformation(static_cast(buffer)); \ function(outputFile, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::LONGLONG: \ - { \ + case IOComponentEnum::LONGLONG: { \ UpdateCellInformation(static_cast(buffer)); \ function(outputFile, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::FLOAT: \ - { \ + case IOComponentEnum::FLOAT: { \ UpdateCellInformation(static_cast(buffer)); \ function(outputFile, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::DOUBLE: \ - { \ + case IOComponentEnum::DOUBLE: { \ UpdateCellInformation(static_cast(buffer)); \ function(outputFile, static_cast(buffer)); \ break; \ } \ - case IOComponentEnum::LDOUBLE: \ - { \ + case IOComponentEnum::LDOUBLE: { \ UpdateCellInformation(static_cast(buffer)); \ function(outputFile, static_cast(buffer)); \ break; \ diff --git a/Modules/IO/MeshVTK/src/itkVTKPolyDataMeshIOFactory.cxx b/Modules/IO/MeshVTK/src/itkVTKPolyDataMeshIOFactory.cxx index 62a4e570d74..bd5ffdf73ed 100644 --- a/Modules/IO/MeshVTK/src/itkVTKPolyDataMeshIOFactory.cxx +++ b/Modules/IO/MeshVTK/src/itkVTKPolyDataMeshIOFactory.cxx @@ -55,7 +55,7 @@ VTKPolyDataMeshIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOMeshVTK_EXPORT - VTKPolyDataMeshIOFactoryRegister__Private() +VTKPolyDataMeshIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/Meta/src/itkMetaImageIO.cxx b/Modules/IO/Meta/src/itkMetaImageIO.cxx index f6c2133cc0d..9dc394c8bdc 100644 --- a/Modules/IO/Meta/src/itkMetaImageIO.cxx +++ b/Modules/IO/Meta/src/itkMetaImageIO.cxx @@ -834,8 +834,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RIA: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RIP: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RSA: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RSP: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RSP: { m_MetaImage.AnatomicalOrientation(0, MET_ORIENTATION_RL); break; } @@ -846,8 +845,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_LIA: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_LIP: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_LSA: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_LSP: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_LSP: { m_MetaImage.AnatomicalOrientation(0, MET_ORIENTATION_LR); break; } @@ -858,8 +856,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_AIL: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_AIR: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_ASL: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_ASR: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_ASR: { m_MetaImage.AnatomicalOrientation(0, MET_ORIENTATION_AP); break; } @@ -870,8 +867,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_PIL: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_PIR: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_PSL: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_PSR: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_PSR: { m_MetaImage.AnatomicalOrientation(0, MET_ORIENTATION_PA); break; } @@ -882,8 +878,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_ILA: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_ILP: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_IRA: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_IRP: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_IRP: { m_MetaImage.AnatomicalOrientation(0, MET_ORIENTATION_IS); break; } @@ -894,8 +889,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SLA: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SLP: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SRA: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SRP: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SRP: { m_MetaImage.AnatomicalOrientation(0, MET_ORIENTATION_SI); break; } @@ -909,8 +903,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_IRA: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_IRP: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SRA: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SRP: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SRP: { m_MetaImage.AnatomicalOrientation(1, MET_ORIENTATION_RL); break; } @@ -921,8 +914,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_ILA: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_ILP: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SLA: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SLP: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SLP: { m_MetaImage.AnatomicalOrientation(1, MET_ORIENTATION_LR); break; } @@ -933,8 +925,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_IAL: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_IAR: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SAL: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SAR: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SAR: { m_MetaImage.AnatomicalOrientation(1, MET_ORIENTATION_AP); break; } @@ -946,8 +937,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_IPL: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_IPR: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SPL: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SPR: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SPR: { m_MetaImage.AnatomicalOrientation(1, MET_ORIENTATION_PA); break; } @@ -958,8 +948,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_LIA: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_LIP: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RIA: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RIP: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RIP: { m_MetaImage.AnatomicalOrientation(1, MET_ORIENTATION_IS); break; } @@ -970,8 +959,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_LSA: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_LSP: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RSA: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RSP: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RSP: { m_MetaImage.AnatomicalOrientation(1, MET_ORIENTATION_SI); break; } @@ -985,8 +973,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_IAR: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_IPR: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SAR: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SPR: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SPR: { m_MetaImage.AnatomicalOrientation(2, MET_ORIENTATION_RL); break; } @@ -997,8 +984,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_IAL: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_IPL: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SAL: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SPL: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SPL: { m_MetaImage.AnatomicalOrientation(2, MET_ORIENTATION_LR); break; } @@ -1009,8 +995,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_ILA: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_IRA: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SLA: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SRA: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SRA: { m_MetaImage.AnatomicalOrientation(2, MET_ORIENTATION_AP); break; } @@ -1021,8 +1006,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_ILP: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_IRP: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SLP: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SRP: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_SRP: { m_MetaImage.AnatomicalOrientation(2, MET_ORIENTATION_PA); break; } @@ -1034,8 +1018,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_LAI: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_LPI: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RAI: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RPI: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RPI: { m_MetaImage.AnatomicalOrientation(2, MET_ORIENTATION_IS); break; } @@ -1046,8 +1029,7 @@ MetaImageIO::Write(const void * buffer) case SpatialOrientations::ITK_COORDINATE_ORIENTATION_LAS: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_LPS: case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RAS: - case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RPS: - { + case SpatialOrientations::ITK_COORDINATE_ORIENTATION_RPS: { m_MetaImage.AnatomicalOrientation(2, MET_ORIENTATION_SI); break; } diff --git a/Modules/IO/Meta/src/itkMetaImageIOFactory.cxx b/Modules/IO/Meta/src/itkMetaImageIOFactory.cxx index 320344c2094..49a90658d03 100644 --- a/Modules/IO/Meta/src/itkMetaImageIOFactory.cxx +++ b/Modules/IO/Meta/src/itkMetaImageIOFactory.cxx @@ -44,7 +44,7 @@ MetaImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOMeta_EXPORT - MetaImageIOFactoryRegister__Private() +MetaImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx b/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx index 2958bed4ff4..58f60986ba2 100644 --- a/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx +++ b/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx @@ -27,7 +27,7 @@ namespace itk { -//#define ITK_USE_VERY_VERBOSE_NIFTI_DEBUGGING +// #define ITK_USE_VERY_VERBOSE_NIFTI_DEBUGGING #if defined(ITK_USE_VERY_VERBOSE_NIFTI_DEBUGGING) namespace { @@ -404,7 +404,11 @@ class NiftiImageIO::NiftiImageProxy operator nifti_image *() { return m_ptr; } - nifti_image * operator->() { return m_ptr; } + nifti_image * + operator->() + { + return m_ptr; + } }; @@ -1706,8 +1710,7 @@ NiftiImageIO::WriteImageInformation() this->m_NiftiImage->nbyper = 8; break; case IOComponentEnum::UNKNOWNCOMPONENTTYPE: - default: - { + default: { itkExceptionMacro("More than one component per pixel not supported"); } } @@ -1736,8 +1739,7 @@ NiftiImageIO::WriteImageInformation() case IOComponentEnum::DOUBLE: this->m_NiftiImage->datatype = NIFTI_TYPE_COMPLEX128; break; - default: - { + default: { itkExceptionMacro("Only float or double precision complex type supported"); } } diff --git a/Modules/IO/NIFTI/src/itkNiftiImageIOFactory.cxx b/Modules/IO/NIFTI/src/itkNiftiImageIOFactory.cxx index a2967f64fa5..b839d5858fe 100644 --- a/Modules/IO/NIFTI/src/itkNiftiImageIOFactory.cxx +++ b/Modules/IO/NIFTI/src/itkNiftiImageIOFactory.cxx @@ -48,7 +48,7 @@ NiftiImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIONIFTI_EXPORT - NiftiImageIOFactoryRegister__Private() +NiftiImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/NRRD/src/itkNrrdImageIOFactory.cxx b/Modules/IO/NRRD/src/itkNrrdImageIOFactory.cxx index 6806cf40d74..08d9e4bc4a6 100644 --- a/Modules/IO/NRRD/src/itkNrrdImageIOFactory.cxx +++ b/Modules/IO/NRRD/src/itkNrrdImageIOFactory.cxx @@ -44,7 +44,7 @@ NrrdImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIONRRD_EXPORT - NrrdImageIOFactoryRegister__Private() +NrrdImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/PNG/src/itkPNGImageIO.cxx b/Modules/IO/PNG/src/itkPNGImageIO.cxx index 873be068ba0..ebb9a932640 100644 --- a/Modules/IO/PNG/src/itkPNGImageIO.cxx +++ b/Modules/IO/PNG/src/itkPNGImageIO.cxx @@ -532,8 +532,7 @@ PNGImageIO::WriteSlice(const std::string & fileName, const void * const buffer) bitDepth = 16; break; - default: - { + default: { // IMPORTANT: The itkExceptionMacro() cannot be used here due to a bug in // Visual // Studio 7.1 in release mode. That compiler will corrupt the diff --git a/Modules/IO/PNG/src/itkPNGImageIOFactory.cxx b/Modules/IO/PNG/src/itkPNGImageIOFactory.cxx index 19283d9eb65..d54ce60cffa 100644 --- a/Modules/IO/PNG/src/itkPNGImageIOFactory.cxx +++ b/Modules/IO/PNG/src/itkPNGImageIOFactory.cxx @@ -44,7 +44,7 @@ PNGImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOPNG_EXPORT - PNGImageIOFactoryRegister__Private() +PNGImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/PhilipsREC/src/itkPhilipsPAR.cxx b/Modules/IO/PhilipsREC/src/itkPhilipsPAR.cxx index e91bf2d4aa2..43205a11383 100644 --- a/Modules/IO/PhilipsREC/src/itkPhilipsPAR.cxx +++ b/Modules/IO/PhilipsREC/src/itkPhilipsPAR.cxx @@ -463,8 +463,7 @@ PhilipsPAR::GetPARVersion(std::string parFile) case '3': ResToolsVersion = RESEARCH_IMAGE_EXPORT_TOOL_V3; break; - case '4': - { + case '4': { if ((currentLine.length() == 63) || (currentLine[63]) != '.') { ResToolsVersion = RESEARCH_IMAGE_EXPORT_TOOL_V4; @@ -549,8 +548,7 @@ PhilipsPAR::ReadPAR(std::string parFile, struct par_parameter * pPar) // Parse PAR file according to version. switch (pPar->ResToolsVersion) { - case RESEARCH_IMAGE_EXPORT_TOOL_V3: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V3: { struct image_info_defV3 tempInfo; struct image_info_defV3 tempInfo1; float fovAP, fovFH, fovRL; @@ -1041,8 +1039,7 @@ PhilipsPAR::ReadPAR(std::string parFile, struct par_parameter * pPar) case RESEARCH_IMAGE_EXPORT_TOOL_V4: case RESEARCH_IMAGE_EXPORT_TOOL_V4_1: - case RESEARCH_IMAGE_EXPORT_TOOL_V4_2: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V4_2: { struct image_info_defV4 tempInfo; struct image_info_defV4 tempInfo1; float fovAP, fovFH, fovRL; @@ -1579,8 +1576,7 @@ PhilipsPAR::ReadPAR(std::string parFile, struct par_parameter * pPar) } break; - default: - { + default: { pPar->problemreading = 1; std::ostringstream message; message << "ReadPAR: Unknown PAR version"; @@ -1639,8 +1635,7 @@ PhilipsPAR::GetRECSliceIndexImageTypes(std::string parFile) switch (ResToolsVersion) { - case RESEARCH_IMAGE_EXPORT_TOOL_V3: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V3: { struct image_info_defV3 tempInfo; PhilipsPAR::PARSliceIndexImageType sliceAndType; int lineIncrement = 89; @@ -1655,8 +1650,7 @@ PhilipsPAR::GetRECSliceIndexImageTypes(std::string parFile) } } break; - case RESEARCH_IMAGE_EXPORT_TOOL_V4: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V4: { struct image_info_defV4 tempInfo; PhilipsPAR::PARSliceIndexImageType sliceAndType; int lineIncrement = 92; @@ -1671,8 +1665,7 @@ PhilipsPAR::GetRECSliceIndexImageTypes(std::string parFile) } } break; - case RESEARCH_IMAGE_EXPORT_TOOL_V4_1: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V4_1: { struct image_info_defV4 tempInfo; PhilipsPAR::PARSliceIndexImageType sliceAndType; int lineIncrement = 99; @@ -1687,8 +1680,7 @@ PhilipsPAR::GetRECSliceIndexImageTypes(std::string parFile) } } break; - case RESEARCH_IMAGE_EXPORT_TOOL_V4_2: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V4_2: { struct image_info_defV4 tempInfo; PhilipsPAR::PARSliceIndexImageType sliceAndType; int lineIncrement = 101; @@ -1722,8 +1714,7 @@ PhilipsPAR::GetRECSliceIndexScanningSequence(std::string parFile) switch (ResToolsVersion) { - case RESEARCH_IMAGE_EXPORT_TOOL_V3: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V3: { struct image_info_defV3 tempInfo; PhilipsPAR::PARSliceIndexScanSequence sliceAndSequence; int lineIncrement = 89; @@ -1738,8 +1729,7 @@ PhilipsPAR::GetRECSliceIndexScanningSequence(std::string parFile) } } break; - case RESEARCH_IMAGE_EXPORT_TOOL_V4: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V4: { struct image_info_defV4 tempInfo; PhilipsPAR::PARSliceIndexScanSequence sliceAndSequence; int lineIncrement = 92; @@ -1754,8 +1744,7 @@ PhilipsPAR::GetRECSliceIndexScanningSequence(std::string parFile) } } break; - case RESEARCH_IMAGE_EXPORT_TOOL_V4_1: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V4_1: { struct image_info_defV4 tempInfo; PhilipsPAR::PARSliceIndexScanSequence sliceAndSequence; int lineIncrement = 99; @@ -1770,8 +1759,7 @@ PhilipsPAR::GetRECSliceIndexScanningSequence(std::string parFile) } } break; - case RESEARCH_IMAGE_EXPORT_TOOL_V4_2: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V4_2: { struct image_info_defV4 tempInfo; PhilipsPAR::PARSliceIndexScanSequence sliceAndSequence; int lineIncrement = 101; @@ -1808,8 +1796,7 @@ PhilipsPAR::GetImageTypesScanningSequence(std::string parFile) switch (parParam.ResToolsVersion) { - case RESEARCH_IMAGE_EXPORT_TOOL_V3: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V3: { struct image_info_defV3 tempInfo; for (int scanIndex = 0; scanIndex < parParam.num_scanning_sequences; ++scanIndex) { @@ -1839,8 +1826,7 @@ PhilipsPAR::GetImageTypesScanningSequence(std::string parFile) } } break; - case RESEARCH_IMAGE_EXPORT_TOOL_V4: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V4: { struct image_info_defV4 tempInfo; for (int scanIndex = 0; scanIndex < parParam.num_scanning_sequences; ++scanIndex) { @@ -1870,8 +1856,7 @@ PhilipsPAR::GetImageTypesScanningSequence(std::string parFile) } } break; - case RESEARCH_IMAGE_EXPORT_TOOL_V4_1: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V4_1: { struct image_info_defV4 tempInfo; for (int scanIndex = 0; scanIndex < parParam.num_scanning_sequences; ++scanIndex) { @@ -1901,8 +1886,7 @@ PhilipsPAR::GetImageTypesScanningSequence(std::string parFile) } } break; - case RESEARCH_IMAGE_EXPORT_TOOL_V4_2: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V4_2: { struct image_info_defV4 tempInfo; for (int scanIndex = 0; scanIndex < parParam.num_scanning_sequences; ++scanIndex) { @@ -1961,8 +1945,7 @@ PhilipsPAR::GetRECRescaleValues(std::string parFile, switch (ResToolsVersion) { - case RESEARCH_IMAGE_EXPORT_TOOL_V3: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V3: { struct image_info_defV3 tempInfo; PhilipsPAR::PARRescaleValues rescale; int imageType[PAR_DEFAULT_IMAGE_TYPES_SIZE] = { -1, -1, -1, -1, -1, -1, -1, -1 }; @@ -1983,8 +1966,7 @@ PhilipsPAR::GetRECRescaleValues(std::string parFile, } } break; - case RESEARCH_IMAGE_EXPORT_TOOL_V4: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V4: { struct image_info_defV4 tempInfo; PhilipsPAR::PARRescaleValues rescale; int imageType[PAR_DEFAULT_IMAGE_TYPES_SIZE] = { -1, -1, -1, -1, -1, -1, -1, -1 }; @@ -2005,8 +1987,7 @@ PhilipsPAR::GetRECRescaleValues(std::string parFile, } } break; - case RESEARCH_IMAGE_EXPORT_TOOL_V4_1: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V4_1: { struct image_info_defV4 tempInfo; PhilipsPAR::PARRescaleValues rescale; int imageType[PAR_DEFAULT_IMAGE_TYPES_SIZE] = { -1, -1, -1, -1, -1, -1, -1, -1 }; @@ -2027,8 +2008,7 @@ PhilipsPAR::GetRECRescaleValues(std::string parFile, } } break; - case RESEARCH_IMAGE_EXPORT_TOOL_V4_2: - { + case RESEARCH_IMAGE_EXPORT_TOOL_V4_2: { struct image_info_defV4 tempInfo; PhilipsPAR::PARRescaleValues rescale; int imageType[PAR_DEFAULT_IMAGE_TYPES_SIZE] = { -1, -1, -1, -1, -1, -1, -1, -1 }; diff --git a/Modules/IO/PhilipsREC/src/itkPhilipsRECImageIO.cxx b/Modules/IO/PhilipsREC/src/itkPhilipsRECImageIO.cxx index e3d29acb2e3..fac24f6b748 100644 --- a/Modules/IO/PhilipsREC/src/itkPhilipsRECImageIO.cxx +++ b/Modules/IO/PhilipsREC/src/itkPhilipsRECImageIO.cxx @@ -759,7 +759,7 @@ PhilipsRECImageIO::ReadImageInformation() direction[columns][rows] = dir[columns][rows]; } } -//#define DEBUG_ORIENTATION +// #define DEBUG_ORIENTATION #ifdef DEBUG_ORIENTATION std::cout << "Direction cosines = " << direction << std::endl << "Spacing = " << spacing << std::endl; #endif diff --git a/Modules/IO/PhilipsREC/src/itkPhilipsRECImageIOFactory.cxx b/Modules/IO/PhilipsREC/src/itkPhilipsRECImageIOFactory.cxx index 6b1c4195bfe..6db28b295c0 100644 --- a/Modules/IO/PhilipsREC/src/itkPhilipsRECImageIOFactory.cxx +++ b/Modules/IO/PhilipsREC/src/itkPhilipsRECImageIOFactory.cxx @@ -59,7 +59,7 @@ PhilipsRECImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOPhilipsREC_EXPORT - PhilipsRECImageIOFactoryRegister__Private() +PhilipsRECImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/Siemens/src/itkSiemensVisionImageIO.cxx b/Modules/IO/Siemens/src/itkSiemensVisionImageIO.cxx index 48bc2761771..c4f0b273f0a 100644 --- a/Modules/IO/Siemens/src/itkSiemensVisionImageIO.cxx +++ b/Modules/IO/Siemens/src/itkSiemensVisionImageIO.cxx @@ -80,7 +80,7 @@ SiemensVisionImageIO::ReadHeader(const char * FileNameToRead) // #define DEBUGHEADER #if defined(DEBUGHEADER) -# define DB(x) std::cerr << # x << ' ' << x << std::endl +# define DB(x) std::cerr << #x << ' ' << x << std::endl #else # define DB(x) #endif diff --git a/Modules/IO/Siemens/src/itkSiemensVisionImageIOFactory.cxx b/Modules/IO/Siemens/src/itkSiemensVisionImageIOFactory.cxx index 00fe77abf24..59f4790c768 100644 --- a/Modules/IO/Siemens/src/itkSiemensVisionImageIOFactory.cxx +++ b/Modules/IO/Siemens/src/itkSiemensVisionImageIOFactory.cxx @@ -51,7 +51,7 @@ SiemensVisionImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOSiemens_EXPORT - SiemensVisionImageIOFactoryRegister__Private() +SiemensVisionImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/Stimulate/src/itkStimulateImageIOFactory.cxx b/Modules/IO/Stimulate/src/itkStimulateImageIOFactory.cxx index ce2a5224f9a..8ae70965f2b 100644 --- a/Modules/IO/Stimulate/src/itkStimulateImageIOFactory.cxx +++ b/Modules/IO/Stimulate/src/itkStimulateImageIOFactory.cxx @@ -54,7 +54,7 @@ StimulateImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOStimulate_EXPORT - StimulateImageIOFactoryRegister__Private() +StimulateImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/TIFF/src/itkTIFFImageIO.cxx b/Modules/IO/TIFF/src/itkTIFFImageIO.cxx index 37df52e2997..820faee4233 100644 --- a/Modules/IO/TIFF/src/itkTIFFImageIO.cxx +++ b/Modules/IO/TIFF/src/itkTIFFImageIO.cxx @@ -439,8 +439,7 @@ TIFFImageIO::ReadImageInformation() this->SetNumberOfComponents(m_InternalImage->m_SamplesPerPixel); this->SetPixelType(IOPixelEnum::RGB); break; - case TIFFImageIO::PALETTE_RGB: - { + case TIFFImageIO::PALETTE_RGB: { if (this->GetExpandRGBPalette()) { this->SetNumberOfComponents(3); @@ -868,18 +867,18 @@ typedef enum } ITK_TIFF_MOC_TIFFSetGetFieldType; struct _TIFFField { - uint32_t field_tag; /* field's tag */ - short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */ - short field_writecount; /* write count/TIFF_VARIABLE */ - TIFFDataType field_type; /* type of associated data */ - uint32_t reserved; /* reserved for future extension */ - ITK_TIFF_MOC_TIFFSetGetFieldType set_field_type; /* type to be passed to TIFFSetField */ - ITK_TIFF_MOC_TIFFSetGetFieldType get_field_type; /* type to be passed to TIFFGetField */ - unsigned short field_bit; /* bit in fieldsset bit vector */ - unsigned char field_oktochange; /* if true, can change while writing */ - unsigned char field_passcount; /* if true, pass dir count on set */ - char * field_name; /* ASCII name */ - TIFFFieldArray * field_subfields; /* if field points to child ifds, child ifd field definition array */ + uint32_t field_tag; /* field's tag */ + short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */ + short field_writecount; /* write count/TIFF_VARIABLE */ + TIFFDataType field_type; /* type of associated data */ + uint32_t reserved; /* reserved for future extension */ + ITK_TIFF_MOC_TIFFSetGetFieldType set_field_type; /* type to be passed to TIFFSetField */ + ITK_TIFF_MOC_TIFFSetGetFieldType get_field_type; /* type to be passed to TIFFGetField */ + unsigned short field_bit; /* bit in fieldsset bit vector */ + unsigned char field_oktochange; /* if true, can change while writing */ + unsigned char field_passcount; /* if true, pass dir count on set */ + char * field_name; /* ASCII name */ + TIFFFieldArray * field_subfields; /* if field points to child ifds, child ifd field definition array */ }; namespace itk { @@ -1387,8 +1386,7 @@ TIFFImageIO::ReadGenericImage(void * _out, unsigned int width, unsigned int heig case TIFFImageIO::RGB_: inc = m_InternalImage->m_SamplesPerPixel; break; - case TIFFImageIO::PALETTE_RGB: - { + case TIFFImageIO::PALETTE_RGB: { if (GetExpandRGBPalette()) { inc = 3; diff --git a/Modules/IO/TIFF/src/itkTIFFImageIOFactory.cxx b/Modules/IO/TIFF/src/itkTIFFImageIOFactory.cxx index 98ea5213cb6..c3f1e6e204a 100644 --- a/Modules/IO/TIFF/src/itkTIFFImageIOFactory.cxx +++ b/Modules/IO/TIFF/src/itkTIFFImageIOFactory.cxx @@ -44,7 +44,7 @@ TIFFImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOTIFF_EXPORT - TIFFImageIOFactoryRegister__Private() +TIFFImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/TIFF/test/itkTIFFImageIOCompressionTest.cxx b/Modules/IO/TIFF/test/itkTIFFImageIOCompressionTest.cxx index 45405d2be04..6fd72e5f5eb 100644 --- a/Modules/IO/TIFF/test/itkTIFFImageIOCompressionTest.cxx +++ b/Modules/IO/TIFF/test/itkTIFFImageIOCompressionTest.cxx @@ -181,28 +181,23 @@ itkTIFFImageIOCompressionTest(int argc, char * argv[]) case itk::IOPixelEnum::SCALAR: switch (componentType) { - case itk::IOComponentEnum::UCHAR: - { + case itk::IOComponentEnum::UCHAR: { using PixelType = unsigned char; return itkTIFFImageIOCompressionTestHelper>(argc, argv, JPEGQuality); } - case itk::IOComponentEnum::CHAR: - { + case itk::IOComponentEnum::CHAR: { using PixelType = char; return itkTIFFImageIOCompressionTestHelper>(argc, argv, JPEGQuality); } - case itk::IOComponentEnum::USHORT: - { + case itk::IOComponentEnum::USHORT: { using PixelType = unsigned short; return itkTIFFImageIOCompressionTestHelper>(argc, argv, JPEGQuality); } - case itk::IOComponentEnum::SHORT: - { + case itk::IOComponentEnum::SHORT: { using PixelType = short; return itkTIFFImageIOCompressionTestHelper>(argc, argv, JPEGQuality); } - case itk::IOComponentEnum::FLOAT: - { + case itk::IOComponentEnum::FLOAT: { using PixelType = float; return itkTIFFImageIOCompressionTestHelper>(argc, argv, JPEGQuality); } @@ -215,28 +210,23 @@ itkTIFFImageIOCompressionTest(int argc, char * argv[]) case itk::IOPixelEnum::RGB: switch (componentType) { - case itk::IOComponentEnum::UCHAR: - { + case itk::IOComponentEnum::UCHAR: { using PixelType = itk::RGBPixel; return itkTIFFImageIOCompressionTestHelper>(argc, argv, JPEGQuality); } - case itk::IOComponentEnum::CHAR: - { + case itk::IOComponentEnum::CHAR: { using PixelType = itk::RGBPixel; return itkTIFFImageIOCompressionTestHelper>(argc, argv, JPEGQuality); } - case itk::IOComponentEnum::USHORT: - { + case itk::IOComponentEnum::USHORT: { using PixelType = itk::RGBPixel; return itkTIFFImageIOCompressionTestHelper>(argc, argv, JPEGQuality); } - case itk::IOComponentEnum::SHORT: - { + case itk::IOComponentEnum::SHORT: { using PixelType = itk::RGBPixel; return itkTIFFImageIOCompressionTestHelper>(argc, argv, JPEGQuality); } - case itk::IOComponentEnum::FLOAT: - { + case itk::IOComponentEnum::FLOAT: { using PixelType = itk::RGBPixel; return itkTIFFImageIOCompressionTestHelper>(argc, argv, JPEGQuality); } @@ -249,28 +239,23 @@ itkTIFFImageIOCompressionTest(int argc, char * argv[]) case itk::IOPixelEnum::RGBA: switch (componentType) { - case itk::IOComponentEnum::UCHAR: - { + case itk::IOComponentEnum::UCHAR: { using PixelType = itk::RGBAPixel; return itkTIFFImageIOCompressionTestHelper>(argc, argv, JPEGQuality); } - case itk::IOComponentEnum::CHAR: - { + case itk::IOComponentEnum::CHAR: { using PixelType = itk::RGBAPixel; return itkTIFFImageIOCompressionTestHelper>(argc, argv, JPEGQuality); } - case itk::IOComponentEnum::USHORT: - { + case itk::IOComponentEnum::USHORT: { using PixelType = itk::RGBAPixel; return itkTIFFImageIOCompressionTestHelper>(argc, argv, JPEGQuality); } - case itk::IOComponentEnum::SHORT: - { + case itk::IOComponentEnum::SHORT: { using PixelType = itk::RGBAPixel; return itkTIFFImageIOCompressionTestHelper>(argc, argv, JPEGQuality); } - case itk::IOComponentEnum::FLOAT: - { + case itk::IOComponentEnum::FLOAT: { using PixelType = itk::RGBAPixel; return itkTIFFImageIOCompressionTestHelper>(argc, argv, JPEGQuality); } diff --git a/Modules/IO/TransformBase/include/itkTransformFileWriter.h b/Modules/IO/TransformBase/include/itkTransformFileWriter.h index 4db55116e02..3a0c326de9d 100644 --- a/Modules/IO/TransformBase/include/itkTransformFileWriter.h +++ b/Modules/IO/TransformBase/include/itkTransformFileWriter.h @@ -137,10 +137,10 @@ ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") /** Declare specializations */ template <> void ITKIOTransformBase_TEMPLATE_EXPORT - TransformFileWriterTemplate::PushBackTransformList(const Object * transObj); +TransformFileWriterTemplate::PushBackTransformList(const Object * transObj); template <> void ITKIOTransformBase_TEMPLATE_EXPORT - TransformFileWriterTemplate::PushBackTransformList(const Object * transObj); +TransformFileWriterTemplate::PushBackTransformList(const Object * transObj); ITK_GCC_PRAGMA_DIAG_POP() diff --git a/Modules/IO/TransformHDF5/include/itkHDF5TransformIO.h b/Modules/IO/TransformHDF5/include/itkHDF5TransformIO.h index 0e32cc8b8f5..4f5c6950ac6 100644 --- a/Modules/IO/TransformHDF5/include/itkHDF5TransformIO.h +++ b/Modules/IO/TransformHDF5/include/itkHDF5TransformIO.h @@ -161,7 +161,7 @@ class ITK_TEMPLATE_EXPORT HDF5TransformIOTemplate }; const std::string ITKIOTransformHDF5_EXPORT - GetTransformName(int); +GetTransformName(int); /** This helps to meet backward compatibility */ using HDF5TransformIO = HDF5TransformIOTemplate; diff --git a/Modules/IO/TransformHDF5/src/itkHDF5TransformIOFactory.cxx b/Modules/IO/TransformHDF5/src/itkHDF5TransformIOFactory.cxx index 2a6c42111dc..5a444e95720 100644 --- a/Modules/IO/TransformHDF5/src/itkHDF5TransformIOFactory.cxx +++ b/Modules/IO/TransformHDF5/src/itkHDF5TransformIOFactory.cxx @@ -59,7 +59,7 @@ HDF5TransformIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOTransformHDF5_EXPORT - HDF5TransformIOFactoryRegister__Private() +HDF5TransformIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/TransformInsightLegacy/src/itkTxtTransformIOFactory.cxx b/Modules/IO/TransformInsightLegacy/src/itkTxtTransformIOFactory.cxx index a0b23b8d9ec..5cd1e0a5907 100644 --- a/Modules/IO/TransformInsightLegacy/src/itkTxtTransformIOFactory.cxx +++ b/Modules/IO/TransformInsightLegacy/src/itkTxtTransformIOFactory.cxx @@ -58,7 +58,7 @@ TxtTransformIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOTransformInsightLegacy_EXPORT - TxtTransformIOFactoryRegister__Private() +TxtTransformIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/TransformMINC/src/itkMINCTransformIO.cxx b/Modules/IO/TransformMINC/src/itkMINCTransformIO.cxx index cc49f548230..2c4e12ec3c9 100644 --- a/Modules/IO/TransformMINC/src/itkMINCTransformIO.cxx +++ b/Modules/IO/TransformMINC/src/itkMINCTransformIO.cxx @@ -81,8 +81,7 @@ MINCTransformIOTemplate::ReadOneTransform(VIO_General_tran const std::string typeNameString = Superclass::GetTypeNameString(); switch (get_transform_type(xfm)) { - case LINEAR: - { + case LINEAR: { VIO_Transform * lin = get_linear_transform_ptr(xfm); TransformPointer transform; @@ -117,8 +116,7 @@ MINCTransformIOTemplate::ReadOneTransform(VIO_General_tran break; } - case CONCATENATED_TRANSFORM: - { + case CONCATENATED_TRANSFORM: { for (int i = get_n_concated_transforms(xfm) - 1; i >= 0; --i) { this->ReadOneTransform(get_nth_general_transform(xfm, i)); @@ -131,8 +129,7 @@ MINCTransformIOTemplate::ReadOneTransform(VIO_General_tran case USER_TRANSFORM: itkExceptionMacro("Reading USER_TRANSFORM transform is not supported yet"); break; - case GRID_TRANSFORM: - { + case GRID_TRANSFORM: { if (xfm->displacement_volume_file) { using DisplacementFieldTransformType = DisplacementFieldTransform; diff --git a/Modules/IO/TransformMINC/src/itkMINCTransformIOFactory.cxx b/Modules/IO/TransformMINC/src/itkMINCTransformIOFactory.cxx index 0fdaa6563d3..7a51cae74bd 100644 --- a/Modules/IO/TransformMINC/src/itkMINCTransformIOFactory.cxx +++ b/Modules/IO/TransformMINC/src/itkMINCTransformIOFactory.cxx @@ -61,7 +61,7 @@ MINCTransformIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOTransformMINC_EXPORT - MINCTransformIOFactoryRegister__Private() +MINCTransformIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); diff --git a/Modules/IO/TransformMatlab/src/itkMatlabTransformIOFactory.cxx b/Modules/IO/TransformMatlab/src/itkMatlabTransformIOFactory.cxx index c38abf07867..f5b6a8488b0 100644 --- a/Modules/IO/TransformMatlab/src/itkMatlabTransformIOFactory.cxx +++ b/Modules/IO/TransformMatlab/src/itkMatlabTransformIOFactory.cxx @@ -58,7 +58,7 @@ MatlabTransformIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOTransformMatlab_EXPORT - MatlabTransformIOFactoryRegister__Private() +MatlabTransformIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/VTK/src/itkVTKImageIO.cxx b/Modules/IO/VTK/src/itkVTKImageIO.cxx index 6a4f4764c01..7c8269860f6 100644 --- a/Modules/IO/VTK/src/itkVTKImageIO.cxx +++ b/Modules/IO/VTK/src/itkVTKImageIO.cxx @@ -396,7 +396,8 @@ VTKImageIO::ReadHeaderSize(std::ifstream & file) file.seekg(pos); } else - {} + { + } } // found scalars } @@ -467,15 +468,13 @@ VTKImageIO::ReadBufferAsASCII(std::istream & is, switch (ctype) { - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { auto * buf = static_cast(buffer); ReadTensorBuffer(is, buf, numComp); } break; - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { auto * buf = static_cast(buffer); ReadTensorBuffer(is, buf, numComp); } @@ -786,16 +785,14 @@ VTKImageIO::WriteBufferAsASCII(std::ostream & os, { switch (ctype) { - case IOComponentEnum::FLOAT: - { + case IOComponentEnum::FLOAT: { using Type = const float *; auto buf = static_cast(buffer); WriteTensorBuffer(os, buf, numComp, this->GetNumberOfComponents()); } break; - case IOComponentEnum::DOUBLE: - { + case IOComponentEnum::DOUBLE: { using Type = const double *; auto buf = static_cast(buffer); WriteTensorBuffer(os, buf, numComp, this->GetNumberOfComponents()); @@ -864,8 +861,7 @@ VTKImageIO::WriteSymmetricTensorBufferAsBinary(std::ostream & os switch (this->GetNumberOfComponents()) { - case 3: - { + case 3: { pixelSize = componentSize * 3; while (bytesRemaining) { @@ -884,8 +880,7 @@ VTKImageIO::WriteSymmetricTensorBufferAsBinary(std::ostream & os break; } - case 6: - { + case 6: { pixelSize = componentSize * 6; while (bytesRemaining) { diff --git a/Modules/IO/VTK/src/itkVTKImageIOFactory.cxx b/Modules/IO/VTK/src/itkVTKImageIOFactory.cxx index 9fc667401ae..24f6b4540bf 100644 --- a/Modules/IO/VTK/src/itkVTKImageIOFactory.cxx +++ b/Modules/IO/VTK/src/itkVTKImageIOFactory.cxx @@ -54,7 +54,7 @@ VTKImageIOFactory::GetDescription() const // Undocumented API used to register during static initialization. // DO NOT CALL DIRECTLY. void ITKIOVTK_EXPORT - VTKImageIOFactoryRegister__Private() +VTKImageIOFactoryRegister__Private() { ObjectFactoryBase::RegisterInternalFactoryOnce(); } diff --git a/Modules/IO/XML/include/itkFancyString.h b/Modules/IO/XML/include/itkFancyString.h index b3385a626db..1a3c050504d 100644 --- a/Modules/IO/XML/include/itkFancyString.h +++ b/Modules/IO/XML/include/itkFancyString.h @@ -213,18 +213,18 @@ class ITKIOXML_EXPORT FancyString ///////////////////////////////////////////////////////////////////////////// bool ITKIOXML_EXPORT - operator!=(itk::FancyString & s, const std::string &); +operator!=(itk::FancyString & s, const std::string &); bool ITKIOXML_EXPORT - operator!=(itk::FancyString & s, const char *); +operator!=(itk::FancyString & s, const char *); bool ITKIOXML_EXPORT - operator!=(itk::FancyString & s, const itk::FancyString &); +operator!=(itk::FancyString & s, const itk::FancyString &); bool ITKIOXML_EXPORT - operator==(itk::FancyString & s, const std::string &); +operator==(itk::FancyString & s, const std::string &); bool ITKIOXML_EXPORT - operator==(itk::FancyString & s, const char *); +operator==(itk::FancyString & s, const char *); bool ITKIOXML_EXPORT - operator==(itk::FancyString & s, const itk::FancyString &); +operator==(itk::FancyString & s, const itk::FancyString &); namespace itk { diff --git a/Modules/Nonunit/IntegratedTest/test/itkShrinkImagePreserveObjectPhysicalLocations.cxx b/Modules/Nonunit/IntegratedTest/test/itkShrinkImagePreserveObjectPhysicalLocations.cxx index a0a39481d2c..6c2628af488 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkShrinkImagePreserveObjectPhysicalLocations.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkShrinkImagePreserveObjectPhysicalLocations.cxx @@ -211,7 +211,7 @@ itkShrinkImagePreserveObjectPhysicalLocations(int, char *[]) smootherShrinkfilter->Update(); TImageType::Pointer GaussianShrinkSmallImage = smootherShrinkfilter->GetOutput(); -//#define WriteDebugImaging +// #define WriteDebugImaging #ifdef WriteDebugImaging using WriterType = itk::ImageFileWriter; auto writer = WriterType::New(); diff --git a/Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.h b/Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.h index 8bdb1ca588a..c0eed87f48c 100644 --- a/Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.h +++ b/Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.h @@ -254,7 +254,8 @@ class ITK_TEMPLATE_EXPORT [[deprecated( // 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 @@ -280,7 +281,8 @@ class ITK_TEMPLATE_EXPORT [[deprecated( itkGetMacro(CalculateOrientedBoundingBox, bool); itkBooleanMacro(CalculateOrientedBoundingBox); - void SetCalculateOrientedBoundingBox(const bool value) + void + SetCalculateOrientedBoundingBox(const bool value) { if (this->m_CalculateOrientedBoundingBox != value) { @@ -298,7 +300,8 @@ class ITK_TEMPLATE_EXPORT [[deprecated( itkGetMacro(CalculateOrientedLabelRegions, bool); itkBooleanMacro(CalculateOrientedLabelRegions); - void SetCalculateOrientedLabelRegions(const bool value) + void + SetCalculateOrientedLabelRegions(const bool value) { if (this->m_CalculateOrientedLabelRegions != value) { @@ -316,7 +319,8 @@ class ITK_TEMPLATE_EXPORT [[deprecated( itkGetMacro(CalculateOrientedIntensityRegions, bool); itkBooleanMacro(CalculateOrientedIntensityRegions); - void SetCalculateOrientedIntensityRegions(const bool value) + void + SetCalculateOrientedIntensityRegions(const bool value) { if (this->m_CalculateOrientedIntensityRegions != value) { @@ -333,83 +337,117 @@ class ITK_TEMPLATE_EXPORT [[deprecated( } /** 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 @@ -417,30 +455,38 @@ class ITK_TEMPLATE_EXPORT [[deprecated( * [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 @@ -451,12 +497,15 @@ class ITK_TEMPLATE_EXPORT [[deprecated( 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{}; diff --git a/Modules/Nonunit/Review/test/itkStochasticFractalDimensionImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkStochasticFractalDimensionImageFilterTest.cxx index 7d12bc45cc2..8a29a2c8d54 100644 --- a/Modules/Nonunit/Review/test/itkStochasticFractalDimensionImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkStochasticFractalDimensionImageFilterTest.cxx @@ -135,13 +135,11 @@ itkStochasticFractalDimensionImageFilterTest(int argc, char * argv[]) switch (imageDimension) { - case 2: - { + case 2: { StochasticFractalDimensionImageFilterTest::Helper<2>::Run(argc, argv); break; } - case 3: - { + case 3: { StochasticFractalDimensionImageFilterTest::Helper<3>::Run(argc, argv); break; } diff --git a/Modules/Numerics/FEM/include/itkFEMP.h b/Modules/Numerics/FEM/include/itkFEMP.h index e7dc73c2f5c..5374a7e901c 100644 --- a/Modules/Numerics/FEM/include/itkFEMP.h +++ b/Modules/Numerics/FEM/include/itkFEMP.h @@ -104,7 +104,11 @@ class FEMP /** * Easy access to members of stored object */ - typename T::Pointer operator->() const { return m_Data; } + typename T::Pointer + operator->() const + { + return m_Data; + } /** * Dereferencing operator provides automatic conversion from diff --git a/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx b/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx index 3342a89c95c..2719633afd5 100644 --- a/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx +++ b/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx @@ -1060,7 +1060,7 @@ RobustSolver::InitializeInterpolationGrid() iter.Set(element); } } // next point in region - } // next element + } // next element } } // end namespace fem diff --git a/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.hxx b/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.hxx index 8fea80ed483..084fc8de1fd 100644 --- a/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.hxx +++ b/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.hxx @@ -473,8 +473,7 @@ FEMScatteredDataPointSetToImageFilterGetType()) { - case itk::CellGeometryEnum::TRIANGLE_CELL: - { + case itk::CellGeometryEnum::TRIANGLE_CELL: { auto triangleEle = FEM2DTriangleType::New(); auto * triangleCell = static_cast(cell); @@ -497,8 +496,7 @@ FEMScatteredDataPointSetToImageFilter(cell); @@ -522,8 +520,7 @@ FEMScatteredDataPointSetToImageFilter(cell); @@ -573,8 +569,7 @@ FEMScatteredDataPointSetToImageFilterGetType()); break; } diff --git a/Modules/Numerics/FEM/include/itkFEMSolver.hxx b/Modules/Numerics/FEM/include/itkFEMSolver.hxx index a96783f1527..20706df152c 100644 --- a/Modules/Numerics/FEM/include/itkFEMSolver.hxx +++ b/Modules/Numerics/FEM/include/itkFEMSolver.hxx @@ -871,7 +871,7 @@ Solver::FillInterpolationGrid() iter.Set(e); } } // next point in region - } // next element + } // next element } template diff --git a/Modules/Numerics/FEM/src/itkFEMElementBase.cxx b/Modules/Numerics/FEM/src/itkFEMElementBase.cxx index b758504c4ef..bde925d6ed3 100644 --- a/Modules/Numerics/FEM/src/itkFEMElementBase.cxx +++ b/Modules/Numerics/FEM/src/itkFEMElementBase.cxx @@ -518,7 +518,9 @@ Element::GetMaterial() const return nullptr; } -void Element::SetMaterial(Material::ConstPointer) {} +void +Element::SetMaterial(Material::ConstPointer) +{} void Element::SetNode(unsigned int n, Node::Pointer node) diff --git a/Modules/Numerics/FEM/src/itkFEMLinearSystemWrapperItpack.cxx b/Modules/Numerics/FEM/src/itkFEMLinearSystemWrapperItpack.cxx index b23c34f4e69..be28b0b95b5 100644 --- a/Modules/Numerics/FEM/src/itkFEMLinearSystemWrapperItpack.cxx +++ b/Modules/Numerics/FEM/src/itkFEMLinearSystemWrapperItpack.cxx @@ -132,7 +132,7 @@ LinearSystemWrapperItpack::InitializeVector(unsigned int vectorIndex) } /* delete old vector */ - delete[](*m_Vectors)[vectorIndex]; + delete[] (*m_Vectors)[vectorIndex]; /* insert new vector */ (*m_Vectors)[vectorIndex] = new doublereal[m_Order]; @@ -180,7 +180,7 @@ LinearSystemWrapperItpack::InitializeSolution(unsigned int solutionIndex) } /* delete old vector */ - delete[](*m_Solutions)[solutionIndex]; + delete[] (*m_Solutions)[solutionIndex]; /* insert new vector */ (*m_Solutions)[solutionIndex] = new doublereal[m_Order]; @@ -235,7 +235,7 @@ LinearSystemWrapperItpack::DestroyVector(unsigned int vectorIndex) } /* delete vector */ - delete[](*m_Vectors)[vectorIndex]; + delete[] (*m_Vectors)[vectorIndex]; (*m_Vectors)[vectorIndex] = nullptr; } } @@ -253,7 +253,7 @@ LinearSystemWrapperItpack::DestroySolution(unsigned int solutionIndex) } /* delete vector */ - delete[](*m_Solutions)[solutionIndex]; + delete[] (*m_Solutions)[solutionIndex]; (*m_Solutions)[solutionIndex] = nullptr; } } @@ -996,7 +996,7 @@ LinearSystemWrapperItpack::~LinearSystemWrapperItpack() { for (i = 0; i < m_NumberOfVectors; ++i) { - delete[](*m_Vectors)[i]; + delete[] (*m_Vectors)[i]; } delete m_Vectors; } @@ -1005,7 +1005,7 @@ LinearSystemWrapperItpack::~LinearSystemWrapperItpack() { for (i = 0; i < m_NumberOfSolutions; ++i) { - delete[](*m_Solutions)[i]; + delete[] (*m_Solutions)[i]; } delete m_Solutions; } diff --git a/Modules/Numerics/FEM/src/itkFEMLoadGrav.cxx b/Modules/Numerics/FEM/src/itkFEMLoadGrav.cxx index c604b90b94e..2d36635e053 100644 --- a/Modules/Numerics/FEM/src/itkFEMLoadGrav.cxx +++ b/Modules/Numerics/FEM/src/itkFEMLoadGrav.cxx @@ -49,7 +49,8 @@ LoadGravConst::CreateAnother() const return smartPtr; } -vnl_vector LoadGravConst::GetGravitationalForceAtPoint(vnl_vector) +vnl_vector +LoadGravConst::GetGravitationalForceAtPoint(vnl_vector) { return m_GravityForce; } diff --git a/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearHexahedronStrainTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearHexahedronStrainTest.cxx index 098cfd05525..29e87947869 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearHexahedronStrainTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearHexahedronStrainTest.cxx @@ -82,9 +82,9 @@ itkFEMElement3DC0LinearHexahedronStrainTest(int argc, char * argv[]) int numDOF = femSO->GetFEMObject()->GetNumberOfDegreesOfFreedom(); vnl_vector soln(numDOF); float exectedResult[24] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.00597587f, 0.000594286f, 0.00250921f, 0.00597587f, -0.000594286f, -0.00250921f, - 0.00597587f, 0.000594286f, -0.00250921f, 0.00597587f, -0.000594286f, 0.00250921f }; + 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.00597587f, 0.000594286f, 0.00250921f, 0.00597587f, -0.000594286f, -0.00250921f, + 0.00597587f, 0.000594286f, -0.00250921f, 0.00597587f, -0.000594286f, 0.00250921f }; bool foundError = false; for (int i = 0; i < numDOF; ++i) diff --git a/Modules/Numerics/NarrowBand/include/itkNarrowBand.h b/Modules/Numerics/NarrowBand/include/itkNarrowBand.h index fd9d42e06fd..11431dea49f 100644 --- a/Modules/Numerics/NarrowBand/include/itkNarrowBand.h +++ b/Modules/Numerics/NarrowBand/include/itkNarrowBand.h @@ -153,9 +153,17 @@ class ITK_TEMPLATE_EXPORT NarrowBand : public LightObject m_NodeContainer.resize(n); } - NodeType & operator[](SizeType n) { return m_NodeContainer[n]; } + NodeType & + operator[](SizeType n) + { + return m_NodeContainer[n]; + } - const NodeType & operator[](SizeType n) const { return m_NodeContainer[n]; } + const NodeType & + operator[](SizeType n) const + { + return m_NodeContainer[n]; + } /** Set/Get the narrow band total radius. The narrow band width will be twice this value (positive and negative distance to the zero level set). diff --git a/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx b/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx index 90a0f1effb1..743540b2e69 100644 --- a/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx +++ b/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx @@ -77,9 +77,9 @@ class NbTestClass : public NarrowBandImageFilterBaseGetInput()->GetRequestedRegion().GetIndex(); typename Superclass::IndexType in; - for (in [0] = 32 + tl[0]; in[0] < tl[0] + static_cast(sz[0]); in[0]++) + for (in[0] = 32 + tl[0]; in[0] < tl[0] + static_cast(sz[0]); in[0]++) { - for (in [1] = tl[1] + 32; in[1] < tl[1] + static_cast(sz[1]); in[1]++) + for (in[1] = tl[1] + 32; in[1] < tl[1] + static_cast(sz[1]); in[1]++) { this->InsertNarrowBandNode(in); } diff --git a/Modules/Numerics/Optimizers/include/itkGradientDescentOptimizer.h b/Modules/Numerics/Optimizers/include/itkGradientDescentOptimizer.h index e970db8f179..eae840c3f1b 100644 --- a/Modules/Numerics/Optimizers/include/itkGradientDescentOptimizer.h +++ b/Modules/Numerics/Optimizers/include/itkGradientDescentOptimizer.h @@ -42,7 +42,7 @@ class GradientDescentOptimizerEnums }; // Define how to print enumeration extern ITKOptimizers_EXPORT std::ostream & - operator<<(std::ostream & out, const GradientDescentOptimizerEnums::StopConditionGradientDescentOptimizer value); +operator<<(std::ostream & out, const GradientDescentOptimizerEnums::StopConditionGradientDescentOptimizer value); /** \class GradientDescentOptimizer * \brief Implement a gradient descent optimizer @@ -192,7 +192,7 @@ class ITKOptimizers_EXPORT GradientDescentOptimizer : public SingleValuedNonLine // Define how to print enumeration extern ITKOptimizers_EXPORT std::ostream & - operator<<(std::ostream & out, const GradientDescentOptimizer::StopConditionGradientDescentOptimizerEnum value); +operator<<(std::ostream & out, const GradientDescentOptimizer::StopConditionGradientDescentOptimizerEnum value); } // end namespace itk diff --git a/Modules/Numerics/Optimizers/include/itkRegularStepGradientDescentBaseOptimizer.h b/Modules/Numerics/Optimizers/include/itkRegularStepGradientDescentBaseOptimizer.h index c74bff690c1..f6826521b15 100644 --- a/Modules/Numerics/Optimizers/include/itkRegularStepGradientDescentBaseOptimizer.h +++ b/Modules/Numerics/Optimizers/include/itkRegularStepGradientDescentBaseOptimizer.h @@ -47,7 +47,7 @@ class RegularStepGradientDescentBaseOptimizerEnums }; // Define how to print enumeration extern ITKOptimizers_EXPORT std::ostream & - operator<<(std::ostream & out, const RegularStepGradientDescentBaseOptimizerEnums::StopCondition value); +operator<<(std::ostream & out, const RegularStepGradientDescentBaseOptimizerEnums::StopCondition value); /** \class RegularStepGradientDescentBaseOptimizer * \brief Implement a gradient descent optimizer diff --git a/Modules/Numerics/Optimizersv4/include/itkCommandIterationUpdatev4.h b/Modules/Numerics/Optimizersv4/include/itkCommandIterationUpdatev4.h index 43b59beb63a..ca9f746befa 100644 --- a/Modules/Numerics/Optimizersv4/include/itkCommandIterationUpdatev4.h +++ b/Modules/Numerics/Optimizersv4/include/itkCommandIterationUpdatev4.h @@ -135,7 +135,7 @@ class CommandIterationUpdatev4 : public Command /** * Constructor */ - CommandIterationUpdatev4(){}; + CommandIterationUpdatev4() {}; private: /** diff --git a/Modules/Numerics/Optimizersv4/include/itkLBFGS2Optimizerv4.h b/Modules/Numerics/Optimizersv4/include/itkLBFGS2Optimizerv4.h index 534dd7fa72a..0512d110869 100644 --- a/Modules/Numerics/Optimizersv4/include/itkLBFGS2Optimizerv4.h +++ b/Modules/Numerics/Optimizersv4/include/itkLBFGS2Optimizerv4.h @@ -519,11 +519,13 @@ class ITK_TEMPLATE_EXPORT LBFGS2Optimizerv4Template /** * itkGradientDecentOptimizerv4Template specific non supported methods. */ - void SetMinimumConvergenceValue(PrecisionType) override + void + SetMinimumConvergenceValue(PrecisionType) override { itkWarningMacro("Not supported. Please use LBFGS specific convergence methods."); }; - void SetConvergenceWindowSize(SizeValueType) override + void + SetConvergenceWindowSize(SizeValueType) override { itkWarningMacro("Not supported. Please use LBFGS specific convergence methods."); }; diff --git a/Modules/Numerics/Optimizersv4/include/itkObjectToObjectMetricBase.h b/Modules/Numerics/Optimizersv4/include/itkObjectToObjectMetricBase.h index eabc0fdd736..b2e86e1d3a7 100644 --- a/Modules/Numerics/Optimizersv4/include/itkObjectToObjectMetricBase.h +++ b/Modules/Numerics/Optimizersv4/include/itkObjectToObjectMetricBase.h @@ -59,9 +59,9 @@ class ObjectToObjectMetricBaseTemplateEnums }; // Define how to print enumeration extern ITKOptimizersv4_EXPORT std::ostream & - operator<<(std::ostream & out, const ObjectToObjectMetricBaseTemplateEnums::GradientSource value); +operator<<(std::ostream & out, const ObjectToObjectMetricBaseTemplateEnums::GradientSource value); extern ITKOptimizersv4_EXPORT std::ostream & - operator<<(std::ostream & out, const ObjectToObjectMetricBaseTemplateEnums::MetricCategory value); +operator<<(std::ostream & out, const ObjectToObjectMetricBaseTemplateEnums::MetricCategory value); /** * \class ObjectToObjectMetricBaseTemplate * \brief Base class for all object-to-object similarity metrics added in ITKv4. diff --git a/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesEstimator.h b/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesEstimator.h index fcc368afbd7..c317aa2203c 100644 --- a/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesEstimator.h +++ b/Modules/Numerics/Optimizersv4/include/itkRegistrationParameterScalesEstimator.h @@ -54,7 +54,7 @@ class RegistrationParameterScalesEstimatorEnums using SamplingStrategyEnum = RegistrationParameterScalesEstimatorEnums::SamplingStrategy; // Define how to print enumeration extern ITKOptimizersv4_EXPORT std::ostream & - operator<<(std::ostream & out, const RegistrationParameterScalesEstimatorEnums::SamplingStrategy value); +operator<<(std::ostream & out, const RegistrationParameterScalesEstimatorEnums::SamplingStrategy value); /** * \class RegistrationParameterScalesEstimator diff --git a/Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.h b/Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.h index f5f03e67b54..0cc3a5235ac 100644 --- a/Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.h +++ b/Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.h @@ -45,7 +45,7 @@ class ExpectationMaximizationMixtureModelEstimatorEnums }; // Define how to print enumeration extern ITKStatistics_EXPORT std::ostream & - operator<<(std::ostream & out, const ExpectationMaximizationMixtureModelEstimatorEnums::TERMINATION_CODE value); +operator<<(std::ostream & out, const ExpectationMaximizationMixtureModelEstimatorEnums::TERMINATION_CODE value); /** * \class ExpectationMaximizationMixtureModelEstimator diff --git a/Modules/Numerics/Statistics/include/itkHistogram.hxx b/Modules/Numerics/Statistics/include/itkHistogram.hxx index 145e12a8909..7d50267b12f 100644 --- a/Modules/Numerics/Statistics/include/itkHistogram.hxx +++ b/Modules/Numerics/Statistics/include/itkHistogram.hxx @@ -71,16 +71,16 @@ Histogram::GetSize(unsigned int dimension) co template auto -Histogram::GetBinMin(unsigned int dimension, InstanceIdentifier nbin) const - -> const MeasurementType & +Histogram::GetBinMin(unsigned int dimension, + InstanceIdentifier nbin) const -> const MeasurementType & { return m_Min[dimension][nbin]; } template auto -Histogram::GetBinMax(unsigned int dimension, InstanceIdentifier nbin) const - -> const MeasurementType & +Histogram::GetBinMax(unsigned int dimension, + InstanceIdentifier nbin) const -> const MeasurementType & { return m_Max[dimension][nbin]; } @@ -329,7 +329,7 @@ Histogram::GetIndex(const MeasurementVectorTy mid = begin + (end - begin) / 2; median = m_Min[dim][mid]; } // end of while - } // end of for() + } // end of for() return true; } @@ -552,16 +552,16 @@ Histogram::GetFrequency(const IndexType & ind template auto -Histogram::GetMeasurement(InstanceIdentifier n, unsigned int dimension) const - -> MeasurementType +Histogram::GetMeasurement(InstanceIdentifier n, + unsigned int dimension) const -> MeasurementType { return static_cast((m_Min[dimension][n] + m_Max[dimension][n]) / 2); } template auto -Histogram::GetFrequency(InstanceIdentifier n, unsigned int dimension) const - -> AbsoluteFrequencyType +Histogram::GetFrequency(InstanceIdentifier n, + unsigned int dimension) const -> AbsoluteFrequencyType { InstanceIdentifier nextOffset = this->m_OffsetTable[dimension + 1]; InstanceIdentifier current = this->m_OffsetTable[dimension] * n; diff --git a/Modules/Numerics/Statistics/include/itkHistogramToRunLengthFeaturesFilter.h b/Modules/Numerics/Statistics/include/itkHistogramToRunLengthFeaturesFilter.h index a3b7c49867b..90d19f3717d 100644 --- a/Modules/Numerics/Statistics/include/itkHistogramToRunLengthFeaturesFilter.h +++ b/Modules/Numerics/Statistics/include/itkHistogramToRunLengthFeaturesFilter.h @@ -57,7 +57,7 @@ class HistogramToRunLengthFeaturesFilterEnums using RunLengthFeatureEnum = HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature; // Define how to print enumeration extern ITKStatistics_EXPORT std::ostream & - operator<<(std::ostream & out, const HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature value); +operator<<(std::ostream & out, const HistogramToRunLengthFeaturesFilterEnums::RunLengthFeature value); /** * \class HistogramToRunLengthFeaturesFilter * \brief This class computes texture feature coefficients from a grey level diff --git a/Modules/Numerics/Statistics/include/itkHistogramToTextureFeaturesFilter.h b/Modules/Numerics/Statistics/include/itkHistogramToTextureFeaturesFilter.h index 448ef4d1f26..35444609e26 100644 --- a/Modules/Numerics/Statistics/include/itkHistogramToTextureFeaturesFilter.h +++ b/Modules/Numerics/Statistics/include/itkHistogramToTextureFeaturesFilter.h @@ -54,7 +54,7 @@ class HistogramToTextureFeaturesFilterEnums }; // Define how to print enumeration extern ITKStatistics_EXPORT std::ostream & - operator<<(std::ostream & out, const HistogramToTextureFeaturesFilterEnums::TextureFeature value); +operator<<(std::ostream & out, const HistogramToTextureFeaturesFilterEnums::TextureFeature value); /** * \class HistogramToTextureFeaturesFilter diff --git a/Modules/Numerics/Statistics/include/itkImageToListSampleAdaptor.hxx b/Modules/Numerics/Statistics/include/itkImageToListSampleAdaptor.hxx index 3044020440e..fb2de9cdc35 100644 --- a/Modules/Numerics/Statistics/include/itkImageToListSampleAdaptor.hxx +++ b/Modules/Numerics/Statistics/include/itkImageToListSampleAdaptor.hxx @@ -56,7 +56,8 @@ ImageToListSampleAdaptor::Size() const -> InstanceIdentifier } template -inline auto ImageToListSampleAdaptor::GetFrequency(InstanceIdentifier) const -> AbsoluteFrequencyType +inline auto +ImageToListSampleAdaptor::GetFrequency(InstanceIdentifier) const -> AbsoluteFrequencyType { if (m_Image.IsNull()) { diff --git a/Modules/Numerics/Statistics/include/itkImageToNeighborhoodSampleAdaptor.hxx b/Modules/Numerics/Statistics/include/itkImageToNeighborhoodSampleAdaptor.hxx index 732e852ffc8..de1bf89790b 100644 --- a/Modules/Numerics/Statistics/include/itkImageToNeighborhoodSampleAdaptor.hxx +++ b/Modules/Numerics/Statistics/include/itkImageToNeighborhoodSampleAdaptor.hxx @@ -82,7 +82,8 @@ ImageToNeighborhoodSampleAdaptor::Size() const -> In } template -inline auto ImageToNeighborhoodSampleAdaptor::GetFrequency(InstanceIdentifier) const +inline auto +ImageToNeighborhoodSampleAdaptor::GetFrequency(InstanceIdentifier) const -> AbsoluteFrequencyType { if (m_Image.IsNull()) diff --git a/Modules/Numerics/Statistics/include/itkJointDomainImageToListSampleAdaptor.hxx b/Modules/Numerics/Statistics/include/itkJointDomainImageToListSampleAdaptor.hxx index e980b18ffa7..47db8f83327 100644 --- a/Modules/Numerics/Statistics/include/itkJointDomainImageToListSampleAdaptor.hxx +++ b/Modules/Numerics/Statistics/include/itkJointDomainImageToListSampleAdaptor.hxx @@ -45,7 +45,8 @@ JointDomainImageToListSampleAdaptor::Size() const -> InstanceIdentifier } template -inline auto JointDomainImageToListSampleAdaptor::GetFrequency(InstanceIdentifier) const -> AbsoluteFrequencyType +inline auto +JointDomainImageToListSampleAdaptor::GetFrequency(InstanceIdentifier) const -> AbsoluteFrequencyType { if (m_Image.IsNull()) { diff --git a/Modules/Numerics/Statistics/include/itkKdTree.h b/Modules/Numerics/Statistics/include/itkKdTree.h index d080365a145..0e227bcb402 100644 --- a/Modules/Numerics/Statistics/include/itkKdTree.h +++ b/Modules/Numerics/Statistics/include/itkKdTree.h @@ -129,7 +129,7 @@ struct ITK_TEMPLATE_EXPORT KdTreeNode /** Destructor */ virtual ~KdTreeNode() = default; // needed to subclasses will actually be deleted -}; // end of class +}; // end of class /** * \class KdTreeNonterminalNode @@ -225,7 +225,11 @@ struct ITK_TEMPLATE_EXPORT KdTreeNonterminalNode : public KdTreeNode * this node in the tree. This MeasurementVector will be used later during * the distance computation when querying the tree. */ - InstanceIdentifier GetInstanceIdentifier(InstanceIdentifier) const override { return this->m_InstanceIdentifier; } + InstanceIdentifier + GetInstanceIdentifier(InstanceIdentifier) const override + { + return this->m_InstanceIdentifier; + } /** * Set the identifier of the node. @@ -354,7 +358,11 @@ struct ITK_TEMPLATE_EXPORT KdTreeWeightedCentroidNonterminalNode : public KdTree * this node in the tree. This MeasurementVector will be used later during * the distance computation when querying the tree. */ - InstanceIdentifier GetInstanceIdentifier(InstanceIdentifier) const override { return this->m_InstanceIdentifier; } + InstanceIdentifier + GetInstanceIdentifier(InstanceIdentifier) const override + { + return this->m_InstanceIdentifier; + } /** * Set the identifier of the node. diff --git a/Modules/Numerics/Statistics/include/itkKdTreeBasedKmeansEstimator.h b/Modules/Numerics/Statistics/include/itkKdTreeBasedKmeansEstimator.h index fa3bd8ec446..15abfab5a7f 100644 --- a/Modules/Numerics/Statistics/include/itkKdTreeBasedKmeansEstimator.h +++ b/Modules/Numerics/Statistics/include/itkKdTreeBasedKmeansEstimator.h @@ -246,7 +246,11 @@ class ITK_TEMPLATE_EXPORT KdTreeBasedKmeansEstimator : public Object } /** gets the index-th candidates */ - Candidate & operator[](int index) { return m_Candidates[index]; } + Candidate & + operator[](int index) + { + return m_Candidates[index]; + } private: /** internal storage for the candidates */ diff --git a/Modules/Numerics/Statistics/include/itkMembershipSample.hxx b/Modules/Numerics/Statistics/include/itkMembershipSample.hxx index 7a7ef04b1c2..261df68e247 100644 --- a/Modules/Numerics/Statistics/include/itkMembershipSample.hxx +++ b/Modules/Numerics/Statistics/include/itkMembershipSample.hxx @@ -108,8 +108,8 @@ MembershipSample::GetMeasurementVector(const InstanceIdentifier & id) c template inline auto -MembershipSample::GetMeasurement(const InstanceIdentifier & id, const unsigned int dimension) - -> MeasurementType +MembershipSample::GetMeasurement(const InstanceIdentifier & id, + const unsigned int dimension) -> MeasurementType { return m_Sample->GetMeasurement(id, dimension); } diff --git a/Modules/Numerics/Statistics/include/itkPointSetToListSampleAdaptor.hxx b/Modules/Numerics/Statistics/include/itkPointSetToListSampleAdaptor.hxx index 82c2c543b62..7848ca5ae0c 100644 --- a/Modules/Numerics/Statistics/include/itkPointSetToListSampleAdaptor.hxx +++ b/Modules/Numerics/Statistics/include/itkPointSetToListSampleAdaptor.hxx @@ -96,7 +96,8 @@ PointSetToListSampleAdaptor::GetMeasurementVector(InstanceIdentifier } template -inline auto PointSetToListSampleAdaptor::GetFrequency(InstanceIdentifier) const -> AbsoluteFrequencyType +inline auto +PointSetToListSampleAdaptor::GetFrequency(InstanceIdentifier) const -> AbsoluteFrequencyType { if (m_PointSet.IsNull()) { diff --git a/Modules/Numerics/Statistics/include/itkSampleClassifierFilter.hxx b/Modules/Numerics/Statistics/include/itkSampleClassifierFilter.hxx index 9a8e76ffac2..831106c0248 100644 --- a/Modules/Numerics/Statistics/include/itkSampleClassifierFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkSampleClassifierFilter.hxx @@ -87,8 +87,8 @@ SampleClassifierFilter::SetMembershipFunctionsWeightsArray( } template -typename SampleClassifierFilter::DataObjectPointer SampleClassifierFilter::MakeOutput( - DataObjectPointerArraySizeType) +typename SampleClassifierFilter::DataObjectPointer +SampleClassifierFilter::MakeOutput(DataObjectPointerArraySizeType) { return MembershipSampleType::New().GetPointer(); } diff --git a/Modules/Numerics/Statistics/include/itkSampleToHistogramFilter.hxx b/Modules/Numerics/Statistics/include/itkSampleToHistogramFilter.hxx index 4fa745e022d..e4f3c661f65 100644 --- a/Modules/Numerics/Statistics/include/itkSampleToHistogramFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkSampleToHistogramFilter.hxx @@ -75,7 +75,7 @@ SampleToHistogramFilter::GraftOutput(DataObject * graft) template typename SampleToHistogramFilter::DataObjectPointer - SampleToHistogramFilter::MakeOutput(DataObjectPointerArraySizeType) +SampleToHistogramFilter::MakeOutput(DataObjectPointerArraySizeType) { return HistogramType::New().GetPointer(); } diff --git a/Modules/Numerics/Statistics/include/itkSampleToSubsampleFilter.hxx b/Modules/Numerics/Statistics/include/itkSampleToSubsampleFilter.hxx index e3e116a86a1..15b72900784 100644 --- a/Modules/Numerics/Statistics/include/itkSampleToSubsampleFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkSampleToSubsampleFilter.hxx @@ -50,8 +50,8 @@ SampleToSubsampleFilter::GetInput() const -> const SampleType * } template -typename SampleToSubsampleFilter::DataObjectPointer SampleToSubsampleFilter::MakeOutput( - DataObjectPointerArraySizeType) +typename SampleToSubsampleFilter::DataObjectPointer +SampleToSubsampleFilter::MakeOutput(DataObjectPointerArraySizeType) { return SubsampleType::New().GetPointer(); } diff --git a/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceListSampleFilter.hxx b/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceListSampleFilter.hxx index 91098760350..a514e97a26b 100644 --- a/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceListSampleFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkScalarImageToCooccurrenceListSampleFilter.hxx @@ -65,7 +65,7 @@ ScalarImageToCooccurrenceListSampleFilter::GetOutput() const -> const Sa template typename ScalarImageToCooccurrenceListSampleFilter::DataObjectPointer - ScalarImageToCooccurrenceListSampleFilter::MakeOutput(DataObjectPointerArraySizeType) +ScalarImageToCooccurrenceListSampleFilter::MakeOutput(DataObjectPointerArraySizeType) { return SampleType::New().GetPointer(); } diff --git a/Modules/Numerics/Statistics/include/itkVectorContainerToListSampleAdaptor.hxx b/Modules/Numerics/Statistics/include/itkVectorContainerToListSampleAdaptor.hxx index 775093d37e3..01c47c01a76 100644 --- a/Modules/Numerics/Statistics/include/itkVectorContainerToListSampleAdaptor.hxx +++ b/Modules/Numerics/Statistics/include/itkVectorContainerToListSampleAdaptor.hxx @@ -63,8 +63,8 @@ VectorContainerToListSampleAdaptor::GetMeasurementVector(Insta } template -inline auto VectorContainerToListSampleAdaptor::GetFrequency(InstanceIdentifier) const - -> AbsoluteFrequencyType +inline auto +VectorContainerToListSampleAdaptor::GetFrequency(InstanceIdentifier) const -> AbsoluteFrequencyType { if (this->m_VectorContainer.IsNull()) { diff --git a/Modules/Numerics/Statistics/src/itkSparseFrequencyContainer2.cxx b/Modules/Numerics/Statistics/src/itkSparseFrequencyContainer2.cxx index 30c57f1d506..0b5b9a4e359 100644 --- a/Modules/Numerics/Statistics/src/itkSparseFrequencyContainer2.cxx +++ b/Modules/Numerics/Statistics/src/itkSparseFrequencyContainer2.cxx @@ -26,7 +26,8 @@ SparseFrequencyContainer2::SparseFrequencyContainer2() m_TotalFrequency = TotalAbsoluteFrequencyType{}; } -void SparseFrequencyContainer2::Initialize(SizeValueType) +void +SparseFrequencyContainer2::Initialize(SizeValueType) { this->SetToZero(); } diff --git a/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest2.cxx b/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest2.cxx index 6794ca652bf..2ff207a10a2 100644 --- a/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest2.cxx @@ -31,7 +31,8 @@ using SubsampleType = itk::Statistics::Subsample; constexpr unsigned int testDimension = 1; -void resetData(itk::Image::Pointer image, std::vector & refVector) +void +resetData(itk::Image::Pointer image, std::vector & refVector) { ImageType::IndexType index; ImageType::SizeType size; diff --git a/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx b/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx index d4320bf1989..cf81049fa55 100644 --- a/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx +++ b/Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx @@ -153,14 +153,12 @@ BlockMatchingImageFilter &, - const itk::Matrix); + void + CreateMatrix(itk::Matrix &, + const itk::Matrix); FixedImagePointer m_ReferenceImage{}; TransformPointer m_Transform{}; diff --git a/Modules/Registration/Common/include/itkLandmarkBasedTransformInitializer.hxx b/Modules/Registration/Common/include/itkLandmarkBasedTransformInitializer.hxx index a9e8b02d8f9..69f923191b6 100644 --- a/Modules/Registration/Common/include/itkLandmarkBasedTransformInitializer.hxx +++ b/Modules/Registration/Common/include/itkLandmarkBasedTransformInitializer.hxx @@ -790,7 +790,8 @@ LandmarkBasedTransformInitializer::Comput } template -void LandmarkBasedTransformInitializer::CreateMatrix( +void +LandmarkBasedTransformInitializer::CreateMatrix( itk::Matrix & N, const itk::Matrix M) { diff --git a/Modules/Registration/Common/include/itkMattesMutualInformationImageToImageMetric.hxx b/Modules/Registration/Common/include/itkMattesMutualInformationImageToImageMetric.hxx index 14de3132087..9a4a03d32fa 100644 --- a/Modules/Registration/Common/include/itkMattesMutualInformationImageToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkMattesMutualInformationImageToImageMetric.hxx @@ -533,8 +533,8 @@ MattesMutualInformationImageToImageMetric::GetValue(c sum += jointPDFValue * (pRatio - std::log(fixedImagePDFValue)); } } // end if-block to check non-zero bin contribution - } // end for-loop over moving index - } // end for-loop over fixed index + } // end for-loop over moving index + } // end for-loop over fixed index return static_cast(-1.0 * sum); } @@ -788,8 +788,8 @@ MattesMutualInformationImageToImageMetric::GetValueAn this->m_PRatioArray[fixedIndex][movingIndex] = pRatio * nFactor; } } // end if-block to check non-zero bin contribution - } // end for-loop over moving index - } // end for-loop over fixed index + } // end for-loop over moving index + } // end for-loop over fixed index if (!(this->m_UseExplicitPDFDerivatives)) { @@ -1029,8 +1029,8 @@ MattesMutualInformationImageToImageMetric::ComputePDF precomputedWeight * derivativeContribution; } } // end mu for loop - } // end dim for loop - } // end if-block transform is BSpline + } // end dim for loop + } // end if-block transform is BSpline } } // end namespace itk diff --git a/Modules/Registration/Common/include/itkSimpleMultiResolutionImageRegistrationUI.h b/Modules/Registration/Common/include/itkSimpleMultiResolutionImageRegistrationUI.h index 46b620847f4..7937ff33788 100644 --- a/Modules/Registration/Common/include/itkSimpleMultiResolutionImageRegistrationUI.h +++ b/Modules/Registration/Common/include/itkSimpleMultiResolutionImageRegistrationUI.h @@ -80,7 +80,7 @@ class ITK_TEMPLATE_EXPORT SimpleMultiResolutionImageRegistrationUI2 itk::MultiResolutionImageRegistrationMethod, itk::Image>>; SimpleMultiResolutionImageRegistrationUI2(TRegistration * ptr) - : Superclass(ptr){}; + : Superclass(ptr) {}; ~SimpleMultiResolutionImageRegistrationUI2() override = default; void diff --git a/Modules/Registration/Common/include/itkTransformParametersAdaptor.h b/Modules/Registration/Common/include/itkTransformParametersAdaptor.h index 7439f492f1d..ef8eda56e50 100644 --- a/Modules/Registration/Common/include/itkTransformParametersAdaptor.h +++ b/Modules/Registration/Common/include/itkTransformParametersAdaptor.h @@ -107,7 +107,7 @@ class TransformParametersAdaptor /** Initialize the transform using the specified fixed parameters */ void - AdaptTransformParameters() override{}; + AdaptTransformParameters() override {}; protected: TransformParametersAdaptor() = default; diff --git a/Modules/Registration/FEM/include/itkFEMFiniteDifferenceFunctionLoad.hxx b/Modules/Registration/FEM/include/itkFEMFiniteDifferenceFunctionLoad.hxx index d84a128993c..308e50d4e16 100644 --- a/Modules/Registration/FEM/include/itkFEMFiniteDifferenceFunctionLoad.hxx +++ b/Modules/Registration/FEM/include/itkFEMFiniteDifferenceFunctionLoad.hxx @@ -121,8 +121,8 @@ FiniteDifferenceFunctionLoad::SetCurrentEnergy(double e) template auto -FiniteDifferenceFunctionLoad::EvaluateMetricGivenSolution(ElementContainerType * el, Float step) - -> Float +FiniteDifferenceFunctionLoad::EvaluateMetricGivenSolution(ElementContainerType * el, + Float step) -> Float { Float energy = 0.0, defe = 0.0; diff --git a/Modules/Registration/FEM/include/itkFEMRegistrationFilter.hxx b/Modules/Registration/FEM/include/itkFEMRegistrationFilter.hxx index aca3c970f00..32c40473285 100644 --- a/Modules/Registration/FEM/include/itkFEMRegistrationFilter.hxx +++ b/Modules/Registration/FEM/include/itkFEMRegistrationFilter.hxx @@ -765,7 +765,7 @@ FEMRegistrationFilter::InterpolateVectorF } } } // end of for loops - } // end of elt array loop + } // end of elt array loop } // Ensure that the values are exact at the nodes. They won't necessarily be unless we use this code. diff --git a/Modules/Registration/FEM/include/itkMIRegistrationFunction.hxx b/Modules/Registration/FEM/include/itkMIRegistrationFunction.hxx index cded3467dc2..d2bed1b6e46 100644 --- a/Modules/Registration/FEM/include/itkMIRegistrationFunction.hxx +++ b/Modules/Registration/FEM/include/itkMIRegistrationFunction.hxx @@ -481,7 +481,7 @@ MIRegistrationFunction::ComputeUp derivative[i] += (fixedGradientsB[bsamples][i] - fixedGradientsA[asamples][i]) * weight; } } // end of sample A loop - } // end of sample B loop + } // end of sample B loop const double threshold = -0.1 * nsamp * std::log(m_MinProbability); if (dLogSumMoving > threshold || dLogSumFixed > threshold || dLogSumJoint > threshold) diff --git a/Modules/Registration/FEM/test/itkFEMFiniteDifferenceFunctionLoadTest.cxx b/Modules/Registration/FEM/test/itkFEMFiniteDifferenceFunctionLoadTest.cxx index 9d620f89483..e3b5c53258d 100644 --- a/Modules/Registration/FEM/test/itkFEMFiniteDifferenceFunctionLoadTest.cxx +++ b/Modules/Registration/FEM/test/itkFEMFiniteDifferenceFunctionLoadTest.cxx @@ -330,7 +330,7 @@ RunTest(InputImageType * fixedImage, outField->SetPixel(index, pixelVal); } // end of for (each node in an element) - } // end of for(each element) + } // end of for(each element) // Write to vector image auto forceFieldWriter = FieldWriterType::New(); diff --git a/Modules/Registration/Metricsv4/include/itkDefaultImageToImageMetricTraitsv4.h b/Modules/Registration/Metricsv4/include/itkDefaultImageToImageMetricTraitsv4.h index c935a05fb2c..d2fe899041d 100644 --- a/Modules/Registration/Metricsv4/include/itkDefaultImageToImageMetricTraitsv4.h +++ b/Modules/Registration/Metricsv4/include/itkDefaultImageToImageMetricTraitsv4.h @@ -113,8 +113,8 @@ class DefaultImageToImageMetricTraitsv4 }; } // end namespace itk -//#ifndef ITK_MANUAL_INSTANTIATION -//#include "itkDefaultImageToImageMetricTraitsv4.hxx" -//#endif +// #ifndef ITK_MANUAL_INSTANTIATION +// #include "itkDefaultImageToImageMetricTraitsv4.hxx" +// #endif #endif diff --git a/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationImageToImageMetricv4.hxx b/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationImageToImageMetricv4.hxx index 107909a6d58..7097f6ec97a 100644 --- a/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationImageToImageMetricv4.hxx +++ b/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationImageToImageMetricv4.hxx @@ -379,7 +379,7 @@ JointHistogramMutualInformationImageToImageMetricv4m_Log2); } diff --git a/Modules/Registration/Metricsv4/include/itkMattesMutualInformationImageToImageMetricv4.hxx b/Modules/Registration/Metricsv4/include/itkMattesMutualInformationImageToImageMetricv4.hxx index b3690607f05..6bfc2246984 100644 --- a/Modules/Registration/Metricsv4/include/itkMattesMutualInformationImageToImageMetricv4.hxx +++ b/Modules/Registration/Metricsv4/include/itkMattesMutualInformationImageToImageMetricv4.hxx @@ -415,9 +415,9 @@ MattesMutualInformationImageToImageMetricv4 closeToZero && movingImageMarginalPDF > closeToZero ) - } // end for-loop over moving index - } // end conditional for fixedMarginalPDF > close to zero - } // end for-loop over fixed index + } // end for-loop over moving index + } // end conditional for fixedMarginalPDF > close to zero + } // end for-loop over fixed index // Apply the pRatio and sum the per-window derivative // contributions, in the local-support case. diff --git a/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxx index aae939ed628..f210ebd1f88 100644 --- a/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxx @@ -522,7 +522,7 @@ itkImageToImageMetricv4Test(int, char ** const) computeNewTruthValues = false; } } // loop through permutations - } // loop thru # of threads + } // loop thru # of threads // Test that non-overlapping images will generate a warning diff --git a/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4Test.cxx index 2f33211a728..8598954a644 100644 --- a/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4Test.cxx @@ -64,7 +64,7 @@ TestMattesMetricWithAffineTransform(TInterpolator * const interpolator, const bo const unsigned int ImageDimension = MovingImageType::ImageDimension; // Image size is scaled to represent sqrt(256^3) typename MovingImageType::SizeType size = { { static_cast(imageSize), - static_cast(imageSize) } }; + static_cast(imageSize) } }; typename MovingImageType::IndexType index = { { 0, 0 } }; typename MovingImageType::RegionType region{ index, size }; diff --git a/Modules/Registration/PDEDeformable/include/itkESMDemonsRegistrationFunction.h b/Modules/Registration/PDEDeformable/include/itkESMDemonsRegistrationFunction.h index 12c6df73b6d..a877924989b 100644 --- a/Modules/Registration/PDEDeformable/include/itkESMDemonsRegistrationFunction.h +++ b/Modules/Registration/PDEDeformable/include/itkESMDemonsRegistrationFunction.h @@ -47,7 +47,7 @@ class ESMDemonsRegistrationFunctionEnums }; // Define how to print enumeration extern ITKPDEDeformableRegistration_EXPORT std::ostream & - operator<<(std::ostream & out, const ESMDemonsRegistrationFunctionEnums::Gradient value); +operator<<(std::ostream & out, const ESMDemonsRegistrationFunctionEnums::Gradient value); /** * \class ESMDemonsRegistrationFunction * diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.h b/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.h index 3b96d945b99..6fdfd51f94f 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.h +++ b/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.h @@ -57,7 +57,7 @@ class ImageRegistrationMethodv4Enums }; // Define how to print enumeration extern ITKRegistrationMethodsv4_EXPORT std::ostream & - operator<<(std::ostream & out, const ImageRegistrationMethodv4Enums::MetricSamplingStrategy value); +operator<<(std::ostream & out, const ImageRegistrationMethodv4Enums::MetricSamplingStrategy value); /** \class ImageRegistrationMethodv4 * \brief Interface method for the current registration framework. diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx b/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx index 6b962edb3cf..b0d9384c553 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx +++ b/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx @@ -965,8 +965,7 @@ ImageRegistrationMethodv4m_MetricSamplingStrategy) { - case MetricSamplingStrategyEnum::REGULAR: - { + case MetricSamplingStrategyEnum::REGULAR: { const auto sampleCount = static_cast(std::ceil(1.0 / this->m_MetricSamplingPercentagePerLevel[this->m_CurrentLevel])); unsigned long count = @@ -995,8 +994,7 @@ ImageRegistrationMethodv4(static_cast(totalVirtualDomainVoxels) * @@ -1029,8 +1027,7 @@ ImageRegistrationMethodv4::E { m_Covariance[classIndex][band_x][band_y] = m_Covariance[classIndex][band_y][band_x]; } // end band_y loop - } // end band_x loop - } // end if loop - } // end class index loop + } // end band_x loop + } // end if loop + } // end class index loop } } // end namespace itk diff --git a/Modules/Segmentation/DeformableMesh/include/itkDeformableSimplexMesh3DGradientConstraintForceFilter.h b/Modules/Segmentation/DeformableMesh/include/itkDeformableSimplexMesh3DGradientConstraintForceFilter.h index 7522172b1cd..f925d7de513 100644 --- a/Modules/Segmentation/DeformableMesh/include/itkDeformableSimplexMesh3DGradientConstraintForceFilter.h +++ b/Modules/Segmentation/DeformableMesh/include/itkDeformableSimplexMesh3DGradientConstraintForceFilter.h @@ -131,7 +131,7 @@ class DeformableSimplexMesh3DGradientConstraintForceFilterEnums }; // Define how to print enumeration extern ITKDeformableMesh_EXPORT std::ostream & - operator<<(std::ostream & out, const DeformableSimplexMesh3DGradientConstraintForceFilterEnums::SIDE value); +operator<<(std::ostream & out, const DeformableSimplexMesh3DGradientConstraintForceFilterEnums::SIDE value); /** * \class DeformableSimplexMesh3DGradientConstraintForceFilter * \brief diff --git a/Modules/Segmentation/KLMRegionGrowing/src/itkKLMSegmentationRegion.cxx b/Modules/Segmentation/KLMRegionGrowing/src/itkKLMSegmentationRegion.cxx index 370456da3f9..da6117c3713 100644 --- a/Modules/Segmentation/KLMRegionGrowing/src/itkKLMSegmentationRegion.cxx +++ b/Modules/Segmentation/KLMRegionGrowing/src/itkKLMSegmentationRegion.cxx @@ -378,7 +378,7 @@ KLMSegmentationRegion::SpliceRegionBorders(Self * region) { itkExceptionMacro("Invalid region border"); } // end else - } // end of while + } // end of while // If any borders remain in thisRegionBordersIt, put them in the back while (thisRegionBordersIt != endOfThisRegionBorders) diff --git a/Modules/Segmentation/LevelSets/include/itkImplicitManifoldNormalVectorFilter.hxx b/Modules/Segmentation/LevelSets/include/itkImplicitManifoldNormalVectorFilter.hxx index ee5b0d232c1..02340062ec4 100644 --- a/Modules/Segmentation/LevelSets/include/itkImplicitManifoldNormalVectorFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkImplicitManifoldNormalVectorFilter.hxx @@ -187,7 +187,7 @@ ImplicitManifoldNormalVectorFilter::InitializeN derivative -= it.GetPixel(position); } } // if - } // counter loop + } // counter loop derivative *= m_DimConst2; } // if i!=j else diff --git a/Modules/Segmentation/LevelSets/include/itkLevelSetFunctionWithRefitTerm.hxx b/Modules/Segmentation/LevelSets/include/itkLevelSetFunctionWithRefitTerm.hxx index 81c56411527..3b6348e6fff 100644 --- a/Modules/Segmentation/LevelSets/include/itkLevelSetFunctionWithRefitTerm.hxx +++ b/Modules/Segmentation/LevelSets/include/itkLevelSetFunctionWithRefitTerm.hxx @@ -28,8 +28,8 @@ const typename LevelSetFunctionWithRefitTerm::Neig template const typename LevelSetFunctionWithRefitTerm::ScalarValueType - LevelSetFunctionWithRefitTerm::m_DimConst = static_cast(2.0 / - m_NumVertex); + LevelSetFunctionWithRefitTerm::m_DimConst = + static_cast(2.0 / m_NumVertex); template LevelSetFunctionWithRefitTerm::LevelSetFunctionWithRefitTerm() @@ -125,7 +125,7 @@ LevelSetFunctionWithRefitTerm::ComputeCurvature( normalvector[j] -= neighborhood.GetPixel(positionP) * neighborhoodScales[j]; } } // end counterP - } // end derivative axis + } // end derivative axis normalvector = normalvector / (m_MinVectorNorm + normalvector.GetNorm()); // add normal to curvature computation for (j = 0; j < TImageType::ImageDimension; ++j) // derivative axis @@ -139,7 +139,7 @@ LevelSetFunctionWithRefitTerm::ComputeCurvature( curvature += normalvector[j] * neighborhoodScales[j]; } } // end derivative axis - } // end counterN + } // end counterN curvature *= m_DimConst; diff --git a/Modules/Segmentation/LevelSets/include/itkNormalVectorDiffusionFunction.hxx b/Modules/Segmentation/LevelSets/include/itkNormalVectorDiffusionFunction.hxx index 5319473d0a6..6984ca00f2b 100644 --- a/Modules/Segmentation/LevelSets/include/itkNormalVectorDiffusionFunction.hxx +++ b/Modules/Segmentation/LevelSets/include/itkNormalVectorDiffusionFunction.hxx @@ -167,7 +167,7 @@ NormalVectorDiffusionFunction::PrecomputeSparseUpdate(Neighbor CenterNode->m_Flux[i] = flux; } } // end if-else PreviousNode==0 - } // end flux offset axis + } // end flux offset axis } template diff --git a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetContainerBase.h b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetContainerBase.h index 01e383bdf40..eefc5a39ff7 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetContainerBase.h +++ b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetContainerBase.h @@ -110,8 +110,16 @@ class ITK_TEMPLATE_EXPORT LevelSetContainerBase : public Object : m_Iterator(it.m_Iterator) {} - ConstIterator & operator*() { return *this; } - ConstIterator * operator->() { return this; } + ConstIterator & + operator*() + { + return *this; + } + ConstIterator * + operator->() + { + return this; + } ConstIterator & operator++() { @@ -186,8 +194,16 @@ class ITK_TEMPLATE_EXPORT LevelSetContainerBase : public Object {} ~Iterator() = default; - Iterator & operator*() { return *this; } - Iterator * operator->() { return this; } + Iterator & + operator*() + { + return *this; + } + Iterator * + operator->() + { + return this; + } Iterator & operator++() { diff --git a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationContainer.h b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationContainer.h index cef6a9e9a46..c0fc33eb320 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationContainer.h +++ b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationContainer.h @@ -138,8 +138,16 @@ class ITK_TEMPLATE_EXPORT LevelSetEquationContainer : public Object ConstIterator(const Iterator & it) : m_Iterator(it.m_Iterator) {} - ConstIterator & operator*() { return *this; } - ConstIterator * operator->() { return this; } + ConstIterator & + operator*() + { + return *this; + } + ConstIterator * + operator->() + { + return this; + } ConstIterator & operator++() { @@ -211,8 +219,16 @@ class ITK_TEMPLATE_EXPORT LevelSetEquationContainer : public Object {} ~Iterator() = default; - Iterator & operator*() { return *this; } - Iterator * operator->() { return this; } + Iterator & + operator*() + { + return *this; + } + Iterator * + operator->() + { + return this; + } Iterator & operator++() diff --git a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationTermContainer.h b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationTermContainer.h index 234da8c0424..77a87cd6486 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationTermContainer.h +++ b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationTermContainer.h @@ -155,8 +155,16 @@ class ITK_TEMPLATE_EXPORT LevelSetEquationTermContainer : public Object ConstIterator(const Iterator & it) : m_Iterator(it.m_Iterator) {} - ConstIterator & operator*() { return *this; } - ConstIterator * operator->() { return this; } + ConstIterator & + operator*() + { + return *this; + } + ConstIterator * + operator->() + { + return this; + } ConstIterator & operator++() { @@ -228,8 +236,16 @@ class ITK_TEMPLATE_EXPORT LevelSetEquationTermContainer : public Object {} ~Iterator() = default; - Iterator & operator*() { return *this; } - Iterator * operator->() { return this; } + Iterator & + operator*() + { + return *this; + } + Iterator * + operator->() + { + return this; + } Iterator & operator++() diff --git a/Modules/Segmentation/MarkovRandomFieldsClassifiers/include/itkMRFImageFilter.hxx b/Modules/Segmentation/MarkovRandomFieldsClassifiers/include/itkMRFImageFilter.hxx index 71e460fb113..5eb5b626125 100644 --- a/Modules/Segmentation/MarkovRandomFieldsClassifiers/include/itkMRFImageFilter.hxx +++ b/Modules/Segmentation/MarkovRandomFieldsClassifiers/include/itkMRFImageFilter.hxx @@ -532,7 +532,7 @@ MRFImageFilter::DoNeighborhoodOperation( maximumDistance = tmpPixDistance; pixLabel = index; } // if - } // for + } // for // Read the current pixel label LabelledImagePixelType * previousLabel = labelledIter.GetCenterValue(); diff --git a/Modules/Segmentation/RegionGrowing/include/itkConnectedThresholdImageFilter.h b/Modules/Segmentation/RegionGrowing/include/itkConnectedThresholdImageFilter.h index 5a5d55e6b31..f35ff95d789 100644 --- a/Modules/Segmentation/RegionGrowing/include/itkConnectedThresholdImageFilter.h +++ b/Modules/Segmentation/RegionGrowing/include/itkConnectedThresholdImageFilter.h @@ -49,7 +49,7 @@ class ConnectedThresholdImageFilterEnums // Define how to print enumeration extern ITKRegionGrowing_EXPORT std::ostream & - operator<<(std::ostream & out, const ConnectedThresholdImageFilterEnums::Connectivity value); +operator<<(std::ostream & out, const ConnectedThresholdImageFilterEnums::Connectivity value); /** * \class ConnectedThresholdImageFilter * \brief Label pixels that are connected to a seed and lie within a range of values diff --git a/Modules/Segmentation/Watersheds/include/itkWatershedBoundaryResolver.hxx b/Modules/Segmentation/Watersheds/include/itkWatershedBoundaryResolver.hxx index d84ad72fae1..5905ff510d6 100644 --- a/Modules/Segmentation/Watersheds/include/itkWatershedBoundaryResolver.hxx +++ b/Modules/Segmentation/Watersheds/include/itkWatershedBoundaryResolver.hxx @@ -96,7 +96,7 @@ BoundaryResolver::GenerateOutputRequestedRegion(DataObje template typename BoundaryResolver::DataObjectPointer - BoundaryResolver::MakeOutput(DataObjectPointerArraySizeType) +BoundaryResolver::MakeOutput(DataObjectPointerArraySizeType) { return EquivalencyTable::New().GetPointer(); } diff --git a/Modules/Segmentation/Watersheds/include/itkWatershedEquivalenceRelabeler.hxx b/Modules/Segmentation/Watersheds/include/itkWatershedEquivalenceRelabeler.hxx index 6cd7d62161e..d0897854cc9 100644 --- a/Modules/Segmentation/Watersheds/include/itkWatershedEquivalenceRelabeler.hxx +++ b/Modules/Segmentation/Watersheds/include/itkWatershedEquivalenceRelabeler.hxx @@ -114,7 +114,7 @@ EquivalenceRelabeler::PrintSelf(std::ostream & os, Ind template typename EquivalenceRelabeler::DataObjectPointer - EquivalenceRelabeler::MakeOutput(DataObjectPointerArraySizeType) +EquivalenceRelabeler::MakeOutput(DataObjectPointerArraySizeType) { return ImageType::New().GetPointer(); } diff --git a/Modules/Video/BridgeOpenCV/include/itkOpenCVImageBridge.hxx b/Modules/Video/BridgeOpenCV/include/itkOpenCVImageBridge.hxx index 7e0b82620cf..c443d8b7724 100644 --- a/Modules/Video/BridgeOpenCV/include/itkOpenCVImageBridge.hxx +++ b/Modules/Video/BridgeOpenCV/include/itkOpenCVImageBridge.hxx @@ -50,8 +50,7 @@ OpenCVImageBridge::IplImageToITKImage(const IplImage * in) auto out = ImageType::New(); #define CONVERSION_CASE(iplInputDepthID, itkOutputPixelType) \ - case (iplInputDepthID): \ - { \ + case (iplInputDepthID): { \ static_assert((iplInputDepthID) <= NumericTraits::max() && \ (iplInputDepthID) >= NumericTraits::min(), \ "Invalid IPL depth ID: " #iplInputDepthID); \ @@ -68,8 +67,7 @@ OpenCVImageBridge::IplImageToITKImage(const IplImage * in) CONVERSION_CASE(IPL_DEPTH_32S, int) CONVERSION_CASE(IPL_DEPTH_32F, float) CONVERSION_CASE(IPL_DEPTH_64F, double) - default: - { + default: { itkGenericExceptionMacro("Unknown OpenCV type"); } } @@ -92,8 +90,7 @@ OpenCVImageBridge::CVMatToITKImage(const cv::Mat & in) auto out = ImageType::New(); #define CONVERSION_CASE(inputDepthID, itkOutputPixelType) \ - case (inputDepthID): \ - { \ + case (inputDepthID): { \ static_assert((inputDepthID) <= NumericTraits::max() && \ (inputDepthID) >= NumericTraits::min(), \ "Invalid Mat depth ID: " #inputDepthID); \ @@ -110,8 +107,7 @@ OpenCVImageBridge::CVMatToITKImage(const cv::Mat & in) CONVERSION_CASE(CV_32S, int) CONVERSION_CASE(CV_32F, float) CONVERSION_CASE(CV_64F, double) - default: - { + default: { itkGenericExceptionMacro("Unknown OpenCV type"); } } diff --git a/Modules/Video/Core/src/itkTemporalDataObject.cxx b/Modules/Video/Core/src/itkTemporalDataObject.cxx index a9199610dcc..892e33c096a 100644 --- a/Modules/Video/Core/src/itkTemporalDataObject.cxx +++ b/Modules/Video/Core/src/itkTemporalDataObject.cxx @@ -210,16 +210,13 @@ TemporalDataObject::RequestedRegionIsOutsideOfTheBufferedRegion() switch (m_TemporalUnit) { - case TemporalUnitEnum::Frame: - { + case TemporalUnitEnum::Frame: { return frameFlag; } - case TemporalUnitEnum::RealTime: - { + case TemporalUnitEnum::RealTime: { return realTimeFlag; } - case TemporalUnitEnum::FrameAndRealTime: - { + case TemporalUnitEnum::FrameAndRealTime: { return frameFlag || realTimeFlag; } default: @@ -239,16 +236,13 @@ TemporalDataObject::VerifyRequestedRegion() realTimeFlag &= m_RequestedTemporalRegion.GetRealDuration() <= m_LargestPossibleTemporalRegion.GetRealDuration(); switch (m_TemporalUnit) { - case TemporalUnitEnum::Frame: - { + case TemporalUnitEnum::Frame: { return frameFlag; } - case TemporalUnitEnum::RealTime: - { + case TemporalUnitEnum::RealTime: { return realTimeFlag; } - case TemporalUnitEnum::FrameAndRealTime: - { + case TemporalUnitEnum::FrameAndRealTime: { return frameFlag && realTimeFlag; } default: diff --git a/Utilities/GitSetup/setup-precommit b/Utilities/GitSetup/setup-precommit new file mode 100755 index 00000000000..6ce5239185c --- /dev/null +++ b/Utilities/GitSetup/setup-precommit @@ -0,0 +1,56 @@ +#!/usr/bin/env bash + +MIN_PYTHON_VERSION_MAJOR=3 +MIN_PYTHON_VERSION_MINOR=8 +MIN_PRECOMMIT_VERSION=3.5.0 + +die() { + echo 1>&2 "$@" ; exit 1 +} + +# Make sure we are inside the repository. +cd "${BASH_SOURCE%/*}" && + +# check if python executable exists and is at least MIN_PYTHON_VERSION +if ! command -v python3 &> /dev/null; then + die "Python $MIN_PYTHON_VERSION or later is required for pre-commit." +fi && + +# get python major version and minor version into array +python_version=$(python3 --version | cut -d ' ' -f 2) && +declare -a python_version_arr && +python_version_arr=(`echo ${python_version//./ }`) && +if test ${python_version_arr[0]} -lt $MIN_PYTHON_VERSION_MAJOR; then + die "Python $MIN_PYTHON_VERSION_MAJOR or later is required for pre-commit." +elif test ${python_version_arr[0]} -eq $MIN_PYTHON_VERSION_MAJOR; then + if test ${python_version_arr[1]} -lt $MIN_PYTHON_VERSION_MINOR; then + die "Python $MIN_PYTHON_VERSION_MAJOR.$MIN_PYTHON_VERSION_MINOR or later is for pre-commit" + fi +fi && +echo "Python version is $python_version" && +git_dir=$(git rev-parse --git-dir) && +mkdir -p "$git_dir/hooks" && +( +cd "$git_dir/hooks" && +# remove venv if python version is different +if [ -d venv ]; then + source venv/bin/activate && + python_version_venv=$(python --version | cut -d ' ' -f 2) && + if [ "$python_version" != "$python_version_venv" ]; then + deactivate && + rm -rf venv + fi +fi && +if [ ! -d venv ]; then + echo "Setting up python venv..." && + python3 -m venv venv +fi +) && +# activate the venv and install pre-commit with the min version in subshell +( + echo "Setting up pre-commit..." && + source ${git_dir}/hooks/venv/bin/activate && + python -m pip install --disable-pip-version-check -q -U "pre-commit>=$MIN_PRECOMMIT_VERSION" && + # Chaing to the previous hooks after renaming them with a ".legacy" suffix + pre-commit install -t pre-commit -t prepare-commit-msg -t commit-msg +) diff --git a/Wrapping/Generators/Python/itkPyITKCommonCAPI.h b/Wrapping/Generators/Python/itkPyITKCommonCAPI.h index 5f43dc63836..5cbfb42bd7b 100644 --- a/Wrapping/Generators/Python/itkPyITKCommonCAPI.h +++ b/Wrapping/Generators/Python/itkPyITKCommonCAPI.h @@ -51,7 +51,7 @@ extern "C" /* This section is used when compiling ITKCommonPython.cpp */ static _ITKCommonPython_GetGlobalSingletonIndex_RETURN _ITKCommonPython_GetInstance - _ITKCommonPython_GetGlobalSingletonIndex_PROTO; + _ITKCommonPython_GetGlobalSingletonIndex_PROTO; #else /* This section is used in modules that use _ITKCommonPython's C API */