ITK  5.0.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:
97  ITK_DISALLOW_COPY_AND_ASSIGN(ObjectToObjectMultiMetricv4);
98 
104 
107 
109  itkNewMacro( Self );
110 
112  using MeasureType = typename Superclass::MeasureType;
113  using DerivativeType = typename Superclass::DerivativeType;
114  using DerivativeValueType = typename Superclass::DerivativeValueType;
115  using ParametersType = typename Superclass::ParametersType;
116  using ParametersValueType = typename Superclass::ParametersValueType;
117  using NumberOfParametersType = typename Superclass::NumberOfParametersType;
118  using CoordinateRepresentationType = typename Superclass::CoordinateRepresentationType;
119  using MovingTransformType = typename Superclass::MovingTransformType;
120  using FixedTransformType = typename Superclass::FixedTransformType;
121 
126  using MetricQueueType = std::deque<MetricBasePointer>;
127 
128  using ObjectType = typename Superclass::ObjectType;
129 
130  using WeightValueType = typename DerivativeType::ValueType;
133 
134  itkSetMacro(MetricWeights,WeightsArrayType);
135  itkGetMacro(MetricWeights,WeightsArrayType);
136 
138  void AddMetric( MetricType* metric );
139 
141  void ClearMetricQueue();
142 
144  SizeValueType GetNumberOfMetrics() const;
145 
146  void Initialize() override;
147 
149  void SetFixedObject( const ObjectType *itkNotUsed( object ) ) override
150  {
151  itkExceptionMacro( "A single object should not be specified for the multi metric.");
152  }
153 
155  void SetMovingObject( const ObjectType *itkNotUsed( object ) ) override
156  {
157  itkExceptionMacro( "A single object should not be specified for the multi metric.");
158  }
159 
161  void SetMovingTransform( MovingTransformType * ) override;
162 
164  void SetFixedTransform( FixedTransformType * ) override;
165 
170  MeasureType GetValue() const override;
171 
172  void GetDerivative( DerivativeType & ) const override;
173 
180  void GetValueAndDerivative(MeasureType & value, DerivativeType & derivative) const override;
181 
184  MetricValueArrayType GetValueArray() const;
185 
188  MeasureType GetWeightedValue() const;
189 
191  const MetricQueueType & GetMetricQueue() const;
192 
193  bool SupportsArbitraryVirtualDomainSamples() const override;
194 
195  using MetricCategoryType = typename Superclass::MetricCategoryType;
196 
199  {
200  return Superclass::MULTI_METRIC;
201  }
202 
203 protected:
204 
206  ~ObjectToObjectMultiMetricv4() override = default;
207  void PrintSelf(std::ostream & os, Indent indent) const override;
208 
209 private:
213 };
214 
215 } //end namespace itk
216 
217 #ifndef ITK_MANUAL_INSTANTIATION
218 #include "itkObjectToObjectMultiMetricv4.hxx"
219 #endif
220 
221 #endif
void SetFixedObject(const ObjectType *) override
Light weight base class for most itk classes.
unsigned long SizeValueType
Definition: itkIntTypes.h:83
TInternalComputationValueType ParametersValueType
This class takes one ore more ObjectToObject metrics and assigns weights to their derivatives to comp...
typename Superclass::FixedTransformType FixedTransformType
void SetMovingObject(const ObjectType *) override
typename DerivativeType::ValueType DerivativeValueType
Computes similarity between regions of two objects.
typename Superclass::MeasureType MeasureType
typename MetricType::Pointer MetricBasePointer
TInternalComputationValueType CoordinateRepresentationType
typename DerivativeType::ValueType WeightValueType
typename MetricType::ConstPointer MetricBaseConstPointer
typename Superclass::MovingTransformType MovingTransformType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
std::deque< MetricBasePointer > MetricQueueType
typename Superclass::DerivativeType DerivativeType
MetricCategoryType GetMetricCategory() const override
Base class for most ITK classes.
Definition: itkObject.h:60