ITK  4.2.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 {
93 template<unsigned int TFixedDimension, unsigned int TMovingDimension, class TVirtualImage = Image<typename ObjectToObjectMetricBase::ParametersValueType, TFixedDimension> >
94 class ITK_EXPORT ObjectToObjectMultiMetricv4:
95  public ObjectToObjectMetric<TFixedDimension, TMovingDimension, TVirtualImage>
96 {
97 public:
103 
106 
108  itkNewMacro( Self );
109 
111  typedef typename Superclass::MeasureType MeasureType;
112  typedef typename Superclass::DerivativeType DerivativeType;
113  typedef typename Superclass::DerivativeValueType DerivativeValueType;
114  typedef typename Superclass::ParametersType ParametersType;
115  typedef typename Superclass::ParametersValueType ParametersValueType;
116  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
117  typedef typename Superclass::CoordinateRepresentationType CoordinateRepresentationType;
118  typedef typename Superclass::MovingTransformType MovingTransformType;
119 
124  typedef std::deque<MetricBasePointer> MetricQueueType;
125 
126  typedef typename DerivativeType::ValueType WeightValueType;
129 
130  itkSetMacro(MetricWeights,WeightsArrayType);
131  itkGetMacro(MetricWeights,WeightsArrayType);
132 
134  void AddMetric( MetricType* metric );
135 
137  void ClearMetricQueue( void );
138 
140  SizeValueType GetNumberOfMetrics() const;
141 
142  void Initialize(void) throw ( itk::ExceptionObject );
143 
145  virtual void SetMovingTransform( MovingTransformType * );
146 
151  MeasureType GetValue() const;
152 
153  virtual void GetDerivative( DerivativeType & ) const;
154 
161  void GetValueAndDerivative(MeasureType & value, DerivativeType & derivative) const;
162 
165  MetricValueArrayType GetValueArray() const;
166 
169  MeasureType GetWeightedValue() const;
170 
172  const MetricQueueType & GetMetricQueue();
173 
174  virtual bool SupportsArbitraryVirtualDomainSamples( void ) const;
175 
176 protected:
177 
179  virtual ~ObjectToObjectMultiMetricv4();
180  void PrintSelf(std::ostream & os, Indent indent) const;
181 
182 private:
183 
184  //purposely not implemented
185  ObjectToObjectMultiMetricv4(const Self &);
186  void operator=(const Self &);
187 
188  MetricQueueType m_MetricQueue;
189  WeightsArrayType m_MetricWeights;
190  mutable MetricValueArrayType m_MetricValueArray;
191 };
192 
193 } //end namespace itk
194 
195 #ifndef ITK_MANUAL_INSTANTIATION
196 #include "itkObjectToObjectMultiMetricv4.hxx"
197 #endif
198 
199 #endif
200