NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkMammogramFatEstimationFitMetricForImage.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef __itkMammogramFatEstimationFitMetricForImage_h
16 #define __itkMammogramFatEstimationFitMetricForImage_h
17 
19 #include <itkImageRegionIterator.h>
20 #include <itkImageRegionIteratorWithIndex.h>
21 #include <itkImageRegionConstIterator.h>
22 #include <itkImageRegionConstIteratorWithIndex.h>
23 
24 namespace itk {
25 
37 template <class TInputImage>
40 {
41 // Software Guide : EndCodeSnippet
42 public:
45  typedef SmartPointer< Self > Pointer;
46  typedef SmartPointer< const Self > ConstPointer;
47 
50 
52  itkNewMacro(Self);
53 
55  itkStaticConstMacro(ImageDimension, unsigned int,
56  TInputImage::ImageDimension);
57 
58  itkStaticConstMacro( ParametricSpaceDimension, unsigned int, 7 );
59 
60  virtual unsigned int GetNumberOfParameters(void) const override
61  {
62  return ParametricSpaceDimension;
63  }
64 
66  typedef TInputImage InputImageType;
67  typedef typename InputImageType::Pointer InputImagePointer;
68  typedef typename InputImageType::ConstPointer InputImageConstPointer;
71  typedef typename InputImageType::SpacingType InputImageSpacingType;
72  typedef typename InputImageType::PointType InputImagePointType;
75 
76  typedef typename itk::ImageRegionIterator< TInputImage > IteratorType;
77  typedef typename itk::ImageRegionIteratorWithIndex< TInputImage > IteratorWithIndexType;
78  typedef typename itk::ImageRegionConstIterator< TInputImage > IteratorConstType;
79  typedef typename itk::ImageRegionConstIteratorWithIndex< TInputImage > IteratorWithIndexConstType;
80 
81 
83  typedef float DistancePixelType;
84  typedef typename itk::Image<DistancePixelType, ImageDimension> DistanceImageType;
85  typedef typename DistanceImageType::Pointer DistanceImagePointer;
86  typedef typename DistanceImageType::ConstPointer DistanceImageConstPointer;
89  typedef typename DistanceImageType::SpacingType DistanceImageSpacingType;
90  typedef typename DistanceImageType::PointType DistanceImagePointType;
93 
94  typedef typename itk::ImageRegionIterator< DistanceImageType > DistanceIteratorType;
95  typedef typename itk::ImageRegionIteratorWithIndex< DistanceImageType > DistanceIteratorWithIndexType;
96 
98  typedef unsigned char MaskPixelType;
99  typedef typename itk::Image<MaskPixelType, ImageDimension> MaskImageType;
100  typedef typename MaskImageType::ConstPointer MaskImageConstPointer;
101  typedef typename MaskImageType::Pointer MaskImagePointer;
105  typedef typename MaskImageType::SpacingType MaskImageSpacingType;
106 
107 
108  typedef typename itk::ImageRegionConstIterator< MaskImageType > MaskIteratorType;
109  typedef typename itk::ImageLinearConstIteratorWithIndex< MaskImageType > MaskLineIteratorType;
110 
111 
113  void SetInputImage( const InputImageType *imInput );
114 
116  void SetMask( const MaskImageType *imMask );
117 
119  itkGetObjectMacro( Fat, InputImageType );
120 
122  DistancePixelType GetMaxDistance( void ) { return m_MaxDistance; }
123 
125  itkGetObjectMacro( Distance, DistanceImageType );
126 
127  MeasureType GetValue( const ParametersType &parameters ) const override;
128 
129  void ClearFatImage( void );
130 
131  void GenerateFatImage( const ParametersType &parameters );
132 
133  void WriteIntensityVsEdgeDistToFile( std::string fileOutputIntensityVsEdgeDist ) override;
134  void WriteFitToFile( std::string fileOutputFit,
135  const ParametersType &parameters ) override;
136 
137 
138 protected:
139 
143  void operator=(const Self &) {}
144  void PrintSelf(std::ostream & os, Indent indent) const override;
145 
146  InputImageRegionType m_ImRegion;
147  InputImageSpacingType m_ImSpacing;
148  InputImagePointType m_ImOrigin;
149  InputImageSizeType m_ImSize;
150  InputImagePointType m_ImSizeInMM;
151  InputImageConstPointer m_InputImage;
152 
153  InputImagePointer m_Fat;
154 
155  MaskImageRegionType m_MaskRegion;
156  MaskImageConstPointer m_Mask;
157 
158  DistancePixelType m_MaxDistance;
159  DistanceImagePointer m_Distance;
160 
161  double CalculateFit( double d, const ParametersType &parameters, DistanceImageIndexType index );
162 
163 };
164 
165 } // end namespace itk
166 
167 #ifndef ITK_MANUAL_INSTANTIATION
168 #include "itkMammogramFatEstimationFitMetricForImage.txx"
169 #endif
170 
171 #endif
float DistancePixelType
Definition: itkMammogramFatEstimationFitMetricForImage.h:83
InputImageType::ConstPointer InputImageConstPointer
Definition: itkMammogramFatEstimationFitMetricForImage.h:68
MaskImageType::SizeType MaskImageSizeType
Definition: itkMammogramFatEstimationFitMetricForImage.h:103
itk::ImageRegionIterator< DistanceImageType > DistanceIteratorType
Definition: itkMammogramFatEstimationFitMetricForImage.h:94
An abstract metric to compute the fit of a model of mammographic fat.
Definition: itkMammogramFatEstimationFitMetric.h:33
MammogramFatEstimationFitMetricForImage(const Self &)
Definition: itkMammogramFatEstimationFitMetricForImage.h:142
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
MaskImageType::Pointer MaskImagePointer
Definition: itkMammogramFatEstimationFitMetricForImage.h:101
MaskImageType::SpacingType MaskImageSpacingType
Definition: itkMammogramFatEstimationFitMetricForImage.h:105
MammogramFatEstimationFitMetricForImage Self
Definition: itkMammogramFatEstimationFitMetricForImage.h:43
MaskImageConstPointer m_Mask
Definition: itkMammogramFatEstimationFitMetricForImage.h:156
InputImageType::SpacingType InputImageSpacingType
Definition: itkMammogramFatEstimationFitMetricForImage.h:71
MaskImageType::RegionType MaskImageRegionType
Definition: itkMammogramFatEstimationFitMetricForImage.h:102
Definition: niftkITKAffineResampleImage.cxx:74
itk::ImageRegionIteratorWithIndex< TInputImage > IteratorWithIndexType
Definition: itkMammogramFatEstimationFitMetricForImage.h:77
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
DistanceImagePointer m_Distance
Definition: itkMammogramFatEstimationFitMetricForImage.h:159
itk::ImageRegionIteratorWithIndex< DistanceImageType > DistanceIteratorWithIndexType
Definition: itkMammogramFatEstimationFitMetricForImage.h:95
InputImagePointer m_Fat
Definition: itkMammogramFatEstimationFitMetricForImage.h:153
itk::ImageLinearConstIteratorWithIndex< MaskImageType > MaskLineIteratorType
Definition: itkMammogramFatEstimationFitMetricForImage.h:109
DistanceImageType::RegionType DistanceImageRegionType
Definition: itkMammogramFatEstimationFitMetricForImage.h:87
itk::ImageRegionConstIterator< TInputImage > IteratorConstType
Definition: itkMammogramFatEstimationFitMetricForImage.h:78
itk::ImageRegionIterator< TInputImage > IteratorType
Definition: itkMammogramFatEstimationFitMetricForImage.h:76
MaskImageType::IndexType MaskImageIndexType
Definition: itkMammogramFatEstimationFitMetricForImage.h:104
DistanceImageType::ConstPointer DistanceImageConstPointer
Definition: itkMammogramFatEstimationFitMetricForImage.h:86
DistanceImageType::SpacingType DistanceImageSpacingType
Definition: itkMammogramFatEstimationFitMetricForImage.h:89
DistanceImageType::Pointer DistanceImagePointer
Definition: itkMammogramFatEstimationFitMetricForImage.h:85
DistanceImageType::PixelType DistanceImagePixelType
Definition: itkMammogramFatEstimationFitMetricForImage.h:88
itk::ImageRegionConstIterator< MaskImageType > MaskIteratorType
Definition: itkMammogramFatEstimationFitMetricForImage.h:108
virtual unsigned int GetNumberOfParameters(void) const override
Definition: itkMammogramFatEstimationFitMetricForImage.h:60
InputImagePointType m_ImSizeInMM
Definition: itkMammogramFatEstimationFitMetricForImage.h:150
SmartPointer< Self > Pointer
Definition: itkMammogramFatEstimationFitMetricForImage.h:45
itk::Image< DistancePixelType, ImageDimension > DistanceImageType
Definition: itkMammogramFatEstimationFitMetricForImage.h:84
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
DistanceImageType::IndexType DistanceImageIndexType
Definition: itkMammogramFatEstimationFitMetricForImage.h:91
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
void operator=(const Self &)
Definition: itkMammogramFatEstimationFitMetricForImage.h:143
InputImageSpacingType m_ImSpacing
Definition: itkMammogramFatEstimationFitMetricForImage.h:147
InputImageType::RegionType InputImageRegionType
Definition: itkMammogramFatEstimationFitMetricForImage.h:69
itk::ImageRegionConstIteratorWithIndex< TInputImage > IteratorWithIndexConstType
Definition: itkMammogramFatEstimationFitMetricForImage.h:79
unsigned char MaskPixelType
Definition: itkMammogramFatEstimationFitMetricForImage.h:98
InputImageRegionType m_ImRegion
Definition: itkMammogramFatEstimationFitMetricForImage.h:146
DistanceImageType::PointType DistanceImagePointType
Definition: itkMammogramFatEstimationFitMetricForImage.h:90
GLuint index
Definition: glew.h:1798
InputImageType::PixelType InputImagePixelType
Definition: itkMammogramFatEstimationFitMetricForImage.h:70
InputImageSizeType m_ImSize
Definition: itkMammogramFatEstimationFitMetricForImage.h:149
InputImageType::IndexType InputImageIndexType
Definition: itkMammogramFatEstimationFitMetricForImage.h:73
TInputImage InputImageType
Definition: itkMammogramFatEstimationFitMetricForImage.h:66
SmartPointer< const Self > ConstPointer
Definition: itkMammogramFatEstimationFitMetricForImage.h:46
Superclass::ParametersType ParametersType
Definition: itkMammogramFatEstimationFitMetric.h:47
MaskImageRegionType m_MaskRegion
Definition: itkMammogramFatEstimationFitMetricForImage.h:155
InputImageConstPointer m_InputImage
Definition: itkMammogramFatEstimationFitMetricForImage.h:151
DistanceImageType::SizeType DistanceImageSizeType
Definition: itkMammogramFatEstimationFitMetricForImage.h:92
itk::Image< MaskPixelType, ImageDimension > MaskImageType
Definition: itkMammogramFatEstimationFitMetricForImage.h:99
MammogramFatEstimationFitMetric Superclass
Definition: itkMammogramFatEstimationFitMetricForImage.h:44
DistancePixelType m_MaxDistance
Definition: itkMammogramFatEstimationFitMetricForImage.h:158
InputImagePointType m_ImOrigin
Definition: itkMammogramFatEstimationFitMetricForImage.h:148
DistancePixelType GetMaxDistance(void)
Definition: itkMammogramFatEstimationFitMetricForImage.h:122
MaskImageType::ConstPointer MaskImageConstPointer
Definition: itkMammogramFatEstimationFitMetricForImage.h:100
A metric to compute the similarity between an image and breast fat model.
Definition: itkMammogramFatEstimationFitMetricForImage.h:38
InputImageType::PointType InputImagePointType
Definition: itkMammogramFatEstimationFitMetricForImage.h:72
InputImageType::SizeType InputImageSizeType
Definition: itkMammogramFatEstimationFitMetricForImage.h:74
GLsizei const GLcharARB ** string
Definition: glew.h:5194
InputImageType::Pointer InputImagePointer
Definition: itkMammogramFatEstimationFitMetricForImage.h:67