ITK  6.0.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  * https://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_MOVE(Path);
58 
60  using Self = Path;
64 
66  static constexpr unsigned int PathDimension = VDimension;
67 
69  itkOverrideGetNameOfClassMacro(Path);
70 
72  using InputType = TInput;
73 
75  using OutputType = TOutput;
76 
80 
84  virtual inline InputType
85  StartOfInput() const
86  {
87  return InputType{};
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::Index
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:68
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:158
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:66
itk::Path::StartOfInput
virtual InputType StartOfInput() const
Definition: itkPath.h:85
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: itkAnatomicalOrientation.h:29
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:61
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