ITK  6.0.0
Insight Toolkit
itkReinitializeLevelSetImageFilter.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 itkReinitializeLevelSetImageFilter_h
19 #define itkReinitializeLevelSetImageFilter_h
20 
23 
24 namespace itk
25 {
54 template <typename TLevelSet>
55 class ITK_TEMPLATE_EXPORT ReinitializeLevelSetImageFilter : public ImageToImageFilter<TLevelSet, TLevelSet>
56 {
57 public:
58  ITK_DISALLOW_COPY_AND_MOVE(ReinitializeLevelSetImageFilter);
59 
65 
67  itkNewMacro(Self);
68 
70  itkOverrideGetNameOfClassMacro(ReinitializeLevelSetImageFilter);
71 
78  using NodeType = typename LevelSetType::NodeType;
81 
83  static constexpr unsigned int SetDimension = LevelSetType::SetDimension;
84 
87  itkSetMacro(LevelSetValue, double);
88  itkGetConstMacro(LevelSetValue, double);
93  itkSetMacro(NarrowBanding, bool);
94  itkGetConstMacro(NarrowBanding, bool);
95  itkBooleanMacro(NarrowBanding);
99  itkSetClampMacro(InputNarrowBandwidth, double, 0.0, NumericTraits<double>::max());
100  itkGetConstMacro(InputNarrowBandwidth, double);
104  itkSetClampMacro(OutputNarrowBandwidth, double, 0.0, NumericTraits<double>::max());
105  itkGetConstMacro(OutputNarrowBandwidth, double);
110  void
111  SetNarrowBandwidth(double value)
112  {
113  this->SetInputNarrowBandwidth(value);
114  this->SetOutputNarrowBandwidth(value);
115  }
119  void
120  SetInputNarrowBand(NodeContainer * ptr);
121 
122  NodeContainerPointer
124  {
125  return m_InputNarrowBand;
126  }
127 
129  NodeContainerPointer
131  {
132  return m_OutputNarrowBand;
133  }
134 
135 #ifdef ITK_USE_CONCEPT_CHECKING
136  // Begin concept checking
137  itkConceptMacro(LevelSetDoubleAdditiveOperatorsCheck, (Concept::AdditiveOperators<PixelType, double>));
138  itkConceptMacro(LevelSetOStreamWritableCheck, (Concept::OStreamWritable<PixelType>));
139  // End concept checking
140 #endif
141 
142 protected:
144  ~ReinitializeLevelSetImageFilter() override = default;
145  void
146  PrintSelf(std::ostream & os, Indent indent) const override;
147 
152 
153  void
154  GenerateData() override;
155 
156  virtual void
157  GenerateDataFull();
158 
159  virtual void
160  GenerateDataNarrowBand();
161 
162  virtual void
163  AllocateOutput();
164 
165  void
166  GenerateInputRequestedRegion() override;
167 
168  void
169  EnlargeOutputRequestedRegion(DataObject *) override;
170 
171  void
173  {
174  m_OutputNarrowBand = ptr;
175  }
176 
177 private:
178  double m_LevelSetValue{};
179 
180  typename LocatorType::Pointer m_Locator{};
181 
183 
184  bool m_NarrowBanding{};
185  double m_InputNarrowBandwidth{};
186  double m_OutputNarrowBandwidth{};
187  NodeContainerPointer m_InputNarrowBand{};
188  NodeContainerPointer m_OutputNarrowBand{};
189 };
190 } // namespace itk
191 
192 #ifndef ITK_MANUAL_INSTANTIATION
193 # include "itkReinitializeLevelSetImageFilter.hxx"
194 #endif
195 
196 #endif
itk::ReinitializeLevelSetImageFilter::LevelSetConstPointer
typename LevelSetType::LevelSetConstPointer LevelSetConstPointer
Definition: itkReinitializeLevelSetImageFilter.h:76
itk::ReinitializeLevelSetImageFilter::SetOutputNarrowBand
void SetOutputNarrowBand(NodeContainer *ptr)
Definition: itkReinitializeLevelSetImageFilter.h:172
itk::LevelSetTypeDefault
Level set type information.
Definition: itkLevelSet.h:40
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:638
itk::ReinitializeLevelSetImageFilter::GetOutputNarrowBand
NodeContainerPointer GetOutputNarrowBand() const
Definition: itkReinitializeLevelSetImageFilter.h:130
itk::ReinitializeLevelSetImageFilter::NodeContainerPointer
typename LevelSetType::NodeContainerPointer NodeContainerPointer
Definition: itkReinitializeLevelSetImageFilter.h:80
itk::detail::VectorContainer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Definition: itkVectorContainer.h:51
itk::ReinitializeLevelSetImageFilter::NodeType
typename LevelSetType::NodeType NodeType
Definition: itkReinitializeLevelSetImageFilter.h:78
itk::ReinitializeLevelSetImageFilter::PixelType
typename LevelSetType::PixelType PixelType
Definition: itkReinitializeLevelSetImageFilter.h:77
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::LevelSetNode
Represent a node in a level set.
Definition: itkLevelSetNode.h:45
itkFastMarchingImageFilter.h
itk::ReinitializeLevelSetImageFilter::SetNarrowBandwidth
void SetNarrowBandwidth(double value)
Definition: itkReinitializeLevelSetImageFilter.h:111
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::LevelSetTypeDefault::LevelSetPointer
typename TLevelSet::Pointer LevelSetPointer
Definition: itkLevelSet.h:51
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::FastMarchingImageFilter
Solve an Eikonal equation using Fast Marching.
Definition: itkFastMarchingImageFilter.h:135
itk::LevelSetTypeDefault::NodeContainerPointer
typename NodeContainer::Pointer NodeContainerPointer
Definition: itkLevelSet.h:64
itk::ReinitializeLevelSetImageFilter::NodeContainer
typename LevelSetType::NodeContainer NodeContainer
Definition: itkReinitializeLevelSetImageFilter.h:79
itk::LevelSetTypeDefault::LevelSetConstPointer
typename TLevelSet::ConstPointer LevelSetConstPointer
Definition: itkLevelSet.h:52
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:60
itk::LevelSetTypeDefault::LevelSetImageType
TLevelSet LevelSetImageType
Definition: itkLevelSet.h:45
itk::Concept::AdditiveOperators
Definition: itkConceptChecking.h:360
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk::ReinitializeLevelSetImageFilter::LevelSetImageType
typename LevelSetType::LevelSetImageType LevelSetImageType
Definition: itkReinitializeLevelSetImageFilter.h:74
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ReinitializeLevelSetImageFilter::LevelSetPointer
typename LevelSetType::LevelSetPointer LevelSetPointer
Definition: itkReinitializeLevelSetImageFilter.h:75
itk::ReinitializeLevelSetImageFilter::GetInputNarrowBand
NodeContainerPointer GetInputNarrowBand() const
Definition: itkReinitializeLevelSetImageFilter.h:123
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::LevelSetTypeDefault::PixelType
typename TLevelSet::PixelType PixelType
Definition: itkLevelSet.h:55
itkLevelSetNeighborhoodExtractor.h
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293
itk::LevelSetNeighborhoodExtractor
Locate pixels of a particular level set.
Definition: itkLevelSetNeighborhoodExtractor.h:57
itk::ReinitializeLevelSetImageFilter
Reinitialize the level set to the signed distance function.
Definition: itkReinitializeLevelSetImageFilter.h:55