20 #ifndef MIRTK_NormalizedIntensityCrossCorrelation_H 21 #define MIRTK_NormalizedIntensityCrossCorrelation_H 23 #include "mirtk/ImageSimilarity.h" 25 #include "mirtk/Voxel.h" 26 #include "mirtk/GenericImage.h" 27 #include "mirtk/Vector3D.h" 28 #include "mirtk/Parallel.h" 50 enum Units { UNITS_Default, UNITS_MM, UNITS_Voxel };
55 enum KernelType { CustomKernel , BoxWindow, GaussianKernel };
61 mirtkAttributeMacro(
enum KernelType, KernelType);
65 mirtkComponentMacro(KernelImage, KernelX);
69 mirtkComponentMacro(KernelImage, KernelY);
73 mirtkComponentMacro(KernelImage, KernelZ);
76 mirtkComponentMacro(RealImage, A);
79 mirtkComponentMacro(RealImage, B);
82 mirtkComponentMacro(RealImage, C);
85 mirtkComponentMacro(RealImage, S);
88 mirtkComponentMacro(RealImage, T);
91 double _GlobalA, _GlobalB, _GlobalC, _GlobalS, _GlobalT;
94 mutable RealImage _Temp;
103 mirtkReadOnlyAttributeMacro(
Vector3D<int>, NeighborhoodRadius);
115 static KernelImage *CreateGaussianKernel(
double);
118 virtual void ClearKernel();
166 virtual void Update(
bool =
true);
182 RealImage *, RealImage *);
196 virtual double RawValue(
double)
const;
202 virtual void WriteDataSets(
const char *,
const char *,
bool =
true)
const;
209 #endif // MIRTK_NormalizedIntensityCrossCorrelation_H
virtual void SetKernelToBoxWindow(double, double=-1, double=-1, Units=UNITS_MM)
Set kernel to a box window with given radius.
NormalizedIntensityCrossCorrelation & operator=(const NormalizedIntensityCrossCorrelation &)
Assignment operator.
virtual void Initialize()
Initialize similarity measure once input and parameters have been set.
Units
Enumeration of local window size units.
virtual void Exclude(const blocked_range3d< int > &)
Exclude region from similarity evaluation.
virtual bool NonParametricGradient(const RegisteredImage *, GradientImageType *)
Evaluate non-parametric similarity gradient w.r.t the given image.
virtual void Include(const blocked_range3d< int > &)
Include region in similarity evaluation.
Array< Pair< string, string > > ParameterList
Ordered list of parameter name/value pairs.
virtual double Evaluate()
Evaluate similarity of images.
virtual void SetKernelToGaussian(double, double=-1, double=-1, Units=UNITS_MM)
Set kernel to a Gaussian with given standard deviation.
virtual ParameterList Parameter() const
Get parameter key/value as string map.
virtual void Update(bool=true)
Update moving image and internal state of similarity measure.
virtual void ComputeWeightedAverage(const blocked_range3d< int > &, RealImage *)
Convolve image with separable window kernel.
Normalized cross-correlation.
~NormalizedIntensityCrossCorrelation()
Destructor.
NormalizedIntensityCrossCorrelation(const char *="")
Constructor.
virtual void Print(Indent=0) const
Print debug information.
virtual bool SetWithPrefix(const char *, const char *)
Set parameter value from string.
virtual ParameterList Parameter() const
Get parameter key/value as string map.
virtual void WriteDataSets(const char *, const char *, bool=true) const
Write input of data fidelity term.
TVoxel VoxelType
Voxel type.
virtual void ComputeStatistics(const blocked_range3d< int > &, const RegisteredImage *, RealImage *, RealImage *)
Compute statistics of local intensity distribution.