Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
mirtk::HistogramImageSimilarity Class Reference

#include <HistogramImageSimilarity.h>

Inheritance diagram for mirtk::HistogramImageSimilarity:
Inheritance graph
Collaboration diagram for mirtk::HistogramImageSimilarity:
Collaboration graph

Public Types

typedef double BinType
 Type of joint histogram bin values.
 
typedef Histogram2D< BinTypeJointHistogramType
 Type of joint histogram.
 
- Public Types inherited from mirtk::ImageSimilarity
enum  ForegroundRegion {
  FG_Domain, FG_Mask, FG_Target, FG_Overlap,
  FG_Union
}
 
typedef GenericImage< GradientTypeGradientImageType
 Type of similarity gradient image.
 
typedef double GradientType
 Type of similarity gradient components.
 
typedef RegisteredImage::VoxelType VoxelType
 Voxel type of registered images.
 
- Public Types inherited from mirtk::EnergyTerm
typedef ObjectFactory< enum EnergyMeasure, EnergyTermFactoryType
 Type of energy term factory.
 

Public Member Functions

void CopyAttributes (const HistogramImageSimilarity &)
 Copy attributes of this class from another instance.
 
virtual void Exclude (const blocked_range3d< int > &)
 
virtual void Include (const blocked_range3d< int > &)
 
virtual void Initialize ()
 Initialize similarity measure once input and parameters have been set.
 
 mirtkAttributeMacro (JointHistogramType, Histogram)
 Joint histogram of image intensities (cubic B-spline Parzen windows)
 
 mirtkLooseComponentMacro (JointHistogramType, Samples)
 
 mirtkPublicAttributeMacro (bool, UseParzenWindow)
 Whether to use a Parzen window function.
 
 mirtkPublicAttributeMacro (bool, PadHistogram)
 Whether to pad histogram when performing Parzen window estimation.
 
 mirtkPublicAttributeMacro (int, NumberOfTargetBins)
 Number of histogram bins for target image intensities.
 
 mirtkPublicAttributeMacro (int, NumberOfSourceBins)
 Number of histogram bins for source image intensities.
 
virtual ParameterList Parameter () const
 Get parameter key/value as string map.
 
virtual void Print (Indent=0) const
 Print debug information.
 
virtual void Update (bool=true)
 Update moving image and internal state of similarity measure.
 
virtual void WriteDataSets (const char *, const char *, bool=true) const
 Write input of data fidelity term.
 
- Public Member Functions inherited from mirtk::ImageSimilarity
void CopyAttributes (const ImageSimilarity &)
 Copy attributes of this class from another instance.
 
bool IsForeground (int) const
 Whether to evaluate similarity at specified voxel.
 
bool IsForeground (int, int, int) const
 Whether to evaluate similarity at specified voxel.
 
 mirtkAttributeMacro (bool, InitialUpdate)
 Whether Update has not been called since initialization.
 
 mirtkComponentMacro (GradientImageType, GradientWrtTarget)
 Memory for (non-parametric) similarity gradient w.r.t target transformation.
 
 mirtkComponentMacro (GradientImageType, GradientWrtSource)
 Memory for (non-parametric) similarity gradient w.r.t source transformation.
 
 mirtkComponentMacro (double, Gradient)
 Memory for (parametric) similarity gradient.
 
 mirtkLooseComponentMacro (RegisteredImage, Target)
 (Transformed) Target image
 
 mirtkLooseComponentMacro (RegisteredImage, Source)
 (Transformed) Source image
 
 mirtkPublicAggregateMacro (BinaryImage, Mask)
 
 mirtkPublicAttributeMacro (ImageAttributes, Domain)
 Finite regular domain on which to resample images and evaluate similarity.
 
 mirtkPublicAttributeMacro (ForegroundRegion, Foreground)
 Set operation used to define common foreground region of co-registered images.
 
 mirtkPublicAttributeMacro (int, NumberOfVoxels)
 Number of voxels per registered image.
 
 mirtkPublicAttributeMacro (bool, NormalizeImageGradient)
 Divide transformed image gradient by input intensity range.
 
 mirtkPublicAttributeMacro (bool, UseApproximateGradient)
 
 mirtkPublicAttributeMacro (double, VoxelWisePreconditioning)
 
 mirtkPublicAttributeMacro (double, NodeBasedPreconditioning)
 
 mirtkPublicAttributeMacro (bool, SkipTargetInitialization)
 Skip initialization of target image.
 
 mirtkPublicAttributeMacro (bool, SkipSourceInitialization)
 Skip initialization of source image.
 
void ReleaseSource ()
 Release input source image.
 
void ReleaseTarget ()
 Release input target image.
 
virtual void WriteGradient (const char *, const char *) const
 Write gradient of data fidelity term w.r.t each transformed input.
 
virtual ~ImageSimilarity ()
 Destructor.
 
- Public Member Functions inherited from mirtk::DataFidelity
virtual ~DataFidelity ()
 Destructor.
 
- Public Member Functions inherited from mirtk::EnergyTerm
virtual enum EnergyMeasure EnergyMeasure () const =0
 Energy measure implemented by this term.
 
void Gradient (double *gradient, double step)
 
virtual void GradientStep (const double *gradient, double &min, double &max) const
 
double InitialValue ()
 Returns initial value of energy term.
 
void NormalizedGradient (double *gradient, double step)
 
string Prefix (const char *=NULL) const
 Prefix to be used for debug output files.
 
virtual double RawValue (double) const
 
double RawValue ()
 
void ResetInitialValue ()
 Reset initial value of energy term.
 
void ResetValue ()
 Reset cached value of energy term.
 
virtual bool Upgrade ()
 Update energy term after convergence.
 
double Value ()
 Evaluate energy term.
 
virtual ~EnergyTerm ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Configurable
string DefaultName () const
 
virtual bool Set (const char *, const char *)
 Set parameter value from string.
 
virtual ~Configurable ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Observable
void AddObserver (Observer &)
 Add observer.
 
void Broadcast (Event, const void *=NULL)
 Broadcast event to observers.
 
void ClearObservers ()
 Delete all observers.
 
void DeleteObserver (Observer &)
 Delete observer.
 
void NotifyObservers (Event, const void *=NULL)
 Notify all observers about given event if this object has changed.
 
int NumberOfObservers () const
 Number of current observers.
 
virtual ~Observable ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Object
virtual const char * NameOfClass () const =0
 Get name of class, which this object is an instance of.
 
bool Parameter (const ParameterList &)
 Set parameters from name/value pairs.
 
virtual ~Object ()
 Destructor.
 

Static Public Member Functions

static int DefaultNumberOfBins (const BaseImage *image, double min_intensity=NaN, double max_intensity=NaN)
 
- Static Public Member Functions inherited from mirtk::ImageSimilarity
static ImageSimilarityNew (SimilarityMeasure, const char *="", double=1.0)
 Instantiate specified similarity measure.
 
- Static Public Member Functions inherited from mirtk::EnergyTerm
static FactoryTypeFactory ()
 Get global energy term factory instance.
 
static EnergyTermNew (EnergyMeasure, const char *="", double=1.0)
 Construct new energy term.
 
static EnergyTermTryNew (EnergyMeasure, const char *="", double=1.0)
 Construct new energy term or return nullptr if term not available.
 
- Static Public Member Functions inherited from mirtk::Object
static const char * NameOfType ()
 Get name of this class type.
 

Protected Member Functions

 HistogramImageSimilarity (const char *="", double=1.0)
 Constructor.
 
 HistogramImageSimilarity (const HistogramImageSimilarity &)
 Copy constructor.
 
HistogramImageSimilarityoperator= (const HistogramImageSimilarity &)
 Assignment operator.
 
virtual bool SetWithPrefix (const char *, const char *)
 Set parameter value from string.
 
virtual void UpdateHistogram ()
 Update estimated joint histogram after raw samples histogram has changed.
 
virtual ~HistogramImageSimilarity ()
 Destructor.
 
- Protected Member Functions inherited from mirtk::ImageSimilarity
void ApproximateGradient (RegisteredImage *image, FreeFormTransformation *ffd, double *gradient, double step, double weight)
 
void ApproximateGradient (RegisteredImage *image, double *gradient, double step, double weight)
 
virtual void EvaluateGradient (RegisteredImage *image, GradientImageType *&np_gradient, double *gradient, double step, double weight)
 
virtual void EvaluateGradient (double *gradient, double step, double weight)
 
 ImageSimilarity (const char *="", double=1.0)
 Constructor.
 
 ImageSimilarity (const ImageSimilarity &)
 Copy constructor.
 
virtual void InitializeInput (const ImageAttributes &domain)
 
void MultiplyByImageGradient (const RegisteredImage *image, GradientImageType *gradient)
 
virtual bool NonParametricGradient (const RegisteredImage *image, GradientImageType *gradient)
 
virtual void NormalizeGradient (GradientImageType *gradient)
 
virtual void NormalizeGradient (const RegisteredImage *image, double *gradient)
 
ImageSimilarityoperator= (const ImageSimilarity &)
 Assignment operator.
 
virtual void ParametricGradient (const RegisteredImage *image, GradientImageType *np_gradient, double *gradient, double weight)
 
virtual bool SetWithoutPrefix (const char *, const char *)
 Set parameter value from string.
 
- Protected Member Functions inherited from mirtk::DataFidelity
 DataFidelity (const char *="", double=1.0)
 Constructor.
 
 DataFidelity (const DataFidelity &)
 Copy constructor.
 
DataFidelityoperator= (const DataFidelity &)
 Assignment operator.
 
- Protected Member Functions inherited from mirtk::EnergyTerm
 EnergyTerm (const char *="", double=1.0)
 Constructor.
 
 EnergyTerm (const EnergyTerm &)
 Copy constructor.
 
virtual double Evaluate ()=0
 Evaluate unweighted energy term.
 
EnergyTermoperator= (const EnergyTerm &)
 Assignment operator.
 
- Protected Member Functions inherited from mirtk::Configurable
 Configurable (const char *="")
 Constructor.
 
 Configurable (const Configurable &)
 Copy constructor.
 
string DefaultPrefix () const
 Get default object name prefix (if any)
 
bool HasName () const
 Whether this object has an explicit name.
 
bool HasPrefix () const
 Whether this object has either an explicit name or default prefix.
 
template<class T >
bool InsertWithPrefix (ParameterList &, string, T) const
 Insert parameter into name/value list with object name prefix.
 
bool InsertWithPrefix (ParameterList &, const ParameterList &) const
 Insert parameters into name/value list with object name prefix.
 
Configurableoperator= (const Configurable &)
 Assignment operator.
 
string ParameterNameWithoutPrefix (const char *) const
 Get name of parameter without object name prefix.
 
string ParameterNameWithPrefix (const string &) const
 Get name of parameter with default object name prefix.
 
string ParameterNameWithPrefix (const char *) const
 Get name of parameter with default object name prefix.
 
- Protected Member Functions inherited from mirtk::Observable
 Observable ()
 Default constructor.
 
 Observable (const Observable &)
 Copy constructor.
 
Observableoperator= (const Observable &)
 Assignment operator.
 
- Protected Member Functions inherited from mirtk::Object
template<typename... Args>
void Throw (ErrorType err, const char *func, Args... args) const
 

Additional Inherited Members

- Static Protected Member Functions inherited from mirtk::Object
template<typename... Args>
static void ThrowStatic (ErrorType err, const char *cls, const char *func, Args... args)
 

Detailed Description

Base class for probabilistic image similarity measures

Subclasses of this intensity-based image similarity measure compute similarity from the joint and marginal probabilities of the intensities in the images. An estimate of the probabilities is obtained using a joint histogram and cubic B-spline Parzen Windows for a continuous representation.

Definition at line 41 of file HistogramImageSimilarity.h.

Member Function Documentation

§ DefaultNumberOfBins()

static int mirtk::HistogramImageSimilarity::DefaultNumberOfBins ( const BaseImage image,
double  min_intensity = NaN,
double  max_intensity = NaN 
)
static

Get default number of bins for given input image

Parameters
[in]imageIntensity image.
[in]min_intensityPre-computed minimum intensity value.
[in]max_intensityPre-computed maximum intensity value.
Returns
Number of histogram bins.

§ Exclude()

virtual void mirtk::HistogramImageSimilarity::Exclude ( const blocked_range3d< int > &  )
virtual

Exclude region from similarity evaluation

Called by ApproximateGradient before the registered image region of the transformed image is updated.

Reimplemented from mirtk::ImageSimilarity.

§ Include()

virtual void mirtk::HistogramImageSimilarity::Include ( const blocked_range3d< int > &  )
virtual

Include region in similarity evaluation

Called by ApproximateGradient after the registered image region of the transformed image is updated.

Reimplemented from mirtk::ImageSimilarity.

§ mirtkLooseComponentMacro()

mirtk::HistogramImageSimilarity::mirtkLooseComponentMacro ( JointHistogramType  ,
Samples   
)

Joint histogram of raw intensity samples (no Parzen window function)

This class allocates a joint histogram instance and takes care of updating it upon each Update call. When an external _Samples histogram is provided, however, the owner of this external histogram is reponsible for updating and this histogram before the Update of this image similarity.


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