go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkParzenWindowMutualInformationImageToImageMetric.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkParzenWindowMutualInformationImageToImageMetric_H__
19 #define __itkParzenWindowMutualInformationImageToImageMetric_H__
20 
22 
23 #include "itkArray2D.h"
24 
25 namespace itk
26 {
27 
74 template< class TFixedImage, class TMovingImage >
76  public ParzenWindowHistogramImageToImageMetric< TFixedImage, TMovingImage >
77 {
78 public:
79 
83  TFixedImage, TMovingImage > Superclass;
85  typedef SmartPointer< const Self > ConstPointer;
86 
88  itkNewMacro( Self );
89 
91  itkTypeMacro(
94 
96  typedef typename
113  typedef typename Superclass::RealType RealType;
132  typedef typename
136  typedef typename
138  typedef typename
140  typedef typename
144 
146  itkStaticConstMacro( FixedImageDimension, unsigned int,
147  FixedImageType::ImageDimension );
148 
150  itkStaticConstMacro( MovingImageDimension, unsigned int,
151  MovingImageType::ImageDimension );
152 
154  MeasureType GetValue( const ParametersType & parameters ) const;
155 
157  itkGetConstMacro( UseJacobianPreconditioning, bool );
158  itkSetMacro( UseJacobianPreconditioning, bool );
159 
160 protected:
161 
164 
167 
195 
203  virtual void GetValueAndAnalyticDerivative(
204  const ParametersType & parameters,
205  MeasureType & value, DerivativeType & derivative ) const;
206 
217  const ParametersType & parameters,
218  MeasureType & value, DerivativeType & derivative ) const;
219 
226  const ParametersType & parameters,
227  MeasureType & value, DerivativeType & derivative ) const;
228 
230  virtual void ComputeJacobianPreconditioner(
231  const TransformJacobianType & jac,
232  const NonZeroJacobianIndicesType & nzji,
233  DerivativeType & preconditioner,
234  DerivativeType & divisor ) const;
235 
237  virtual void InitializeHistograms( void );
238 
241  {
242  Self * m_Metric;
243  };
244  ParzenWindowMutualInformationMultiThreaderParameterType m_ParzenWindowMutualInformationThreaderParameters;
245 
247  inline void ThreadedComputeDerivativeLowMemory( ThreadIdType threadId );
248 
251  DerivativeType & derivative ) const;
252 
254  static ITK_THREAD_RETURN_TYPE ComputeDerivativeLowMemoryThreaderCallback( void * arg );
255 
258 
259 private:
260 
262  ParzenWindowMutualInformationImageToImageMetric( const Self & ); // purposely not implemented
264  void operator=( const Self & ); // purposely not implemented
265 
267  typedef double PRatioType;
269  mutable PRatioArrayType m_PRatioArray;
270 
273 
275  void ComputeDerivativeLowMemorySingleThreaded( DerivativeType & derivative ) const;
276 
277  void ComputeDerivativeLowMemory( DerivativeType & derivative ) const;
278 
281  const RealType & fixedImageValue,
282  const RealType & movingImageValue,
283  const DerivativeType & imageJacobian,
284  const NonZeroJacobianIndicesType & nzji,
285  DerivativeType & derivative ) const;
286 
288  void ComputeValueAndPRatioArray( double & MI ) const;
289 
290 };
291 
292 } // end namespace itk
293 
294 #ifndef ITK_MANUAL_INSTANTIATION
295 #include "itkParzenWindowMutualInformationImageToImageMetric.hxx"
296 #endif
297 
298 #endif // end #ifndef __itkParzenWindowMutualInformationImageToImageMetric_H__
AdvancedTransformType::NumberOfParametersType NumberOfParametersType
Superclass::MovingImageContinuousIndexType MovingImageContinuousIndexType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
Superclass::MovingImageDerivativeScalesType MovingImageDerivativeScalesType
void ThreadedComputeDerivativeLowMemory(ThreadIdType threadId)
virtual void GetValueAndAnalyticDerivativeLowMemory(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
Superclass::CoordinateRepresentationType CoordinateRepresentationType
static ITK_THREAD_RETURN_TYPE ComputeDerivativeLowMemoryThreaderCallback(void *arg)
void ComputeDerivativeLowMemorySingleThreaded(DerivativeType &derivative) const
void UpdateDerivativeLowMemory(const RealType &fixedImageValue, const RealType &movingImageValue, const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji, DerivativeType &derivative) const
virtual void ComputeJacobianPreconditioner(const TransformJacobianType &jac, const NonZeroJacobianIndicesType &nzji, DerivativeType &preconditioner, DerivativeType &divisor) const
A base class for image metrics based on a joint histogram computed using Parzen Windowing.
MeasureType GetValue(const ParametersType &parameters) const
virtual void GetValueAndAnalyticDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
ParzenWindowHistogramImageToImageMetric< TFixedImage, TMovingImage > Superclass
void AfterThreadedComputeDerivativeLowMemory(DerivativeType &derivative) const
void ComputeDerivativeLowMemory(DerivativeType &derivative) const
virtual void GetValueAndFiniteDifferenceDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
Computes the mutual information between two images to be registered using the method of Mattes et al...
ParzenWindowMutualInformationMultiThreaderParameterType m_ParzenWindowMutualInformationThreaderParameters
Superclass::CentralDifferenceGradientFilterType CentralDifferenceGradientFilterType


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo