ANIMA  4.0
animaNLMeansVectorPatchSearcher.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include <itkVectorImage.h>
5 
6 namespace anima
7 {
8 
9 template <class ImageScalarType, class DataImageType>
11  : public anima::NonLocalPatchBaseSearcher < itk::VectorImage <ImageScalarType,DataImageType::ImageDimension> >
12 {
13 public:
14  typedef itk::VectorImage <ImageScalarType,DataImageType::ImageDimension> RefImageType;
15  typedef typename RefImageType::PixelType VectorType;
16  typedef vnl_matrix <double> CovarianceType;
17 
18  typedef itk::Image <unsigned char, 3> MaskImageType;
19  typedef typename MaskImageType::Pointer MaskImagePointer;
20 
21  typedef typename DataImageType::Pointer DataImagePointer;
24  typedef typename Superclass::IndexType IndexType;
25 
28 
29  void SetBetaParameter(double arg) {m_BetaParameter = arg;}
30  void SetMeanThreshold(double arg) {m_MeanThreshold = arg;}
31  void SetVarianceThreshold(double arg) {m_VarianceThreshold = arg;}
32 
33  void SetDataMask(MaskImageType *arg) {m_DataMask = arg;}
34 
35  void SetDatabaseCovarianceDistanceAverage(DataImagePointer &arg) {m_DatabaseCovarianceDistanceAverage = arg;}
36  void SetDatabaseCovarianceDistanceStd(DataImagePointer &arg) {m_DatabaseCovarianceDistanceStd = arg;}
37  void SetDatabaseMeanDistanceAverage(DataImagePointer &arg) {m_DatabaseMeanDistanceAverage = arg;}
38  void SetDatabaseMeanDistanceStd(DataImagePointer &arg) {m_DatabaseMeanDistanceStd = arg;}
39 
40 protected:
41  virtual void ComputeInputProperties(const IndexType &refIndex, ImageRegionType &refPatch);
42  virtual void ComputeComparisonProperties(unsigned int index, ImageRegionType &movingPatch);
43  virtual double ComputeWeightValue(unsigned int index, ImageRegionType &refPatch, ImageRegionType &movingPatch);
44  virtual bool TestPatchConformity(unsigned int index, const IndexType &refIndex, const IndexType &movingIndex);
45 
46 private:
47  DataImagePointer m_DatabaseCovarianceDistanceAverage;
48  DataImagePointer m_DatabaseCovarianceDistanceStd;
49  DataImagePointer m_DatabaseMeanDistanceAverage;
50  DataImagePointer m_DatabaseMeanDistanceStd;
51 
52  MaskImagePointer m_DataMask;
53 
54  double m_BetaParameter;
55 
56  double m_MeanThreshold;
57  double m_VarianceThreshold;
58 
59  // Internal variables
60  VectorType m_RefPatchMean, m_MovingPatchMean;
61  CovarianceType m_RefPatchCovariance, m_MovingPatchCovariance;
62  unsigned int m_RefPatchNumElements, m_MovingPatchNumElements;
63  CovarianceType m_LogRefPatchCovariance;
64  CovarianceType m_NoiseCovariance, m_NoiseSigma;
65 };
66 
67 } // end namespace anima
68 
virtual bool TestPatchConformity(unsigned int index, const IndexType &refIndex, const IndexType &movingIndex)
virtual double ComputeWeightValue(unsigned int index, ImageRegionType &refPatch, ImageRegionType &movingPatch)
virtual void ComputeComparisonProperties(unsigned int index, ImageRegionType &movingPatch)
anima::NonLocalPatchBaseSearcher< RefImageType > Superclass
void SetDatabaseMeanDistanceStd(DataImagePointer &arg)
itk::VectorImage< ImageScalarType, DataImageType::ImageDimension > RefImageType
void SetDatabaseCovarianceDistanceStd(DataImagePointer &arg)
void SetDatabaseMeanDistanceAverage(DataImagePointer &arg)
virtual void ComputeInputProperties(const IndexType &refIndex, ImageRegionType &refPatch)
void SetDatabaseCovarianceDistanceAverage(DataImagePointer &arg)
itk::Image< unsigned char, 3 > MaskImageType