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