CBICA Toolkit  1.0.0
ImageInfo Class Reference

Reads any image from file name and generates relevant data. More...

#include <cbicaITKImageInfo.h>

Public Member Functions

itk::ImageIOBase::IOComponentType GetComponentType ()
 Get the type of pixel in the image as an itk IOComponentType. More...
 
std::string GetComponentTypeAsString ()
 Get the type of pixel in the image as a string. More...
 
const unsigned int GetImageDimensions ()
 Get the dimensions of the specified image. More...
 
itk::SmartPointer< itk::ImageIOBase > GetImageIOBase ()
 Get the imageIOBase of the specified image. More...
 
std::vector< double > GetImageOrigins ()
 Get the Origins of the specified image. More...
 
std::vector< itk::SizeValueType > GetImageSize ()
 Get the Size of the specified image. More...
 
std::vector< itk::SizeValueType > GetImageSpacing ()
 Get the Spacing of the specified image. More...
 
std::vector< double > GetImageSpacings ()
 Get the Spacings of the specified image. More...
 
itk::ImageIOBase::IOPixelType GetPixelType ()
 Get the type of pixel in the image as an itk IOComponentType. More...
 
std::string GetPixelTypeAsString ()
 Get the type of pixel in the image as an itk IOComponentType. More...
 
 ImageInfo (const std::string &fName)
 The Constructor. More...
 
bool IsDicom ()
 Is the supplied image defined as a DICOM or not.
 
virtual ~ImageInfo ()
 The Destructor.
 

Protected Attributes

bool m_dicomDetected = false
 
unsigned int m_dimensions
 
std::string m_fileName
 
itk::ImageIOBase::IOComponentType m_IOComponentType
 
std::string m_IOComponentType_asString
 
itk::SmartPointer< itk::ImageIOBase > m_itkImageIOBase
 
std::vector< double > m_origins
 
itk::ImageIOBase::IOPixelType m_pixelType
 
std::string m_pixelType_asString
 
std::vector< itk::SizeValueType > m_size
 
std::vector< double > m_spacings
 
std::vector< std::string > m_uids
 

Detailed Description

Reads any image from file name and generates relevant data.

It can give information like dimensions, pixel type, component type, spacing, etc. about the image which mitigates the requirement of explicit declration in the program.

Constructor & Destructor Documentation

◆ ImageInfo()

ImageInfo ( const std::string &  fName)
explicit

The Constructor.

Note: There the class "itk::MetaDataDictionary" does a far better job of obtaining the metadata of an image, if that is what the user requires. This function just obtains some basic information, namely, the spacing and dimensions of the image.

Parameters
fNameThe image file name for which information is required

Member Function Documentation

◆ GetComponentType()

itk::ImageIOBase::IOComponentType GetComponentType ( )

Get the type of pixel in the image as an itk IOComponentType.

Returns
Pixel type as an itk IOComponentType

◆ GetComponentTypeAsString()

std::string GetComponentTypeAsString ( )

Get the type of pixel in the image as a string.

Returns
Pixel type as a std::string

◆ GetImageDimensions()

const unsigned int GetImageDimensions ( )
inline

Get the dimensions of the specified image.

Returns
A const unsigned int with the number of dimensions of the image

◆ GetImageIOBase()

itk::SmartPointer<itk::ImageIOBase> GetImageIOBase ( )

Get the imageIOBase of the specified image.

Returns
An itk::ImageIOBase which is overwritten with information

◆ GetImageOrigins()

std::vector<double> GetImageOrigins ( )

Get the Origins of the specified image.

Returns
A vector of double which gets overwritten with information

◆ GetImageSize()

std::vector<itk::SizeValueType> GetImageSize ( )

Get the Size of the specified image.

Returns
A vector of itk::SizeValueType which gets overwritten with information

◆ GetImageSpacing()

std::vector<itk::SizeValueType> GetImageSpacing ( )

Get the Spacing of the specified image.

Returns
A vector of itk::SizeValueType which gets overwritten with information

◆ GetImageSpacings()

std::vector<double> GetImageSpacings ( )

Get the Spacings of the specified image.

Returns
A vector of double which gets overwritten with information

◆ GetPixelType()

itk::ImageIOBase::IOPixelType GetPixelType ( )

Get the type of pixel in the image as an itk IOComponentType.

Returns
Pixel type as an itk IOComponentType

◆ GetPixelTypeAsString()

std::string GetPixelTypeAsString ( )

Get the type of pixel in the image as an itk IOComponentType.

Returns
Pixel type as an itk IOComponentType

The documentation for this class was generated from the following file: