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 committed Jan 26, 2025
1 parent 9da9118 commit 4d35307
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/itkNMinimaMaximaImageCalculator.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ITK_TEMPLATE_EXPORT NMinimaMaximaImageCalculator : public Object
itkNewMacro(Self);

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

/** Type definition for the input image. */
using ImageType = TInputImage;
Expand Down
2 changes: 1 addition & 1 deletion include/itkPhaseCorrelationImageRegistrationMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class ITK_TEMPLATE_EXPORT PhaseCorrelationImageRegistrationMethod : public Proce
itkNewMacro(Self);

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

/** Type of the Fixed image. */
using FixedImageType = TFixedImage;
Expand Down
2 changes: 1 addition & 1 deletion include/itkPhaseCorrelationOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ITK_TEMPLATE_EXPORT PhaseCorrelationOperator
itkNewMacro(Self);

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

/** ImageDimension enumeration. */
static constexpr unsigned int ImageDimension = VImageDimension;
Expand Down
2 changes: 1 addition & 1 deletion include/itkPhaseCorrelationOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class ITK_TEMPLATE_EXPORT PhaseCorrelationOptimizer : public ProcessObject
itkNewMacro(Self);

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

/** Type of the inputs. */
static constexpr unsigned int ImageDimension = VImageDimension;
Expand Down
2 changes: 1 addition & 1 deletion include/itkTileMergeImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ITK_TEMPLATE_EXPORT TileMergeImageFilter
itkNewMacro(Self);

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

/** Dimensionality of input images. */
static constexpr unsigned int ImageDimension = ImageType::ImageDimension;
Expand Down
2 changes: 1 addition & 1 deletion include/itkTileMontage.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ITK_TEMPLATE_EXPORT TileMontage : public ProcessObject
itkNewMacro(Self);

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

/** Dimensionality of input images. */
static constexpr unsigned int ImageDimension = ImageType::ImageDimension;
Expand Down
2 changes: 1 addition & 1 deletion test/itkMontagePCMTestSynthetic.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class HyperSphereImageSource : public itk::Object
itkNewMacro(Self);

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

using ImageType = itk::Image<TPixel, VDimension>;

Expand Down

0 comments on commit 4d35307

Please sign in to comment.