ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkObjectToObjectMultiMetricv4.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 
19 #ifndef itkObjectToObjectMultiMetricv4_h
20 #define itkObjectToObjectMultiMetricv4_h
21 
23 #include "itkArray.h"
24 #include <deque>
25 
26 namespace itk
27 {
92 template<unsigned int TFixedDimension, unsigned int TMovingDimension, typename TVirtualImage = Image<double, TFixedDimension>, class TInternalComputationValueType = double >
93 class ITK_TEMPLATE_EXPORT ObjectToObjectMultiMetricv4:
94  public ObjectToObjectMetric<TFixedDimension, TMovingDimension, TVirtualImage, TInternalComputationValueType>
95 {
96 public:
102 
105 
107  itkNewMacro( Self );
108 
110  typedef typename Superclass::MeasureType MeasureType;
111  typedef typename Superclass::DerivativeType DerivativeType;
112  typedef typename Superclass::DerivativeValueType DerivativeValueType;
113  typedef typename Superclass::ParametersType ParametersType;
114  typedef typename Superclass::ParametersValueType ParametersValueType;
115  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
116  typedef typename Superclass::CoordinateRepresentationType CoordinateRepresentationType;
117  typedef typename Superclass::MovingTransformType MovingTransformType;
118  typedef typename Superclass::FixedTransformType FixedTransformType;
119 
124  typedef std::deque<MetricBasePointer> MetricQueueType;
125 
126  typedef typename Superclass::ObjectType ObjectType;
127 
131 
132  itkSetMacro(MetricWeights,WeightsArrayType);
133  itkGetMacro(MetricWeights,WeightsArrayType);
134 
136  void AddMetric( MetricType* metric );
137 
139  void ClearMetricQueue();
140 
142  SizeValueType GetNumberOfMetrics() const;
143 
144  void Initialize(void) ITK_OVERRIDE;
145 
147  virtual void SetFixedObject( const ObjectType *itkNotUsed( object ) ) ITK_OVERRIDE
148  {
149  itkExceptionMacro( "A single object should not be specified for the multi metric.");
150  }
151 
153  virtual void SetMovingObject( const ObjectType *itkNotUsed( object ) ) ITK_OVERRIDE
154  {
155  itkExceptionMacro( "A single object should not be specified for the multi metric.");
156  }
157 
159  virtual void SetMovingTransform( MovingTransformType * ) ITK_OVERRIDE;
160 
162  virtual void SetFixedTransform( FixedTransformType * ) ITK_OVERRIDE;
163 
168  MeasureType GetValue() const ITK_OVERRIDE;
169 
170  virtual void GetDerivative( DerivativeType & ) const ITK_OVERRIDE;
171 
178  void GetValueAndDerivative(MeasureType & value, DerivativeType & derivative) const ITK_OVERRIDE;
179 
182  MetricValueArrayType GetValueArray() const;
183 
186  MeasureType GetWeightedValue() const;
187 
189  const MetricQueueType & GetMetricQueue() const;
190 
191  virtual bool SupportsArbitraryVirtualDomainSamples( void ) const ITK_OVERRIDE;
192 
194 
196  virtual MetricCategoryType GetMetricCategory() const ITK_OVERRIDE
197  {
198  return Superclass::MULTI_METRIC;
199  }
200 
201 protected:
202 
204  virtual ~ObjectToObjectMultiMetricv4() ITK_OVERRIDE;
205  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
206 
207 private:
208  ITK_DISALLOW_COPY_AND_ASSIGN(ObjectToObjectMultiMetricv4);
209 
210  MetricQueueType m_MetricQueue;
211  WeightsArrayType m_MetricWeights;
212  mutable MetricValueArrayType m_MetricValueArray;
213 };
214 
215 } //end namespace itk
216 
217 #ifndef ITK_MANUAL_INSTANTIATION
218 #include "itkObjectToObjectMultiMetricv4.hxx"
219 #endif
220 
221 #endif
TInternalComputationValueType ValueType
Definition: itkArray.h:55
Light weight base class for most itk classes.
ObjectToObjectMetric< TFixedDimension, TMovingDimension, TVirtualImage, TInternalComputationValueType > Superclass
This class takes one ore more ObjectToObject metrics and assigns weights to their derivatives to comp...
Superclass::ParametersValueType ParametersValueType
Computes similarity between regions of two objects.
unsigned long SizeValueType
Definition: itkIntTypes.h:143
Superclass::CoordinateRepresentationType CoordinateRepresentationType
virtual void SetMovingObject(const ObjectType *) override
Superclass::FixedTransformType FixedTransformType
Superclass::MovingTransformType MovingTransformType
Superclass::NumberOfParametersType NumberOfParametersType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
std::deque< MetricBasePointer > MetricQueueType
Base class for most ITK classes.
Definition: itkObject.h:59
Superclass::DerivativeValueType DerivativeValueType