ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkLevelSetVelocityNeighborhoodExtractor.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 itkLevelSetVelocityNeighborhoodExtractor_h
19 #define itkLevelSetVelocityNeighborhoodExtractor_h
20 
22 
23 namespace itk
24 {
53 template<
54  typename TLevelSet,
55  typename TAuxValue,
56  unsigned int VAuxDimension = 1
57  >
58 class ITK_TEMPLATE_EXPORT LevelSetVelocityNeighborhoodExtractor:
59  public LevelSetNeighborhoodExtractor< TLevelSet >
60 {
61 public:
62  ITK_DISALLOW_COPY_AND_ASSIGN(LevelSetVelocityNeighborhoodExtractor);
63 
69 
71  itkNewMacro(Self);
72 
76 
79 
81  static constexpr unsigned int SetDimension = LevelSetType::SetDimension;
82 
85 
87  using AuxVarType =
95 
97  void SetAuxImage(const AuxImageType *ptr, unsigned int idx = 0)
98  {
99  if ( idx < VAuxDimension && m_AuxImage[idx] != ptr )
100  {
101  m_AuxImage[idx] = ptr;
102  }
103  this->Modified();
104  }
106 
108  AuxImageConstPointer GetAuxImage(unsigned int idx = 0)
109  {
110  if ( idx >= VAuxDimension )
111  {
112  return nullptr;
113  }
114  else
115  {
116  return m_AuxImage[idx];
117  }
118  }
120 
123  itkGetModifiableObjectMacro(AuxInsideValues, AuxValueContainer);
124 
127  itkGetModifiableObjectMacro(AuxOutsideValues, AuxValueContainer);
128 
129 protected:
131  ~LevelSetVelocityNeighborhoodExtractor() override = default;
132  void PrintSelf(std::ostream & os, Indent indent) const override;
133 
134  void Initialize() override;
135 
136  double CalculateDistance(Index & index) override;
137 
138 private:
139  typename AuxValueContainer::Pointer m_AuxInsideValues;
140  typename AuxValueContainer::Pointer m_AuxOutsideValues;
141  AuxImageConstPointer m_AuxImage[VAuxDimension];
142 };
143 } // namespace itk
144 
145 #ifndef ITK_MANUAL_INSTANTIATION
146 #include "itkLevelSetVelocityNeighborhoodExtractor.hxx"
147 #endif
148 
149 #endif
Level set auxiliary variables type information.
Definition: itkLevelSet.h:89
Locate pixels of a particular level set.
void SetAuxImage(const AuxImageType *ptr, unsigned int idx=0)
Light weight base class for most itk classes.
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:66
typename AuxImageType::Pointer AuxImagePointer
Definition: itkLevelSet.h:114
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
typename AuxVarType::AuxImageConstPointer AuxImageConstPointer
typename AuxImageType::ConstPointer AuxImageConstPointer
Definition: itkLevelSet.h:115
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:60
Level set type information.
Definition: itkLevelSet.h:40
Templated n-dimensional image class.
Definition: itkImage.h:75