ITK  4.4.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  typedef typename Superclass::FixedTransformType FixedTransformType;
120 
125  typedef std::deque<MetricBasePointer> MetricQueueType;
126 
127  typedef typename DerivativeType::ValueType WeightValueType;
130 
131  itkSetMacro(MetricWeights,WeightsArrayType);
132  itkGetMacro(MetricWeights,WeightsArrayType);
133 
135  void AddMetric( MetricType* metric );
136 
138  void ClearMetricQueue( void );
139 
141  SizeValueType GetNumberOfMetrics() const;
142 
143  void Initialize(void) throw ( itk::ExceptionObject );
144 
146  virtual void SetMovingTransform( MovingTransformType * );
147 
149  virtual void SetFixedTransform( FixedTransformType * );
150 
155  MeasureType GetValue() const;
156 
157  virtual void GetDerivative( DerivativeType & ) const;
158 
165  void GetValueAndDerivative(MeasureType & value, DerivativeType & derivative) const;
166 
169  MetricValueArrayType GetValueArray() const;
170 
173  MeasureType GetWeightedValue() const;
174 
176  const MetricQueueType & GetMetricQueue() const;
177 
178  virtual bool SupportsArbitraryVirtualDomainSamples( void ) const;
179 
180 protected:
181 
183  virtual ~ObjectToObjectMultiMetricv4();
184  void PrintSelf(std::ostream & os, Indent indent) const;
185 
186 private:
187 
188  //purposely not implemented
189  ObjectToObjectMultiMetricv4(const Self &);
190  void operator=(const Self &);
191 
192  MetricQueueType m_MetricQueue;
193  WeightsArrayType m_MetricWeights;
194  mutable MetricValueArrayType m_MetricValueArray;
195 };
196 
197 } //end namespace itk
198 
199 #ifndef ITK_MANUAL_INSTANTIATION
200 #include "itkObjectToObjectMultiMetricv4.hxx"
201 #endif
202 
203 #endif
204