ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkMatchCardinalityImageToImageMetric.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 itkMatchCardinalityImageToImageMetric_h
19 #define itkMatchCardinalityImageToImageMetric_h
20 
26 #include "itkImageToImageMetric.h"
27 #include "itkPoint.h"
28 #include <vector>
29 
30 namespace itk
31 {
66 template< typename TFixedImage, typename TMovingImage >
68  public ImageToImageMetric< TFixedImage, TMovingImage >
69 {
70 public:
71 
77 
79  itkNewMacro(Self);
80 
83 
85  typedef typename Superclass::RealType RealType;
91 
99 
102  DerivativeType & derivative) const ITK_OVERRIDE
103  {
104  itkWarningMacro(<< "This metric does not provide metric derivatives.");
106  }
108 
115  MeasureType GetValue(const TransformParametersType & parameters) const ITK_OVERRIDE;
116 
123  itkSetMacro(MeasureMatches, bool);
124  itkBooleanMacro(MeasureMatches);
125  itkGetConstMacro(MeasureMatches, bool);
127 
129  MultiThreader * GetMultiThreader()
130  { return m_Threader; }
131 
132 protected:
135  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
136 
143 
148  virtual
149  void ThreadedGetValue(const FixedImageRegionType & outputRegionForThread,
150  ThreadIdType threadId);
151 
157  virtual
159 
163  static ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg);
164 
167  struct ThreadStruct {
169  };
170 
171 private:
172  MatchCardinalityImageToImageMetric(const Self &) ITK_DELETE_FUNCTION;
173  void operator=(const Self &) ITK_DELETE_FUNCTION;
174 
176  std::vector< MeasureType > m_ThreadMatches;
178 
181  MultiThreader::Pointer m_Threader;
182 };
183 } // end namespace itk
184 
185 #ifndef ITK_MANUAL_INSTANTIATION
186 #include "itkMatchCardinalityImageToImageMetric.hxx"
187 #endif
188 
189 #endif
Array class with size defined at construction time.
Definition: itkArray.h:50
Light weight base class for most itk classes.
virtual ThreadIdType SplitFixedRegion(ThreadIdType i, int num, FixedImageRegionType &splitRegion)
TransformType::Pointer TransformPointer
NumericTraits< MovingImagePixelType >::RealType RealType
Superclass::DerivativeType DerivativeType
MovingImageType::ConstPointer MovingImageConstPointer
unsigned long SizeValueType
Definition: itkIntTypes.h:143
#define ITK_THREAD_RETURN_TYPE
Computes similarity between two objects to be registered.
ImageToImageMetric< TFixedImage, TMovingImage > Superclass
void PrintSelf(std::ostream &os, Indent indent) const override
MeasureType GetNonconstValue(const TransformParametersType &parameters)
virtual void ThreadedGetValue(const FixedImageRegionType &outputRegionForThread, ThreadIdType threadId)
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
TransformType::JacobianType TransformJacobianType
static ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
FixedImageType::ConstPointer FixedImageConstPointer
Superclass::MovingImageConstPointer MovingImageConstPointer
MeasureType GetValue(const TransformParametersType &parameters) const override
Define additional traits for native types such as int or float.
Superclass::MeasureType MeasureType
CovariantVector< RealType, itkGetStaticConstMacro(MovingImageDimension) > GradientPixelType
Transform< CoordinateRepresentationType, itkGetStaticConstMacro(MovingImageDimension), itkGetStaticConstMacro(FixedImageDimension) > TransformType
Computes similarity between regions of two images.
void GetDerivative(const TransformParametersType &, DerivativeType &derivative) const override
TransformType::ParametersType TransformParametersType
FixedImageType::RegionType FixedImageRegionType
Superclass::TransformParametersType TransformParametersType