ITK  4.9.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< typename TInput, typename TOutput, unsigned int VDimension >
53 class 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  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
115 
116  itkGetConstMacro(ZeroOffset, OffsetType);
117  itkGetConstMacro(ZeroIndex, IndexType);
118 
119 private:
120  Path(const Self &) ITK_DELETE_FUNCTION;
121  void operator=(const Self &) ITK_DELETE_FUNCTION;
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
Offset< VDimension > OffsetType
Definition: itkPath.h:76
IndexType m_ZeroIndex
Definition: itkPath.h:125
virtual IndexType EvaluateToIndex(const InputType &input) const =0
virtual InputType StartOfInput() const
Definition: itkPath.h:81
DataObject Superclass
Definition: itkPath.h:58
static const unsigned int PathDimension
Definition: itkPath.h:63
TOutput OutputType
Definition: itkPath.h:72
Represent a path through ND Space.
Definition: itkPath.h:53
Index< VDimension > IndexType
Definition: itkPath.h:75
Base class for all ITK function objects.
SmartPointer< const Self > ConstPointer
Definition: itkPath.h:60
SmartPointer< Self > Pointer
Definition: itkPath.h:59
virtual InputType EndOfInput() const
Definition: itkPath.h:88
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual OutputType Evaluate(const InputType &input) const =0
virtual void PrintSelf(std::ostream &os, Indent indent) const override
TInput InputType
Definition: itkPath.h:66
OffsetType m_ZeroOffset
Definition: itkPath.h:124
Base class for all data objects in ITK.
virtual OffsetType IncrementInput(InputType &input) const =0
Path Self
Definition: itkPath.h:57