ITK  5.0.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:
56  ITK_DISALLOW_COPY_AND_ASSIGN(Path);
57 
59  using Self = Path;
63 
65  static constexpr unsigned int PathDimension = VDimension;
66 
68  itkTypeMacro(Path, FunctionBase);
69 
71  using InputType = TInput;
72 
74  using OutputType = TOutput;
75 
79 
83  virtual inline InputType StartOfInput() const
84  {
86  }
87 
90  virtual inline InputType EndOfInput() const
91  {
93  }
94 
97  virtual OutputType Evaluate(const InputType & input) const = 0;
98 
100  virtual IndexType EvaluateToIndex(const InputType & input) const = 0;
101 
110  virtual OffsetType IncrementInput(InputType & input) const = 0;
111 
112 protected:
113  Path();
114  ~Path() override = default;
115 
116  void PrintSelf(std::ostream & os, Indent indent) const override;
117 
118  itkGetConstMacro(ZeroOffset, OffsetType);
119  itkGetConstMacro(ZeroIndex, IndexType);
120 
121 private:
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
IndexType m_ZeroIndex
Definition: itkPath.h:124
Define numeric traits for std::vector.
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:66
virtual InputType StartOfInput() const
Definition: itkPath.h:83
class ITK_FORWARD_EXPORT DataObject
Definition: itkDataObject.h:41
Represent a path through ND Space.
Definition: itkPath.h:53
Base class for all ITK function objects.
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image...
Definition: itkOffset.h:67
virtual InputType EndOfInput() const
Definition: itkPath.h:90
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:60
OffsetType m_ZeroOffset
Definition: itkPath.h:119
Base class for all data objects in ITK.