ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkPath.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 __itkPath_h
19 #define __itkPath_h
20 
21 #include "itkDataObject.h"
22 #include "itkIndex.h"
23 #include "itkNumericTraits.h"
24 
25 namespace itk
26 {
52 template< class TInput, class TOutput, unsigned int VDimension >
53 class ITK_EXPORT Path: public DataObject
54 {
55 public:
57  typedef Path Self;
61 
63  itkStaticConstMacro(PathDimension, unsigned int, VDimension);
64 
66  itkTypeMacro(Path, FunctionBase);
67 
69  typedef TInput InputType;
70 
72  typedef TOutput OutputType;
73 
77 
81  virtual inline InputType StartOfInput() const
82  {
84  }
85 
88  virtual inline InputType EndOfInput() const
89  {
91  }
92 
95  virtual OutputType Evaluate(const InputType & input) const = 0;
96 
98  virtual IndexType EvaluateToIndex(const InputType & input) const = 0;
99 
108  virtual OffsetType IncrementInput(InputType & input) const = 0;
109 
110 protected:
111  Path();
112  ~Path(){}
113 
114  void PrintSelf(std::ostream & os, Indent indent) const;
115 
116  itkGetConstMacro(ZeroOffset, OffsetType);
117  itkGetConstMacro(ZeroIndex, IndexType);
118 
119 private:
120  Path(const Self &); //purposely not implemented
121  void operator=(const Self &); //purposely not implemented
122 
123  // These "constants" are initialized in the constructor
124  OffsetType m_ZeroOffset; // = 0 for all dimensions
125  IndexType m_ZeroIndex; // = 0 for all dimensions
126 };
127 } // namespace itk
128 
129 #ifndef ITK_MANUAL_INSTANTIATION
130 #include "itkPath.hxx"
131 #endif
132 
133 #endif
134