go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedKappaStatisticImageToImageMetric.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 __itkAdvancedKappaStatisticImageToImageMetric_h
19 #define __itkAdvancedKappaStatisticImageToImageMetric_h
20 
22 
23 namespace itk
24 {
25 
55 template< class TFixedImage, class TMovingImage >
57  public AdvancedImageToImageMetric< TFixedImage, TMovingImage >
58 {
59 public:
60 
64  TFixedImage, TMovingImage > Superclass;
66  typedef SmartPointer< const Self > ConstPointer;
67 
69  itkNewMacro( Self );
70 
73 
75  typedef typename
92  typedef typename Superclass::RealType RealType;
111  typedef typename
115  typedef typename
117  typedef typename
119  typedef typename
123 
125  itkStaticConstMacro( FixedImageDimension, unsigned int,
126  FixedImageType::ImageDimension );
127 
129  itkStaticConstMacro( MovingImageDimension, unsigned int,
130  MovingImageType::ImageDimension );
131 
133  virtual MeasureType GetValue( const TransformParametersType & parameters ) const;
134 
136  virtual void GetDerivative( const TransformParametersType & parameters,
137  DerivativeType & derivative ) const;
138 
141  const TransformParametersType & parameters,
142  MeasureType & Value, DerivativeType & Derivative ) const;
143 
144  virtual void GetValueAndDerivative(
145  const TransformParametersType & parameters,
146  MeasureType & Value, DerivativeType & Derivative ) const;
147 
149  virtual void ComputeGradient( void );
150 
152  itkSetMacro( ForegroundValue, RealType );
153  itkGetConstReferenceMacro( ForegroundValue, RealType );
154 
159  itkSetMacro( UseForegroundValue, bool );
160 
166  itkSetMacro( Complement, bool );
167  itkGetConstReferenceMacro( Complement, bool );
168  itkBooleanMacro( Complement );
169 
171  itkSetMacro( Epsilon, RealType );
172  itkGetConstReferenceMacro( Epsilon, RealType );
173 
174 protected:
175 
178 
180  void PrintSelf( std::ostream & os, Indent indent ) const;
181 
195 
200  const RealType & fixedImageValue,
201  const RealType & movingImageValue,
202  std::size_t & fixedForegroundArea,
203  std::size_t & movingForegroundArea,
204  std::size_t & intersection,
205  const DerivativeType & imageJacobian,
206  const NonZeroJacobianIndicesType & nzji,
207  DerivativeType & sum1,
208  DerivativeType & sum2 ) const;
209 
214  virtual void InitializeThreadingParameters( void ) const;
215 
217  inline void ThreadedGetValueAndDerivative( ThreadIdType threadID );
218 
221  MeasureType & value, DerivativeType & derivative ) const;
222 
224  static ITK_THREAD_RETURN_TYPE AccumulateDerivativesThreaderCallback( void * arg );
225 
226 private:
227 
228  AdvancedKappaStatisticImageToImageMetric( const Self & ); // purposely not implemented
229  void operator=( const Self & ); // purposely not implemented
230 
233  RealType m_Epsilon;
235 
242  {
244 
245  MeasureType st_Coefficient1;
246  MeasureType st_Coefficient2;
247  DerivativeValueType * st_DerivativePointer;
248  };
249 
251  {
253  SizeValueType st_AreaSum;
254  SizeValueType st_AreaIntersection;
255  DerivativeType st_DerivativeSum1;
256  DerivativeType st_DerivativeSum2;
257  };
258  itkPadStruct( ITK_CACHE_LINE_ALIGNMENT, KappaGetValueAndDerivativePerThreadStruct,
259  PaddedKappaGetValueAndDerivativePerThreadStruct );
260  itkAlignedTypedef( ITK_CACHE_LINE_ALIGNMENT, PaddedKappaGetValueAndDerivativePerThreadStruct,
261  AlignedKappaGetValueAndDerivativePerThreadStruct );
262  mutable AlignedKappaGetValueAndDerivativePerThreadStruct * m_KappaGetValueAndDerivativePerThreadVariables;
264 
265 };
266 
267 } // end namespace itk
268 
269 #ifndef ITK_MANUAL_INSTANTIATION
270 #include "itkAdvancedKappaStatisticImageToImageMetric.hxx"
271 #endif
272 
273 #endif // end #ifndef __itkAdvancedKappaStatisticImageToImageMetric_h
AdvancedTransformType::NumberOfParametersType NumberOfParametersType
void PrintSelf(std::ostream &os, Indent indent) const
LimiterFunctionBase< RealType, FixedImageDimension > FixedImageLimiterType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Superclass::TransformParametersType TransformParametersType
static ITK_THREAD_RETURN_TYPE AccumulateDerivativesThreaderCallback(void *arg)
Superclass::FixedImageMaskPointer FixedImageMaskPointer
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics...
virtual void GetValueAndDerivativeSingleThreaded(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const
Superclass::GradientPixelType GradientPixelType
FixedImageLimiterType::OutputType FixedImageLimiterOutputType
Superclass::FixedImageRegionType FixedImageRegionType
ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
void ThreadedGetValueAndDerivative(ThreadIdType threadID)
MovingImageType::IndexType MovingImageIndexType
Superclass::MovingImageDerivativeScalesType MovingImageDerivativeScalesType
InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
TransformType::InputPointType FixedImagePointType
FixedArray< double, Self::MovingImageDimension > MovingImageDerivativeScalesType
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
ImageSamplerBase< FixedImageType > ImageSamplerType
AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Superclass::InterpolatorPointer InterpolatorPointer
itkPadStruct(ITK_CACHE_LINE_ALIGNMENT, KappaGetValueAndDerivativePerThreadStruct, PaddedKappaGetValueAndDerivativePerThreadStruct)
FixedImageIndexType::IndexValueType FixedImageIndexValueType
TransformType::OutputPointType MovingImagePointType
Superclass::MovingImageMaskType MovingImageMaskType
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
AdvancedImageToImageMetric< TFixedImage, TMovingImage > Superclass
Superclass::GradientImageType GradientImageType
Superclass::TransformPointer TransformPointer
Superclass::MovingImageContinuousIndexType MovingImageContinuousIndexType
virtual void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const
Superclass::GradientImageFilterType GradientImageFilterType
MovingImageType::RegionType MovingImageRegionType
Superclass::InterpolatorType InterpolatorType
itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT, PaddedKappaGetValueAndDerivativePerThreadStruct, AlignedKappaGetValueAndDerivativePerThreadStruct)
Superclass::TransformJacobianType TransformJacobianType
virtual MeasureType GetValue(const TransformParametersType &parameters) const
Computes similarity between two objects to be registered.
virtual void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const
Superclass::MovingImagePixelType MovingImagePixelType
GradientImageFilter< MovingImageType, RealType, RealType > CentralDifferenceGradientFilterType
virtual void InitializeThreadingParameters(void) const
Superclass::MovingImageMaskPointer MovingImageMaskPointer
MovingImageLimiterType::OutputType MovingImageLimiterOutputType
ThreaderType::ThreadInfoStruct ThreadInfoType
ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
Superclass::FixedImageMaskType FixedImageMaskType
Superclass::CentralDifferenceGradientFilterType CentralDifferenceGradientFilterType
void AfterThreadedGetValueAndDerivative(MeasureType &value, DerivativeType &derivative) const
BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
AlignedKappaGetValueAndDerivativePerThreadStruct * m_KappaGetValueAndDerivativePerThreadVariables
Superclass::FixedImageConstPointer FixedImageConstPointer
Superclass::MovingImageConstPointer MovingImageConstPointer
void UpdateValueAndDerivativeTerms(const RealType &fixedImageValue, const RealType &movingImageValue, std::vcl_size_t &fixedForegroundArea, std::vcl_size_t &movingForegroundArea, std::vcl_size_t &intersection, const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji, DerivativeType &sum1, DerivativeType &sum2) const
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Superclass::GradientImagePointer GradientImagePointer


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