Skip to content

Commit

Permalink
STYLE: Move empty member functions from .hxx to .h
Browse files Browse the repository at this point in the history
Moved the member function definitions of member functions that have an empty
member function definition from their "itk*.hxx" file to the corresponding
"itk*.h" file, and into their class definition.

Found by regular expression `^..[^:,].+\)\r\n{}` in "itk*.hxx" files.

- Follow-up to pull request #5198
commit b94770d
"STYLE: Move empty member functions with empty param list from .hxx to .h"
  • Loading branch information
N-Dekker committed Feb 3, 2025
1 parent ed1eaec commit 023e5a7
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 131 deletions.
3 changes: 2 additions & 1 deletion Modules/Core/Common/include/itkImageBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ class ITK_TEMPLATE_EXPORT ImageBase : public DataObject
*
*/
virtual void
Allocate(bool initialize = false);
Allocate(bool itkNotUsed(initialize) = false)
{}

/** Allocates the pixel buffer of the image, zero-initializing its pixels. `AllocateInitialized()` is equivalent to
* `Allocate(true)`. It is just intended to make the code more readable. */
Expand Down
7 changes: 0 additions & 7 deletions Modules/Core/Common/include/itkImageBase.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@

namespace itk
{

template <unsigned int VImageDimension>
void
ImageBase<VImageDimension>::Allocate(bool)
{}


template <unsigned int VImageDimension>
void
ImageBase<VImageDimension>::Initialize()
Expand Down
3 changes: 2 additions & 1 deletion Modules/Numerics/FEM/include/itkFEMSolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ class ITK_TEMPLATE_EXPORT Solver : public ProcessObject
* \param dt New time step.
*/
virtual void
SetTimeStep(Float dt);
SetTimeStep(Float itkNotUsed(dt))
{}

/** Returns the Solution for the specified nodal point. */
Float
Expand Down
5 changes: 0 additions & 5 deletions Modules/Numerics/FEM/include/itkFEMSolver.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ Solver<VDimension>::GetTimeStep() const -> Float
return Float{};
}

template <unsigned int VDimension>
void
Solver<VDimension>::SetTimeStep(Float itkNotUsed(dt))
{}

template <unsigned int VDimension>
auto
Solver<VDimension>::GetSolution(unsigned int i, unsigned int which) -> Float
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,15 @@ class ITK_TEMPLATE_EXPORT LevelSetEquationAdvectionTerm : public LevelSetEquatio

/** \todo to be documented. */
void
Initialize(const LevelSetInputIndexType &) override;
Initialize(const LevelSetInputIndexType &) override
{}

/** Supply updates at pixels to keep the term parameters always updated */
void
UpdatePixel(const LevelSetInputIndexType & iP,
const LevelSetOutputRealType & oldValue,
const LevelSetOutputRealType & newValue) override;
UpdatePixel(const LevelSetInputIndexType & itkNotUsed(iP),
const LevelSetOutputRealType & itkNotUsed(oldValue),
const LevelSetOutputRealType & itkNotUsed(newValue)) override
{}

protected:
LevelSetEquationAdvectionTerm();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,6 @@ LevelSetEquationAdvectionTerm<TInput, TLevelSetContainer>::GenerateAdvectionImag
}
}

template <typename TInput, typename TLevelSetContainer>
void
LevelSetEquationAdvectionTerm<TInput, TLevelSetContainer>::Initialize(const LevelSetInputIndexType &)
{}

template <typename TInput, typename TLevelSetContainer>
void
LevelSetEquationAdvectionTerm<TInput, TLevelSetContainer>::UpdatePixel(
const LevelSetInputIndexType & itkNotUsed(iP),
const LevelSetOutputRealType & itkNotUsed(oldValue),
const LevelSetOutputRealType & itkNotUsed(newValue))
{}

template <typename TInput, typename TLevelSetContainer>
auto
LevelSetEquationAdvectionTerm<TInput, TLevelSetContainer>::AdvectionSpeed(const LevelSetInputIndexType & iP) const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ class ITK_TEMPLATE_EXPORT LevelSetEquationBinaryMaskTerm : public LevelSetEquati

/** Initialize term parameters in the dense case by computing for each pixel location */
void
Initialize(const LevelSetInputIndexType & iP) override;
Initialize(const LevelSetInputIndexType & itkNotUsed(iP)) override
{}

/** Supply updates at pixels to keep the term parameters always updated */
void
UpdatePixel(const LevelSetInputIndexType & iP,
const LevelSetOutputRealType & oldValue,
const LevelSetOutputRealType & newValue) override;
UpdatePixel(const LevelSetInputIndexType & itkNotUsed(iP),
const LevelSetOutputRealType & itkNotUsed(oldValue),
const LevelSetOutputRealType & itkNotUsed(newValue)) override
{}

protected:
LevelSetEquationBinaryMaskTerm();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,6 @@ LevelSetEquationBinaryMaskTerm<TInput, TLevelSetContainer>::InitializeParameters
}


template <typename TInput, typename TLevelSetContainer>
void
LevelSetEquationBinaryMaskTerm<TInput, TLevelSetContainer>::Initialize(const LevelSetInputIndexType & itkNotUsed(index))
{}


template <typename TInput, typename TLevelSetContainer>
void
LevelSetEquationBinaryMaskTerm<TInput, TLevelSetContainer>::UpdatePixel(
const LevelSetInputIndexType & itkNotUsed(index),
const LevelSetOutputRealType & itkNotUsed(oldValue),
const LevelSetOutputRealType & itkNotUsed(newValue))
{}

template <typename TInput, typename TLevelSetContainer>
auto
LevelSetEquationBinaryMaskTerm<TInput, TLevelSetContainer>::Value(const LevelSetInputIndexType & index)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,15 @@ class ITK_TEMPLATE_EXPORT LevelSetEquationCurvatureTerm : public LevelSetEquatio

/** Initialize term parameters in the dense case by computing for each pixel location */
void
Initialize(const LevelSetInputIndexType &) override;
Initialize(const LevelSetInputIndexType &) override
{}

/** Supply updates at pixels to keep the term parameters always updated */
void
UpdatePixel(const LevelSetInputIndexType & iP,
const LevelSetOutputRealType & oldValue,
const LevelSetOutputRealType & newValue) override;
UpdatePixel(const LevelSetInputIndexType & itkNotUsed(iP),
const LevelSetOutputRealType & itkNotUsed(oldValue),
const LevelSetOutputRealType & itkNotUsed(newValue)) override
{}

protected:
LevelSetEquationCurvatureTerm();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,6 @@ LevelSetEquationCurvatureTerm<TInput, TLevelSetContainer, TCurvatureImage>::Init
}
}

template <typename TInput, typename TLevelSetContainer, typename TCurvatureImage>
void
LevelSetEquationCurvatureTerm<TInput, TLevelSetContainer, TCurvatureImage>::Initialize(const LevelSetInputIndexType &)
{}

template <typename TInput, typename TLevelSetContainer, typename TCurvatureImage>
void
LevelSetEquationCurvatureTerm<TInput, TLevelSetContainer, TCurvatureImage>::UpdatePixel(
const LevelSetInputIndexType & itkNotUsed(iP),
const LevelSetOutputRealType & itkNotUsed(oldValue),
const LevelSetOutputRealType & itkNotUsed(newValue))
{}

template <typename TInput, typename TLevelSetContainer, typename TCurvatureImage>
auto
LevelSetEquationCurvatureTerm<TInput, TLevelSetContainer, TCurvatureImage>::Value(const LevelSetInputIndexType & iP)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@ class ITK_TEMPLATE_EXPORT LevelSetEquationLaplacianTerm : public LevelSetEquatio

/** \todo to be documented. */
void
Initialize(const LevelSetInputIndexType &) override;
Initialize(const LevelSetInputIndexType &) override
{}

/** Supply updates at pixels to keep the term parameters always updated */
void
UpdatePixel(const LevelSetInputIndexType & iP,
const LevelSetOutputRealType & oldValue,
const LevelSetOutputRealType & newValue) override;
UpdatePixel(const LevelSetInputIndexType & itkNotUsed(iP),
const LevelSetOutputRealType & itkNotUsed(oldValue),
const LevelSetOutputRealType & itkNotUsed(newValue)) override
{}

protected:
LevelSetEquationLaplacianTerm();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,6 @@ LevelSetEquationLaplacianTerm<TInput, TLevelSetContainer>::InitializeParameters(
this->SetUp();
}

template <typename TInput, typename TLevelSetContainer>
void
LevelSetEquationLaplacianTerm<TInput, TLevelSetContainer>::Initialize(const LevelSetInputIndexType &)
{}

template <typename TInput, typename TLevelSetContainer>
void
LevelSetEquationLaplacianTerm<TInput, TLevelSetContainer>::UpdatePixel(
const LevelSetInputIndexType & itkNotUsed(iP),
const LevelSetOutputRealType & itkNotUsed(oldValue),
const LevelSetOutputRealType & itkNotUsed(newValue))
{}

template <typename TInput, typename TLevelSetContainer>
auto
LevelSetEquationLaplacianTerm<TInput, TLevelSetContainer>::LaplacianSpeed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ class ITK_TEMPLATE_EXPORT LevelSetEquationOverlapPenaltyTerm

/** Initialize term parameters in the dense case by computing for each pixel location */
void
Initialize(const LevelSetInputIndexType & index) override;
Initialize(const LevelSetInputIndexType & itkNotUsed(index)) override
{}

/** Compute the sum of Heaviside functions in the multi-levelset cases
* except the current levelset */
Expand All @@ -112,9 +113,10 @@ class ITK_TEMPLATE_EXPORT LevelSetEquationOverlapPenaltyTerm

/** Supply updates at pixels to keep the term parameters always updated */
void
UpdatePixel(const LevelSetInputIndexType & index,
const LevelSetOutputRealType & oldValue,
const LevelSetOutputRealType & newValue) override;
UpdatePixel(const LevelSetInputIndexType & itkNotUsed(index),
const LevelSetOutputRealType & itkNotUsed(oldValue),
const LevelSetOutputRealType & itkNotUsed(newValue)) override
{}


protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ LevelSetEquationOverlapPenaltyTerm<TInput, TLevelSetContainer>::LevelSetEquation
this->m_CacheImage = nullptr;
}

template <typename TInput, typename TLevelSetContainer>
void
LevelSetEquationOverlapPenaltyTerm<TInput, TLevelSetContainer>::UpdatePixel(
const LevelSetInputIndexType & itkNotUsed(index),
const LevelSetOutputRealType & itkNotUsed(oldValue),
const LevelSetOutputRealType & itkNotUsed(newValue))
{}

template <typename TInput, typename TLevelSetContainer>
void
LevelSetEquationOverlapPenaltyTerm<TInput, TLevelSetContainer>::InitializeParameters()
Expand All @@ -48,12 +40,6 @@ LevelSetEquationOverlapPenaltyTerm<TInput, TLevelSetContainer>::InitializeParame
}


template <typename TInput, typename TLevelSetContainer>
void
LevelSetEquationOverlapPenaltyTerm<TInput, TLevelSetContainer>::Initialize(
const LevelSetInputIndexType & itkNotUsed(index))
{}

template <typename TInput, typename TLevelSetContainer>
auto
LevelSetEquationOverlapPenaltyTerm<TInput, TLevelSetContainer>::Value(const LevelSetInputIndexType & index)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,15 @@ class ITK_TEMPLATE_EXPORT LevelSetEquationPropagationTerm : public LevelSetEquat

/** \todo to be documented. */
void
Initialize(const LevelSetInputIndexType &) override;
Initialize(const LevelSetInputIndexType &) override
{}

/** Supply updates at pixels to keep the term parameters always updated */
void
UpdatePixel(const LevelSetInputIndexType & iP,
const LevelSetOutputRealType & oldValue,
const LevelSetOutputRealType & newValue) override;
UpdatePixel(const LevelSetInputIndexType & itkNotUsed(iP),
const LevelSetOutputRealType & itkNotUsed(oldValue),
const LevelSetOutputRealType & itkNotUsed(newValue)) override
{}

protected:
LevelSetEquationPropagationTerm();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,6 @@ LevelSetEquationPropagationTerm<TInput, TLevelSetContainer, TPropagationImage>::
}
}

template <typename TInput, typename TLevelSetContainer, typename TPropagationImage>
void
LevelSetEquationPropagationTerm<TInput, TLevelSetContainer, TPropagationImage>::Initialize(
const LevelSetInputIndexType &)
{}

template <typename TInput, typename TLevelSetContainer, typename TPropagationImage>
void
LevelSetEquationPropagationTerm<TInput, TLevelSetContainer, TPropagationImage>::UpdatePixel(
const LevelSetInputIndexType & itkNotUsed(iP),
const LevelSetOutputRealType & itkNotUsed(oldValue),
const LevelSetOutputRealType & itkNotUsed(newValue))
{}

template <typename TInput, typename TLevelSetContainer, typename TPropagationImage>
auto
LevelSetEquationPropagationTerm<TInput, TLevelSetContainer, TPropagationImage>::PropagationSpeed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ class ITK_TEMPLATE_EXPORT BoundaryResolver : public ProcessObject

unsigned short m_Face{ 0 };
void
GenerateOutputRequestedRegion(DataObject * output) override;
GenerateOutputRequestedRegion(DataObject * itkNotUsed(output)) override
{}
};
} // end namespace watershed
} // end namespace itk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ BoundaryResolver<TPixelType, TDimension>::GenerateData()
// ------------------------------------------------------------
// --------------------PIPELINE METHODS------------------------
// ------------------------------------------------------------
template <typename TPixelType, unsigned int TDimension>
void
BoundaryResolver<TPixelType, TDimension>::GenerateOutputRequestedRegion(DataObject *)
{}

template <typename TPixelType, unsigned int TDimension>
typename BoundaryResolver<TPixelType, TDimension>::DataObjectPointer
BoundaryResolver<TPixelType, TDimension>::MakeOutput(DataObjectPointerArraySizeType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ class ITK_TEMPLATE_EXPORT SegmentTreeGenerator : public ProcessObject

/** Methods required by the itk pipeline */
void
GenerateOutputRequestedRegion(DataObject * output) override;
GenerateOutputRequestedRegion(DataObject * itkNotUsed(output)) override
{}

void
GenerateInputRequestedRegion() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,11 +552,6 @@ SegmentTreeGenerator<TScalar>::MergeSegments(SegmentTableTypePointer s
eqT->Add(FROM, TO);
}

template <typename TScalar>
void
SegmentTreeGenerator<TScalar>::GenerateOutputRequestedRegion(DataObject * itkNotUsed(output))
{}

template <typename TScalar>
void
SegmentTreeGenerator<TScalar>::GenerateInputRequestedRegion()
Expand Down

0 comments on commit 023e5a7

Please sign in to comment.