ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkScalarChanAndVeseSparseLevelSetImageFilter.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 itkScalarChanAndVeseSparseLevelSetImageFilter_h
19 #define itkScalarChanAndVeseSparseLevelSetImageFilter_h
20 
24 
25 namespace itk
26 {
63 template< typename TInputImage, typename TFeatureImage, typename TOutputImage,
64  typename TFunction = ScalarChanAndVeseLevelSetFunction< TInputImage, TFeatureImage >,
65  class TSharedData = typename TFunction::SharedDataType,
66  typename TIdCell = unsigned int >
68  public MultiphaseSparseFiniteDifferenceImageFilter< TInputImage, TFeatureImage,
69  TOutputImage, TFunction, TIdCell >
70 {
71 public:
74  TFeatureImage, TOutputImage, TFunction, TIdCell >;
77 
79  itkNewMacro(Self);
80 
84 
85  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
86 
88  using InputImageType = typename Superclass::InputImageType;
89  using InputImagePointer = typename Superclass::InputImagePointer;
90  using InputPointType = typename Superclass::InputPointType;
91  using ValueType = typename Superclass::ValueType;
92  using InputSpacingType = typename Superclass::InputSpacingType;
93 
94  using FeatureImageType = TFeatureImage;
95  using FeatureImagePointer = typename FeatureImageType::Pointer;
96  using FeaturePixelType = typename FeatureImageType::PixelType;
100 
102  using OutputImageType = TOutputImage;
104  using OutputPixelType = typename OutputImageType::PixelType;
105 
106  using TimeStepType = typename Superclass::TimeStepType;
107  using FiniteDifferenceFunctionType = typename Superclass::FiniteDifferenceFunctionType;
108 
109  using IdCellType = typename Superclass::IdCellType;
110 
111  using FunctionType = TFunction;
112  using FunctionPtr = typename FunctionType::Pointer;
113 
114  using SharedDataType = TSharedData;
115  using SharedDataPointer = typename SharedDataType::Pointer;
116 
119 
120 #ifdef ITK_USE_CONCEPT_CHECKING
121  // Begin concept checking
122  itkConceptMacro( OutputHasNumericTraitsCheck,
124  // End concept checking
125 #endif
126 
129  virtual void SetFeatureImage(const FeatureImagePointer f)
130  {
131  this->SetInput(f);
132  }
133 
134 protected:
136  {
137  this->SetNumberOfLayers(2); // Narrow-band usage
138  this->m_SharedData = SharedDataType::New();
139  }
140 
142 
144 
145  void Initialize() override;
146 
147  void InitializeIteration() override;
148 
149  void UpdatePixel(unsigned int functionIndex,
150  unsigned int idx, NeighborhoodIterator< InputImageType > & iterator,
151  ValueType & newValue, bool & status) override;
152 };
153 } //end namespace itk
154 
155 #ifndef ITK_MANUAL_INSTANTIATION
156 #include "itkScalarChanAndVeseSparseLevelSetImageFilter.hxx"
157 #endif
158 
159 #endif
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
Sparse implementation of the Chan and Vese multiphase level set image filter.
TOutputImage OutputImageType
signed long IndexValueType
Definition: itkIntTypes.h:90
typename Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
This class implements a finite difference partial differential equation solver for evolving surfaces ...
Extract a region of interest from the input image.
#define itkConceptMacro(name, concept)
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.