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 
25 namespace itk
26 {
63 template <typename TInputImage,
64  typename TFeatureImage,
65  typename TOutputImage,
66  typename TFunction = ScalarChanAndVeseLevelSetFunction<TInputImage, TFeatureImage>,
67  class TSharedData = typename TFunction::SharedDataType,
68  typename TIdCell = unsigned int>
70  : public MultiphaseSparseFiniteDifferenceImageFilter<TInputImage, TFeatureImage, TOutputImage, TFunction, TIdCell>
71 {
72 public:
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;
93 
94  using FeatureImageType = TFeatureImage;
96  using FeaturePixelType = typename FeatureImageType::PixelType;
100 
102  using OutputImageType = TOutputImage;
104  using OutputPixelType = typename OutputImageType::PixelType;
105 
106  using typename Superclass::TimeStepType;
107  using typename Superclass::FiniteDifferenceFunctionType;
108 
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
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 
141  ~ScalarChanAndVeseSparseLevelSetImageFilter() override = default;
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
itkScalarChanAndVeseLevelSetFunction.h
itk::ScalarChanAndVeseSparseLevelSetImageFilter::FeatureRegionType
typename FeatureImageType::RegionType FeatureRegionType
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:99
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::ScalarChanAndVeseSparseLevelSetImageFilter::IndexType
typename OutputImageType::IndexType IndexType
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:103
itk::ScalarChanAndVeseSparseLevelSetImageFilter::FeatureIndexType
typename FeatureImageType::IndexType FeatureIndexType
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:97
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:716
itk::ScalarChanAndVeseSparseLevelSetImageFilter::FeaturePixelType
typename FeatureImageType::PixelType FeaturePixelType
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:96
itk::ScalarChanAndVeseSparseLevelSetImageFilter::FeatureIndexValueType
typename FeatureIndexType::IndexValueType FeatureIndexValueType
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:98
itk::ScalarChanAndVeseSparseLevelSetImageFilter::ROIFilterPointer
typename ROIFilterType::Pointer ROIFilterPointer
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:118
itk::ScalarChanAndVeseSparseLevelSetImageFilter::FunctionType
TFunction FunctionType
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:111
itk::ScalarChanAndVeseSparseLevelSetImageFilter::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:104
itk::SmartPointer< Self >
itk::ScalarChanAndVeseSparseLevelSetImageFilter::SetFeatureImage
virtual void SetFeatureImage(const FeatureImagePointer f)
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:129
itk::IndexValueType
long IndexValueType
Definition: itkIntTypes.h:93
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ScalarChanAndVeseSparseLevelSetImageFilter
Sparse implementation of the Chan and Vese multiphase level set image filter.
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:69
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::ScalarChanAndVeseSparseLevelSetImageFilter::ScalarChanAndVeseSparseLevelSetImageFilter
ScalarChanAndVeseSparseLevelSetImageFilter()
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:135
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::MultiphaseSparseFiniteDifferenceImageFilter
This class implements a finite difference partial differential equation solver for evolving surfaces ...
Definition: itkMultiphaseSparseFiniteDifferenceImageFilter.h:178
itk::ScalarChanAndVeseSparseLevelSetImageFilter::FunctionPtr
typename FunctionType::Pointer FunctionPtr
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:112
itkMultiphaseSparseFiniteDifferenceImageFilter.h
itk::NeighborhoodIterator
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.
Definition: itkNeighborhoodIterator.h:212
itk::ScalarChanAndVeseSparseLevelSetImageFilter::SharedDataType
TSharedData SharedDataType
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:114
itkRegionOfInterestImageFilter.h
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
New
static Pointer New()
itk::RegionOfInterestImageFilter
Extract a region of interest from the input image.
Definition: itkRegionOfInterestImageFilter.h:54
itk::ScalarChanAndVeseSparseLevelSetImageFilter::FeatureImagePointer
typename FeatureImageType::Pointer FeatureImagePointer
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:95
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::ScalarChanAndVeseSparseLevelSetImageFilter::FeatureImageType
TFeatureImage FeatureImageType
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:94
itk::ScalarChanAndVeseSparseLevelSetImageFilter::SharedDataPointer
typename SharedDataType::Pointer SharedDataPointer
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:115