ITK  5.2.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  * 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 {
66 template <typename TInputImage,
67  typename TFeatureImage,
68  typename TOutputImage,
69  typename TFunction = ScalarChanAndVeseLevelSetFunction<TInputImage, TFeatureImage>,
70  class TSharedData = typename TFunction::SharedDataType,
71  typename TIdCell = unsigned int>
73  : public MultiphaseSparseFiniteDifferenceImageFilter<TInputImage, TFeatureImage, TOutputImage, TFunction, TIdCell>
74 {
75 public:
77  using Superclass =
81 
83  itkNewMacro(Self);
84 
87 
88  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
89 
91  using InputImageType = typename Superclass::InputImageType;
92  using InputImagePointer = typename Superclass::InputImagePointer;
93  using InputPointType = typename Superclass::InputPointType;
94  using ValueType = typename Superclass::ValueType;
95  using InputSpacingType = typename Superclass::InputSpacingType;
96 
97  using FeatureImageType = TFeatureImage;
98  using FeatureImagePointer = typename FeatureImageType::Pointer;
99  using FeaturePixelType = typename FeatureImageType::PixelType;
103 
105  using OutputImageType = TOutputImage;
107  using OutputPixelType = typename OutputImageType::PixelType;
108 
109  using TimeStepType = typename Superclass::TimeStepType;
110  using FiniteDifferenceFunctionType = typename Superclass::FiniteDifferenceFunctionType;
111 
112  using IdCellType = typename Superclass::IdCellType;
113 
114  using FunctionType = TFunction;
115  using FunctionPtr = typename FunctionType::Pointer;
116 
117  using SharedDataType = TSharedData;
118  using SharedDataPointer = typename SharedDataType::Pointer;
119 
122 
123 #ifdef ITK_USE_CONCEPT_CHECKING
124  // Begin concept checking
125  itkConceptMacro(OutputHasNumericTraitsCheck, (Concept::HasNumericTraits<OutputPixelType>));
126  // End concept checking
127 #endif
128 
131  virtual void
133  {
134  this->SetInput(f);
135  }
136 
137 protected:
139  {
140  this->SetNumberOfLayers(2); // Narrow-band usage
141  this->m_SharedData = SharedDataType::New();
142  }
143 
144  ~ScalarChanAndVeseSparseLevelSetImageFilter() override = default;
145 
147 
148  void
149  Initialize() override;
150 
151  void
152  InitializeIteration() override;
153 
154  void
155  UpdatePixel(unsigned int functionIndex,
156  unsigned int idx,
158  ValueType & newValue,
159  bool & status) override;
160 };
161 } // end namespace itk
162 
163 #ifndef ITK_MANUAL_INSTANTIATION
164 # include "itkScalarChanAndVeseSparseLevelSetImageFilter.hxx"
165 #endif
166 
167 #endif
itkScalarChanAndVeseLevelSetFunction.h
itk::ScalarChanAndVeseSparseLevelSetImageFilter::IndexType
typename OutputImageType::IndexType IndexType
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:106
itk::ScalarChanAndVeseSparseLevelSetImageFilter::FeatureIndexType
typename FeatureImageType::IndexType FeatureIndexType
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:100
itk::MultiphaseSparseFiniteDifferenceImageFilter::InputImageType
typename Superclass::InputImageType InputImageType
Definition: itkMultiphaseSparseFiniteDifferenceImageFilter.h:207
itk::MultiphaseSparseFiniteDifferenceImageFilter::FeatureRegionType
typename Superclass::FeatureRegionType FeatureRegionType
Definition: itkMultiphaseSparseFiniteDifferenceImageFilter.h:222
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:714
itk::ScalarChanAndVeseSparseLevelSetImageFilter::FeaturePixelType
typename FeatureImageType::PixelType FeaturePixelType
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:99
itk::ScalarChanAndVeseSparseLevelSetImageFilter::m_SharedData
SharedDataPointer m_SharedData
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:146
itk::ScalarChanAndVeseSparseLevelSetImageFilter::FeatureIndexValueType
typename FeatureIndexType::IndexValueType FeatureIndexValueType
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:101
itk::ScalarChanAndVeseSparseLevelSetImageFilter::ROIFilterPointer
typename ROIFilterType::Pointer ROIFilterPointer
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:121
itk::ScalarChanAndVeseSparseLevelSetImageFilter::FunctionType
TFunction FunctionType
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:114
itk::SmartPointer< Self >
itk::ScalarChanAndVeseSparseLevelSetImageFilter::SetFeatureImage
virtual void SetFeatureImage(const FeatureImagePointer f)
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:132
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::MultiphaseSparseFiniteDifferenceImageFilter::InputImagePointer
typename Superclass::InputImagePointer InputImagePointer
Definition: itkMultiphaseSparseFiniteDifferenceImageFilter.h:208
itk::ScalarChanAndVeseSparseLevelSetImageFilter
Sparse implementation of the Chan and Vese multiphase level set image filter.
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:72
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::ScalarChanAndVeseSparseLevelSetImageFilter::ScalarChanAndVeseSparseLevelSetImageFilter
ScalarChanAndVeseSparseLevelSetImageFilter()
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:138
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:181
itk::MultiphaseSparseFiniteDifferenceImageFilter::FeatureImagePointer
typename Superclass::FeatureImagePointer FeatureImagePointer
Definition: itkMultiphaseSparseFiniteDifferenceImageFilter.h:221
itk::ScalarChanAndVeseSparseLevelSetImageFilter::FunctionPtr
typename FunctionType::Pointer FunctionPtr
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:115
itkMultiphaseSparseFiniteDifferenceImageFilter.h
itk::MultiphaseSparseFiniteDifferenceImageFilter::OutputPixelType
typename Superclass::OutputPixelType OutputPixelType
Definition: itkMultiphaseSparseFiniteDifferenceImageFilter.h:232
itk::MultiphaseSparseFiniteDifferenceImageFilter::InputPointType
typename Superclass::InputPointType InputPointType
Definition: itkMultiphaseSparseFiniteDifferenceImageFilter.h:215
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:117
itkRegionOfInterestImageFilter.h
itk::MultiphaseSparseFiniteDifferenceImageFilter::FeatureImageType
typename Superclass::FeatureImageType FeatureImageType
Definition: itkMultiphaseSparseFiniteDifferenceImageFilter.h:219
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk::MultiphaseSparseFiniteDifferenceImageFilter::IdCellType
typename Superclass::IdCellType IdCellType
Definition: itkMultiphaseSparseFiniteDifferenceImageFilter.h:235
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::MultiphaseSparseFiniteDifferenceImageFilter::TimeStepType
typename Superclass::TimeStepType TimeStepType
Definition: itkMultiphaseSparseFiniteDifferenceImageFilter.h:204
itk::IndexValueType
signed long IndexValueType
Definition: itkIntTypes.h:90
itk::MultiphaseSparseFiniteDifferenceImageFilter::InputSpacingType
typename Superclass::InputSpacingType InputSpacingType
Definition: itkMultiphaseSparseFiniteDifferenceImageFilter.h:216
itk::RegionOfInterestImageFilter
Extract a region of interest from the input image.
Definition: itkRegionOfInterestImageFilter.h:54
itk::MultiphaseSparseFiniteDifferenceImageFilter::FiniteDifferenceFunctionType
typename Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
Definition: itkMultiphaseSparseFiniteDifferenceImageFilter.h:237
itk::MultiphaseSparseFiniteDifferenceImageFilter::ValueType
typename InputImageType::ValueType ValueType
Definition: itkMultiphaseSparseFiniteDifferenceImageFilter.h:234
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::ScalarChanAndVeseSparseLevelSetImageFilter::SharedDataPointer
typename SharedDataType::Pointer SharedDataPointer
Definition: itkScalarChanAndVeseSparseLevelSetImageFilter.h:118