ITK  4.13.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 ITK_TEMPLATE_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() ITK_OVERRIDE {}
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  ITK_DISALLOW_COPY_AND_ASSIGN(Path);
121 
122  // These "constants" are initialized in the constructor
123  OffsetType m_ZeroOffset; // = 0 for all dimensions
124  IndexType m_ZeroIndex; // = 0 for all dimensions
125 };
126 } // namespace itk
127 
128 #ifndef ITK_MANUAL_INSTANTIATION
129 #include "itkPath.hxx"
130 #endif
131 
132 #endif
Offset< VDimension > OffsetType
Definition: itkPath.h:76
IndexType m_ZeroIndex
Definition: itkPath.h:124
virtual InputType StartOfInput() const
Definition: itkPath.h:81
DataObject Superclass
Definition: itkPath.h:58
TOutput OutputType
Definition: itkPath.h:72
Represent a path through ND Space.
Definition: itkPath.h:53
Index< VDimension > IndexType
Definition: itkPath.h:75
~Path() override
Definition: itkPath.h:112
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
TInput InputType
Definition: itkPath.h:66
OffsetType m_ZeroOffset
Definition: itkPath.h:117
Base class for all data objects in ITK.
Path Self
Definition: itkPath.h:57