ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkLabeledPointSetToPointSetMetricv4.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 __itkLabeledPointSetToPointSetMetricv4_h
19 #define __itkLabeledPointSetToPointSetMetricv4_h
20 
22 
23 #include <vector>
24 
25 namespace itk
26 {
52 template<class TFixedPointSet, class TMovingPointSet = TFixedPointSet>
54  public PointSetToPointSetMetricv4<TFixedPointSet, TMovingPointSet>
55 {
56 public:
57 
63 
65  itkNewMacro( Self );
66 
69 
70  typedef TFixedPointSet FixedPointSetType;
71  typedef typename FixedPointSetType::Pointer FixedPointSetPointer;
72  typedef TMovingPointSet MovingPointSetType;
73  typedef typename MovingPointSetType::Pointer MovingPointSetPointer;
74 
76  typedef typename Superclass::MeasureType MeasureType;
77  typedef typename Superclass::DerivativeType DerivativeType;
78  typedef typename Superclass::LocalDerivativeType LocalDerivativeType;
79  typedef typename Superclass::PointType PointType;
80  typedef typename Superclass::PointIdentifier PointIdentifier;
81 
82  typedef typename Superclass::PixelType LabelType;
83  typedef std::vector<LabelType> LabelSetType;
84 
87 
92  virtual void Initialize( void ) throw ( ExceptionObject );
93 
98  virtual MeasureType GetLocalNeighborhoodValue( const PointType &, const LabelType & ) const;
99 
104  virtual void GetLocalNeighborhoodValueAndDerivative( const PointType &,
105  MeasureType &, LocalDerivativeType &, const LabelType & ) const;
106 
111  itkSetObjectMacro( PointSetMetric, PointSetMetricType );
112  itkGetModifiableObjectMacro(PointSetMetric, PointSetMetricType );
114 
118  itkConceptMacro( LabelTypeIsInteger, ( Concept::IsInteger<LabelType> ) );
119 
120 protected:
122  virtual ~LabeledPointSetToPointSetMetricv4();
123 
125  void PrintSelf( std::ostream & os, Indent indent ) const;
126 
127 private:
128  LabeledPointSetToPointSetMetricv4(const Self &); //purposely not implemented
129  void operator=(const Self &); //purposely not implemented
130 
135  void DetermineCommonPointSetLabels();
136 
141  FixedPointSetPointer GetLabeledFixedPointSet( const LabelType ) const;
142 
147  MovingPointSetPointer GetLabeledMovingPointSet( const LabelType ) const;
148 
149  PointSetMetricPointer m_PointSetMetric;
150  std::vector<PointSetMetricPointer> m_PointSetMetricClones;
151 
152  LabelSetType m_FixedPointSetLabels;
153  LabelSetType m_MovingPointSetLabels;
154  LabelSetType m_CommonPointSetLabels;
155 
156 };
157 } // end namespace itk
158 
159 #ifndef ITK_MANUAL_INSTANTIATION
160 #include "itkLabeledPointSetToPointSetMetricv4.hxx"
161 #endif
162 
163 #endif
164