Get Name of Class


Get the name of the class of an object.



image is type: Image



#include "itkImage.h"

main(int, char *[])
  constexpr unsigned int Dimension = 2;
  using PixelType = unsigned char;

  using ImageType = itk::Image<PixelType, Dimension>;
  ImageType::Pointer image = ImageType::New();

  std::cout << "image is type: " << image->GetNameOfClass() << std::endl;

  return EXIT_SUCCESS;

Classes demonstrated

class LightObject

Light weight base class for most itk classes.

LightObject is the highest level base class for most itk objects. It implements reference counting and the API for object printing. It can be used as a lightweight base class in preference to Object. (LightObject does not support callbacks or modified time as Object does.) All ITK objects should be a subclass of LightObject or Object with few exceptions (due to performance concerns).



ITK Sphinx Examples:

\sphinx{Core/Common/GetNameOfClass, Get Name Of Class}

Subclassed by itk::FiniteDifferenceFunction< TDisplacementField >, itk::FiniteDifferenceFunction< TImage >, itk::FiniteDifferenceFunction< TInput >, itk::FiniteDifferenceFunction< TInputImage >, itk::FiniteDifferenceFunction< TSparseImageType >, itk::CellInterface< TPixelType, TCellTraits >::MultiVisitor, itk::CellInterfaceVisitor< TPixelType, TCellTraits >, itk::FiniteDifferenceFunction< TImageType >, itk::GPUContextManager, itk::GPUKernelManager, itk::LabelObject< TLabel, VImageDimension >, itk::MetaDataObjectBase, itk::MRCHeaderObject, itk::NarrowBand< NodeType >, itk::Object, itk::RegionBasedLevelSetFunctionData< TInputImage, TFeatureImage >, itk::RegionBasedLevelSetFunctionSharedData< TInputImage, TFeatureImage, TSingleData >

See itk::LightObject for additional documentation.