Get Name Of Class

Synopsis

Get the name of the class of an object.

Results

Output::

image is type: Image

Code

C++

#include "itkImage.h"

int
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