ITK  5.4.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Types | Private Attributes | List of all members
itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage > Class Template Reference

#include <itkImagePCADecompositionCalculator.h>

Detailed Description

template<typename TInputImage, typename TBasisImage = Image<double, TInputImage::ImageDimension>>
class itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >

Decomposes an image into directions along basis components.

This calculator computes the projection of an image into a subspace specified by some basis set of images, and, optionally, a mean image (e.g a translation to a new origin). Typically, this basis/mean image will be the mean and principal components of an image data set, as calculated by an ImagePCAShapeModelEstimator. The output of the calculator is a vnl_vector containing the coefficients along each dimension of the provided basis set. To use this calculator, set the basis images with the SetBasisImage method, and optionally set the mean image with the SetMeanImage method. In the PCA case, the zeroth output of the ImagePCAShapeModelEstimator is the mean image and subsequent outputs are the basis images. SetBasisFromModel is a convenience method to set all of this information from a given ImagePCAShapeModelEstimator instance.

This class is templated over the input image type and the type of images used to describe the basis.

Warning
This method assumes that the input image consists of scalar pixel types.
All images (input, basis, and mean) must be the same size.
Author
Zachary Pincus

Definition at line 59 of file itkImagePCADecompositionCalculator.h.

+ Inheritance diagram for itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >:
+ Collaboration diagram for itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >:

Public Types

using BasisImageConstPointer = typename TBasisImage::ConstPointer
 
using BasisImagePointer = typename TBasisImage::Pointer
 
using BasisImagePointerVector = std::vector< BasisImagePointer >
 
using BasisImageType = TBasisImage
 
using BasisMatrixType = vnl_matrix< BasisPixelType >
 
using BasisPixelType = typename TBasisImage::PixelType
 
using BasisVectorType = vnl_vector< BasisPixelType >
 
using ConstPointer = SmartPointer< const Self >
 
using InputImageConstPointer = typename TInputImage::ConstPointer
 
using InputImagePointer = typename TInputImage::Pointer
 
using InputImageType = TInputImage
 
using ModelPointerType = typename ImagePCAShapeModelEstimator< TInputImage, TBasisImage >::Pointer
 
using Pointer = SmartPointer< Self >
 
using Self = ImagePCADecompositionCalculator
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

void Compute ()
 
BasisImagePointerVector GetBasisImages ()
 
virtual BasisVectorType GetProjection () const
 
 itkOverrideGetNameOfClassMacro (ImagePCADecompositionCalculator)
 
void SetBasisFromModel (ModelPointerType model)
 
void SetBasisImages (const BasisImagePointerVector &)
 
virtual void SetImage (const InputImageType *_arg)
 
virtual const InputImageTypeGetImage () const
 
virtual void SetMeanImage (const BasisImageType *_arg)
 
virtual const BasisImageTypeGetMeanImage () const
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
unsigned long AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const
 
LightObject::Pointer CreateAnother () const override
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
 itkOverrideGetNameOfClassMacro (Object)
 
virtual void Modified () const
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexcept override
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
Pointer Clone () const
 
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkVirtualGetNameOfClassMacro (LightObject)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool val)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Static Public Attributes

static constexpr unsigned int BasisImageDimension = TBasisImage::ImageDimension
 
static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension
 

Protected Member Functions

void CalculateBasisMatrix ()
 
void CalculateRecenteredImageAsVector ()
 
 ImagePCADecompositionCalculator ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~ImagePCADecompositionCalculator () override=default
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
 ~Object () override
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Types

using BasisSizeType = typename BasisImageType::SizeType
 

Private Attributes

BasisImagePointerVector m_BasisImages {}
 
BasisMatrixType m_BasisMatrix {}
 
bool m_BasisMatrixCalculated {}
 
InputImageConstPointer m_Image {}
 
BasisVectorType m_ImageAsVector {}
 
BasisImageConstPointer m_MeanImage {}
 
SizeValueType m_NumPixels {}
 
BasisVectorType m_Projection {}
 
BasisSizeType m_Size {}
 

Additional Inherited Members

- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount {}
 

Member Typedef Documentation

◆ BasisImageConstPointer

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
using itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::BasisImageConstPointer = typename TBasisImage::ConstPointer

Definition at line 86 of file itkImagePCADecompositionCalculator.h.

◆ BasisImagePointer

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
using itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::BasisImagePointer = typename TBasisImage::Pointer

Definition at line 82 of file itkImagePCADecompositionCalculator.h.

◆ BasisImagePointerVector

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
using itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::BasisImagePointerVector = std::vector<BasisImagePointer>

Vector of basis image pointers.

Definition at line 98 of file itkImagePCADecompositionCalculator.h.

◆ BasisImageType

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
using itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::BasisImageType = TBasisImage

Definition at line 78 of file itkImagePCADecompositionCalculator.h.

◆ BasisMatrixType

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
using itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::BasisMatrixType = vnl_matrix<BasisPixelType>

Type definitions for internal vectors and matrices

Definition at line 101 of file itkImagePCADecompositionCalculator.h.

◆ BasisPixelType

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
using itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::BasisPixelType = typename TBasisImage::PixelType

Basis image pixel type: this is also the type of the output vector

Definition at line 89 of file itkImagePCADecompositionCalculator.h.

◆ BasisSizeType

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
using itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::BasisSizeType = typename BasisImageType::SizeType
private

Definition at line 153 of file itkImagePCADecompositionCalculator.h.

◆ BasisVectorType

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
using itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::BasisVectorType = vnl_vector<BasisPixelType>

Definition at line 102 of file itkImagePCADecompositionCalculator.h.

◆ ConstPointer

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
using itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::ConstPointer = SmartPointer<const Self>

Definition at line 68 of file itkImagePCADecompositionCalculator.h.

◆ InputImageConstPointer

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
using itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::InputImageConstPointer = typename TInputImage::ConstPointer

Const Pointer type for the image.

Definition at line 85 of file itkImagePCADecompositionCalculator.h.

◆ InputImagePointer

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
using itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::InputImagePointer = typename TInputImage::Pointer

Pointer types for the image.

Definition at line 81 of file itkImagePCADecompositionCalculator.h.

◆ InputImageType

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
using itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::InputImageType = TInputImage

Type definitions for the input images.

Definition at line 77 of file itkImagePCADecompositionCalculator.h.

◆ ModelPointerType

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
using itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::ModelPointerType = typename ImagePCAShapeModelEstimator<TInputImage, TBasisImage>::Pointer

Type definition of a compatible ImagePCAShapeModelEstimator

Definition at line 125 of file itkImagePCADecompositionCalculator.h.

◆ Pointer

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
using itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::Pointer = SmartPointer<Self>

Definition at line 67 of file itkImagePCADecompositionCalculator.h.

◆ Self

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
using itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::Self = ImagePCADecompositionCalculator

Standard class type aliases.

Definition at line 65 of file itkImagePCADecompositionCalculator.h.

◆ Superclass

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
using itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::Superclass = Object

Definition at line 66 of file itkImagePCADecompositionCalculator.h.

Constructor & Destructor Documentation

◆ ImagePCADecompositionCalculator()

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::ImagePCADecompositionCalculator ( )
protected

◆ ~ImagePCADecompositionCalculator()

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::~ImagePCADecompositionCalculator ( )
overrideprotecteddefault

Member Function Documentation

◆ CalculateBasisMatrix()

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
void itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::CalculateBasisMatrix ( )
protected

Convert a vector of basis images into a matrix flattening each image into 1-D.

◆ CalculateRecenteredImageAsVector()

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
void itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::CalculateRecenteredImageAsVector ( )
protected

Convert an image into a 1-D vector changing the pixel type if necessary.

◆ Compute()

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
void itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::Compute ( )

Compute the PCA decomposition of the input image.

◆ GetBasisImages()

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
BasisImagePointerVector itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::GetBasisImages ( )
inline

Definition at line 119 of file itkImagePCADecompositionCalculator.h.

◆ GetImage()

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
virtual const InputImageType* itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::GetImage ( ) const
virtual

Set and get the input image.

◆ GetMeanImage()

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
virtual const BasisImageType* itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::GetMeanImage ( ) const
virtual

Set and get the mean image.

◆ GetProjection()

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
virtual BasisVectorType itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::GetProjection ( ) const
virtual

Return the projection of the image.

◆ itkOverrideGetNameOfClassMacro()

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::itkOverrideGetNameOfClassMacro ( ImagePCADecompositionCalculator< TInputImage, TBasisImage >  )

Run-time type information (and related methods).

◆ New()

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
static Pointer itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::New ( )
static

Method for creation through the object factory.

◆ PrintSelf()

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
void itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::Object.

◆ SetBasisFromModel()

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
void itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::SetBasisFromModel ( ModelPointerType  model)

Set the basis images from a ImagePCAShapeModelEstimator

◆ SetBasisImages()

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
void itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::SetBasisImages ( const BasisImagePointerVector )

Set and get the basis images.

◆ SetImage()

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
virtual void itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::SetImage ( const InputImageType _arg)
virtual

Set and get the input image.

◆ SetMeanImage()

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
virtual void itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::SetMeanImage ( const BasisImageType _arg)
virtual

Set and get the mean image.

Member Data Documentation

◆ BasisImageDimension

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
constexpr unsigned int itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::BasisImageDimension = TBasisImage::ImageDimension
staticconstexpr

Basis Image dimension

Definition at line 95 of file itkImagePCADecompositionCalculator.h.

◆ InputImageDimension

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
constexpr unsigned int itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::InputImageDimension = TInputImage::ImageDimension
staticconstexpr

Input Image dimension

Definition at line 92 of file itkImagePCADecompositionCalculator.h.

◆ m_BasisImages

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
BasisImagePointerVector itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::m_BasisImages {}
private

Definition at line 157 of file itkImagePCADecompositionCalculator.h.

◆ m_BasisMatrix

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
BasisMatrixType itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::m_BasisMatrix {}
private

Definition at line 161 of file itkImagePCADecompositionCalculator.h.

◆ m_BasisMatrixCalculated

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
bool itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::m_BasisMatrixCalculated {}
private

Definition at line 162 of file itkImagePCADecompositionCalculator.h.

◆ m_Image

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
InputImageConstPointer itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::m_Image {}
private

Definition at line 160 of file itkImagePCADecompositionCalculator.h.

◆ m_ImageAsVector

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
BasisVectorType itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::m_ImageAsVector {}
private

Definition at line 156 of file itkImagePCADecompositionCalculator.h.

◆ m_MeanImage

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
BasisImageConstPointer itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::m_MeanImage {}
private

Definition at line 158 of file itkImagePCADecompositionCalculator.h.

◆ m_NumPixels

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
SizeValueType itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::m_NumPixels {}
private

Definition at line 163 of file itkImagePCADecompositionCalculator.h.

◆ m_Projection

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
BasisVectorType itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::m_Projection {}
private

Definition at line 155 of file itkImagePCADecompositionCalculator.h.

◆ m_Size

template<typename TInputImage , typename TBasisImage = Image<double, TInputImage::ImageDimension>>
BasisSizeType itk::ImagePCADecompositionCalculator< TInputImage, TBasisImage >::m_Size {}
private

Definition at line 159 of file itkImagePCADecompositionCalculator.h.


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