Skip to content

Commit

Permalink
STYLE: Add itkVirtualGetNameOfClassMacro + itkOverrideGetNameOfClassM…
Browse files Browse the repository at this point in the history
…acro

Added two new macro's, intended to replace the old 'itkTypeMacro' and
'itkTypeMacroNoParent'.

The main aim is to be clearer about what those macro's do: add a virtual
'GetNameOfClass()' member function and override it. Unlike 'itkTypeMacro',
'itkOverrideGetNameOfClassMacro' does not have a 'superclass' parameter, as it
was not used anyway.

Note that originally 'itkTypeMacro' did not use its 'superclass' parameter
either, looking at commit 699b66cb04d410e555656828e8892107add38ccb, Will
Schroeder, June 27, 2001:
https://github.com/InsightSoftwareConsortium/ITK/blob/699b66cb04d410e555656828e8892107add38ccb/Code/Common/itkMacro.h#L331-L337
  • Loading branch information
hjmjohnson authored and dzenanz committed Jan 27, 2025
1 parent eb791a8 commit 345452b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/itkButterworthFilterFreqImageSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ButterworthFilterFreqImageSource : public GenerateImageSource<TOutputImage
using ConstPointer = SmartPointer<const Self>;

/** Run-time type information (and related methods). */
itkTypeMacro(ButterworthFilterFreqImageSource, GenerateImageSource);
itkOverrideGetNameOfClassMacro(ButterworthFilterFreqImageSource);

/** Method for creation through the object factory. */
itkNewMacro(Self);
Expand Down
2 changes: 1 addition & 1 deletion include/itkLogGaborFreqImageSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class LogGaborFreqImageSource : public GenerateImageSource<TOutputImage>
using ArrayType = FixedArray<double, ImageDimension>;

/** Run-time type information (and related methods). */
itkTypeMacro(LogGaborFreqImageSource, GenerateImageSource);
itkOverrideGetNameOfClassMacro(LogGaborFreqImageSource);

/** Method for creation through the object factory. */
itkNewMacro(Self);
Expand Down
2 changes: 1 addition & 1 deletion include/itkPhaseSymmetryImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class PhaseSymmetryImageFilter : public ImageToImageFilter<TInputImage, TOutputI
itkNewMacro(Self);

/** Run-time type information (and related methods). */
itkTypeMacro(PhaseSymmetryImageFilter, ImageToImageFilter);
itkOverrideGetNameOfClassMacro(PhaseSymmetryImageFilter);

itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
Expand Down
2 changes: 1 addition & 1 deletion include/itkSinusoidImageSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class SinusoidImageSource : public ParametricImageSource<TOutputImage>
using ParametersType = typename Superclass::ParametersType;

/** Run-time type information (and related methods). */
itkTypeMacro(SinusoidImageSource, ParametricImageSource);
itkOverrideGetNameOfClassMacro(SinusoidImageSource);

/** Method for creation through the object factory. */
itkNewMacro(Self);
Expand Down
2 changes: 1 addition & 1 deletion include/itkSinusoidSpatialFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class SinusoidSpatialFunction : public SpatialFunction<TOutput, VImageDimension,
itkNewMacro(Self);

/** Run-time type information (and related methods). */
itkTypeMacro(SinusoidSpatialFunction, SpatialFunction);
itkOverrideGetNameOfClassMacro(SinusoidSpatialFunction);

/** Input type for the function. */
using InputType = typename Superclass::InputType;
Expand Down
2 changes: 1 addition & 1 deletion include/itkSteerableFilterFreqImageSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class SteerableFilterFreqImageSource : public ImageSource<TOutputImage>
using SizeValueType = typename TOutputImage::SizeValueType;

/** Run-time type information (and related methods). */
itkTypeMacro(SteerableFilterFreqImageSource, ImageSource);
itkOverrideGetNameOfClassMacro(SteerableFilterFreqImageSource);

/** Method for creation through the object factory. */
itkNewMacro(Self);
Expand Down

0 comments on commit 345452b

Please sign in to comment.