NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkRegistrationForceFilter.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 itkRegistrationForceFilter_h
16 #define itkRegistrationForceFilter_h
18 #include <itkImageToImageFilter.h>
19 #include <itkVector.h>
20 #include <itkImage.h>
21 #include <itkDisplacementFieldJacobianDeterminantFilter.h>
22 
23 namespace itk {
38 template< class TFixedImage, class TMovingImage, class TScalarType>
39 class ITK_EXPORT RegistrationForceFilter :
40  public ImageToImageFilter<TFixedImage,
41  Image<
42  Vector< TScalarType, TFixedImage::ImageDimension>,
43  TFixedImage::ImageDimension> >
44 {
45 public:
46 
49  typedef ImageToImageFilter<TFixedImage,
50  Image<
51  Vector< TScalarType, TFixedImage::ImageDimension>,
52  TFixedImage::ImageDimension> > Superclass;
53  typedef SmartPointer<Self> Pointer;
54  typedef SmartPointer<const Self> ConstPointer;
55 
57  itkTypeMacro(RegistrationForceFilter, ImageToImageFilter);
58 
60  itkStaticConstMacro(Dimension, unsigned int, TFixedImage::ImageDimension);
61 
63  typedef TScalarType OutputDataType;
64  typedef Vector< OutputDataType, itkGetStaticConstMacro(Dimension) > OutputPixelType;
66  typedef typename Superclass::InputImageType InputImageType;
68  typedef typename Superclass::InputImageRegionType RegionType;
69  typedef TScalarType MeasureType;
70 
80 
81  typedef SpatialObject< Dimension > FixedImageMaskType;
82 
83  //typedef Image<Vector<TScalarType, TFixedImage::ImageDimension>, TFixedImage::ImageDimension> DeformationFieldType;
84  //typedef DisplacementFieldJacobianDeterminantFilter<DeformationFieldType, TScalarType> JacobianDeterminantFilterType;
86 
88  virtual void SetFixedImage(const InputImageType *image) { this->SetNthInput(0, image); }
89 
91  virtual void SetTransformedMovingImage(const InputImageType *image) { this->SetNthInput(1, image); }
92 
94  virtual void SetUnTransformedMovingImage(const InputImageType *image) { this->SetNthInput(2, image); }
95 
97  virtual void SetNthInput(unsigned int idx, const InputImageType *);
98 
100  itkSetObjectMacro( Metric, MetricType );
101  itkGetObjectMacro( Metric, MetricType );
102 
107  itkSetMacro( ScaleToSizeOfVoxelAxis, bool );
108  itkGetMacro( ScaleToSizeOfVoxelAxis, bool );
109 
111  itkSetMacro( FixedUpperPixelValue, InputImagePixelType);
112  itkGetMacro( FixedUpperPixelValue, InputImagePixelType);
113 
115  itkSetMacro( FixedLowerPixelValue, InputImagePixelType);
116  itkGetMacro( FixedLowerPixelValue, InputImagePixelType);
117 
119  itkSetMacro( MovingUpperPixelValue, InputImagePixelType);
120  itkGetMacro( MovingUpperPixelValue, InputImagePixelType);
121 
123  itkSetMacro( MovingLowerPixelValue, InputImagePixelType);
124  itkGetMacro( MovingLowerPixelValue, InputImagePixelType);
125 
129  itkSetMacro(IsSymmetric, bool);
130  itkGetMacro(IsSymmetric, bool);
131 
133  virtual void SetFixedImageMask(const FixedImageMaskType* fixedImageMask) { this->m_FixedImageMask = fixedImageMask; }
134 
136  void WriteForceImage(std::string filename);
137 
141  virtual void SetFixedImageTransformJacobian(typename JacobianImageType::Pointer jacobian)
142  {
143  this->m_FixedImageTransformJacobian = jacobian;
144  }
145 
149  virtual void SetMovingImageTransformJacobian(typename JacobianImageType::Pointer jacobian)
150  {
151  this->m_MovingImageTransformJacobian = jacobian;
152  }
153 
154 protected:
157  void PrintSelf(std::ostream& os, Indent indent) const;
158 
159  // Check before we start.
160  virtual void BeforeThreadedGenerateData();
161 
162  // (mainly for debugging purposes).
163  virtual void AfterThreadedGenerateData();
164 
166  MetricPointer m_Metric;
167 
170 
172  InputImagePixelType m_FixedUpperPixelValue;
173 
175  InputImagePixelType m_FixedLowerPixelValue;
176 
178  InputImagePixelType m_MovingUpperPixelValue;
179 
181  InputImagePixelType m_MovingLowerPixelValue;
182 
184  const FixedImageMaskType* m_FixedImageMask;
185 
190 
194  typename JacobianImageType::Pointer m_FixedImageTransformJacobian;
195 
199  typename JacobianImageType::Pointer m_MovingImageTransformJacobian;
200 
201 private:
202 
206  RegistrationForceFilter(const Self&);
207  void operator=(const Self&);
208 
209 };
210 
211 }
212 
213 #ifndef ITK_MANUAL_INSTANTIATION
214 #include "itkRegistrationForceFilter.txx"
215 #endif
216 
217 #endif
JacobianImageType::Pointer m_FixedImageTransformJacobian
Definition: itkRegistrationForceFilter.h:194
MetricPointer m_Metric
Definition: itkRegistrationForceFilter.h:166
SpatialObject< Dimension > FixedImageMaskType
Definition: itkRegistrationForceFilter.h:81
Image< double, TFixedImage::ImageDimension > JacobianImageType
Definition: itkRegistrationForceFilter.h:85
virtual void SetFixedImage(const InputImageType *image)
Definition: itkRegistrationForceFilter.h:88
TScalarType MeasureType
Definition: itkRegistrationForceFilter.h:69
Computes similarity between two objects to be registered using Histogram.
Definition: itkHistogramSimilarityMeasure.h:33
HistogramType::SizeType HistogramSizeType
Definition: itkHistogramSimilarityMeasure.h:59
virtual void SetFixedImageTransformJacobian(typename JacobianImageType::Pointer jacobian)
Definition: itkRegistrationForceFilter.h:141
RegistrationForceFilter Self
Definition: itkRegistrationForceFilter.h:48
HistogramType::AbsoluteFrequencyType HistogramFrequencyType
Definition: itkHistogramSimilarityMeasure.h:61
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: glew.h:4052
MetricType::HistogramFrequencyType HistogramFrequencyType
Definition: itkRegistrationForceFilter.h:78
JacobianImageType::Pointer m_MovingImageTransformJacobian
Definition: itkRegistrationForceFilter.h:199
TScalarType OutputDataType
Definition: itkRegistrationForceFilter.h:63
Definition: niftkITKAffineResampleImage.cxx:74
MetricType::HistogramPointer HistogramPointer
Definition: itkRegistrationForceFilter.h:75
virtual void SetUnTransformedMovingImage(const InputImageType *image)
Definition: itkRegistrationForceFilter.h:94
Superclass::InputImageType InputImageType
Definition: itkRegistrationForceFilter.h:66
MetricType::HistogramIteratorType HistogramIteratorType
Definition: itkRegistrationForceFilter.h:79
InputImagePixelType m_MovingUpperPixelValue
Definition: itkRegistrationForceFilter.h:178
Superclass::InputImageRegionType RegionType
Definition: itkRegistrationForceFilter.h:68
InputImagePixelType m_FixedUpperPixelValue
Definition: itkRegistrationForceFilter.h:172
ImageToImageFilter< TFixedImage, Image< Vector< TScalarType, TFixedImage::ImageDimension >, TFixedImage::ImageDimension > > Superclass
Definition: itkRegistrationForceFilter.h:52
Extends Histogram to provide standard Entropy functions.
Definition: itkUCLHistogram.h:32
HistogramType::MeasurementVectorType HistogramMeasurementVectorType
Definition: itkHistogramSimilarityMeasure.h:60
const FixedImageMaskType * m_FixedImageMask
Definition: itkRegistrationForceFilter.h:184
SmartPointer< Self > Pointer
Definition: itkRegistrationForceFilter.h:53
This class takes as input 2 input images, and outputs the registration force.
Definition: itkRegistrationForceFilter.h:39
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
HistogramType::Pointer HistogramPointer
Definition: itkHistogramSimilarityMeasure.h:58
InputImagePixelType m_MovingLowerPixelValue
Definition: itkRegistrationForceFilter.h:181
virtual void SetMovingImageTransformJacobian(typename JacobianImageType::Pointer jacobian)
Definition: itkRegistrationForceFilter.h:149
~RegistrationForceFilter()
Definition: itkRegistrationForceFilter.h:156
HistogramSimilarityMeasure< TFixedImage, TMovingImage > MetricType
Definition: itkRegistrationForceFilter.h:72
MetricType::HistogramType HistogramType
Definition: itkRegistrationForceFilter.h:74
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
InputImagePixelType m_FixedLowerPixelValue
Definition: itkRegistrationForceFilter.h:175
const unsigned int Dimension
Definition: niftkBreastDCEandADC.cxx:89
Vector< OutputDataType, itkGetStaticConstMacro(Dimension) > OutputPixelType
Definition: itkRegistrationForceFilter.h:64
bool m_IsSymmetric
Definition: itkRegistrationForceFilter.h:189
MetricType::Pointer MetricPointer
Definition: itkRegistrationForceFilter.h:73
Image< OutputPixelType, itkGetStaticConstMacro(Dimension) > OutputImageType
Definition: itkRegistrationForceFilter.h:65
InputImageType::PixelType InputImagePixelType
Definition: itkRegistrationForceFilter.h:67
MetricType::HistogramMeasurementVectorType HistogramMeasurementVectorType
Definition: itkRegistrationForceFilter.h:77
virtual void SetTransformedMovingImage(const InputImageType *image)
Definition: itkRegistrationForceFilter.h:91
MetricType::HistogramSizeType HistogramSizeType
Definition: itkRegistrationForceFilter.h:76
HistogramType::Iterator HistogramIteratorType
Definition: itkHistogramSimilarityMeasure.h:62
GLsizei const GLcharARB ** string
Definition: glew.h:5194
bool m_ScaleToSizeOfVoxelAxis
Definition: itkRegistrationForceFilter.h:169
virtual void SetFixedImageMask(const FixedImageMaskType *fixedImageMask)
Definition: itkRegistrationForceFilter.h:133
SmartPointer< const Self > ConstPointer
Definition: itkRegistrationForceFilter.h:54
SmartPointer< Self > Pointer
Definition: itkHistogramSimilarityMeasure.h:41