ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkANTSNeighborhoodCorrelationImageToImageMetricv4DenseGetValueAndDerivativeThreader.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 __itkANTSNeighborhoodCorrelationImageToImageMetricv4DenseGetValueAndDerivativeThreader_h
19 #define __itkANTSNeighborhoodCorrelationImageToImageMetricv4DenseGetValueAndDerivativeThreader_h
20 
23 
24 namespace itk
25 {
26 
32 template< class TImageToImageMetric, class TNeighborhoodCorrelationMetric >
34  : public ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< TImageToImageMetric::VirtualImageDimension >, TImageToImageMetric >
35 {
36 public:
43 
45 
46  itkNewMacro( Self );
47 
48  typedef typename Superclass::DomainType DomainType;
49  typedef typename Superclass::AssociateType AssociateType;
50 
51  typedef typename Superclass::VirtualImageType VirtualImageType;
52  typedef typename Superclass::VirtualPointType VirtualPointType;
53  typedef typename Superclass::VirtualIndexType VirtualIndexType;
54  typedef typename Superclass::FixedImagePointType FixedImagePointType;
55  typedef typename Superclass::FixedImagePixelType FixedImagePixelType;
56  typedef typename Superclass::FixedImageGradientType FixedImageGradientType;
57  typedef typename Superclass::MovingImagePointType MovingImagePointType;
58  typedef typename Superclass::MovingImagePixelType MovingImagePixelType;
59  typedef typename Superclass::MovingImageGradientType MovingImageGradientType;
60  typedef typename Superclass::MeasureType MeasureType;
61  typedef typename Superclass::DerivativeType DerivativeType;
62  typedef typename Superclass::DerivativeValueType DerivativeValueType;
63 
64  typedef TNeighborhoodCorrelationMetric NeighborhoodCorrelationMetricType;
65  typedef typename NeighborhoodCorrelationMetricType::ScanIteratorType ScanIteratorType;
66  typedef typename NeighborhoodCorrelationMetricType::ScanMemType ScanMemType;
67  typedef typename NeighborhoodCorrelationMetricType::ScanParametersType ScanParametersType;
68  typedef typename NeighborhoodCorrelationMetricType::ImageRegionType ImageRegionType;
69  typedef typename NeighborhoodCorrelationMetricType::InternalComputationValueType InternalComputationValueType;
70  typedef typename NeighborhoodCorrelationMetricType::SumQueueType SumQueueType;
71  typedef typename NeighborhoodCorrelationMetricType::ImageDimensionType ImageDimensionType;
72  typedef typename NeighborhoodCorrelationMetricType::JacobianType JacobianType;
73  typedef typename NeighborhoodCorrelationMetricType::NumberOfParametersType NumberOfParametersType;
74 
75 protected:
77 
81  virtual bool ProcessPoint(
82  const VirtualIndexType & itkNotUsed(virtualIndex),
83  const VirtualPointType & itkNotUsed(virtualPoint),
84  const FixedImagePointType & itkNotUsed(mappedFixedPoint),
85  const FixedImagePixelType & itkNotUsed(mappedFixedPixelValue),
86  const FixedImageGradientType & itkNotUsed(mappedFixedImageGradient),
87  const MovingImagePointType & itkNotUsed(mappedMovingPoint),
88  const MovingImagePixelType & itkNotUsed(mappedMovingPixelValue),
89  const MovingImageGradientType & itkNotUsed(mappedMovingImageGradient),
90  MeasureType & itkNotUsed(metricValueReturn),
91  DerivativeType & itkNotUsed(localDerivativeReturn),
92  const ThreadIdType itkNotUsed(threadID) ) const
93  {
94  return false;
95  }
96 
97  virtual void ThreadedExecution( const DomainType& domain,
98  const ThreadIdType threadId );
99 
102  void UpdateQueues(const ScanIteratorType &scanIt,
103  ScanMemType &scanMem, const ScanParametersType &scanParameters,
104  const ThreadIdType threadID) const;
105 
107  const ScanIteratorType &scanIt, ScanMemType &scanMem,
108  const ScanParametersType &scanParameters,
109  const ThreadIdType threadID) const;
110 
115  const ScanIteratorType &scanIt, ScanMemType &scanMem,
116  const ScanParametersType &scanParameters,
117  const ThreadIdType threadID) const;
118 
122  const ScanIteratorType &scanIt, ScanMemType &scanMem,
123  const ScanParametersType &scanParameters,
124  const ThreadIdType threadID) const;
125 
127  const ScanIteratorType &scanIt, ScanMemType &scanMem,
128  const ScanParametersType &scanParameters, DerivativeType &deriv,
129  MeasureType &local_cc, const ThreadIdType threadID) const;
130 
131 private:
133  void operator=( const Self & ); // purposely not implemented
134 };
135 
136 } // end namespace itk
137 
138 #ifndef ITK_MANUAL_INSTANTIATION
139 #include "itkANTSNeighborhoodCorrelationImageToImageMetricv4DenseGetValueAndDerivativeThreader.hxx"
140 #endif
141 
142 #endif
143