ITK  5.2.0
Insight Toolkit
itkPath.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 {
53 template <typename TInput, typename TOutput, unsigned int VDimension>
54 class ITK_TEMPLATE_EXPORT Path : public DataObject
55 {
56 public:
57  ITK_DISALLOW_COPY_AND_ASSIGN(Path);
58 
60  using Self = Path;
64 
66  static constexpr unsigned int PathDimension = VDimension;
67 
69  itkTypeMacro(Path, FunctionBase);
70 
72  using InputType = TInput;
73 
75  using OutputType = TOutput;
76 
80 
84  virtual inline InputType
85  StartOfInput() const
86  {
88  }
89 
92  virtual inline InputType
93  EndOfInput() const
94  {
96  }
97 
100  virtual OutputType
101  Evaluate(const InputType & input) const = 0;
102 
104  virtual IndexType
105  EvaluateToIndex(const InputType & input) const = 0;
106 
115  virtual OffsetType
116  IncrementInput(InputType & input) const = 0;
117 
118 protected:
119  Path();
120  ~Path() override = default;
121 
122  void
123  PrintSelf(std::ostream & os, Indent indent) const override;
124 
125  itkGetConstMacro(ZeroOffset, OffsetType);
126  itkGetConstMacro(ZeroIndex, IndexType);
127 
128 private:
129  // These "constants" are initialized in the constructor
130  OffsetType m_ZeroOffset; // = 0 for all dimensions
131  IndexType m_ZeroIndex; // = 0 for all dimensions
132 };
133 } // namespace itk
134 
135 #ifndef ITK_MANUAL_INSTANTIATION
136 # include "itkPath.hxx"
137 #endif
138 
139 #endif
itk::Path::m_ZeroOffset
OffsetType m_ZeroOffset
Definition: itkPath.h:126
itk::Index
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:66
itk::Path::m_ZeroIndex
IndexType m_ZeroIndex
Definition: itkPath.h:131
itk::Path
Represent a path through ND Space.
Definition: itkPath.h:54
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itkDataObject.h
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::NumericTraits::OneValue
static T OneValue()
Definition: itkNumericTraits.h:156
itk::DataObject
class ITK_FORWARD_EXPORT DataObject
Definition: itkDataObject.h:42
itkIndex.h
itk::Offset
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image.
Definition: itkOffset.h:67
itk::Path::StartOfInput
virtual InputType StartOfInput() const
Definition: itkPath.h:85
itk::FunctionBase
Base class for all ITK function objects.
Definition: itkFunctionBase.h:44
itk::NumericTraits::ZeroValue
static T ZeroValue()
Definition: itkNumericTraits.h:148
itk::Path< TIndexValue, Index< VDimension >, VDimension >::InputType
TIndexValue InputType
Definition: itkPath.h:72
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
itkNumericTraits.h
itk::Path::EndOfInput
virtual InputType EndOfInput() const
Definition: itkPath.h:93
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293