ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkScalarRegionBasedLevelSetFunction.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 itkScalarRegionBasedLevelSetFunction_h
19 #define itkScalarRegionBasedLevelSetFunction_h
20 
25 
26 namespace itk
27 {
65 template< typename TInputImage, typename TFeatureImage, typename TSharedData >
66 class ITK_TEMPLATE_EXPORT ScalarRegionBasedLevelSetFunction:
67  public RegionBasedLevelSetFunction< TInputImage, TFeatureImage, TSharedData >
68 {
69 public:
74 
75  // itkNewMacro() is not provided since this is an abstract class.
76 
79 
80  itkStaticConstMacro(ImageDimension, unsigned int, TFeatureImage::ImageDimension);
81 
92 
93  typedef typename Superclass::FeatureImageType FeatureImageType;
94  typedef typename FeatureImageType::ConstPointer FeatureImageConstPointer;
98 
104  typedef typename Superclass::GlobalDataStruct GlobalDataStruct;
105  typedef typename Superclass::PixelType PixelType;
107 
110 
115 
116  typedef std::list< unsigned int > ListPixelType;
117  typedef typename ListPixelType::const_iterator ListPixelConstIterator;
118  typedef typename ListPixelType::iterator ListPixelIterator;
121 
126  void UpdatePixel(const unsigned int & idx,
128  InputPixelType & newValue,
129  bool & status);
130 
131 protected:
134 
135  ScalarValueType ComputeOverlapParameters(const FeatureIndexType & featIndex,
136  ScalarValueType & product) ITK_OVERRIDE;
137 
138  // update the background and foreground constants for pixel updates
139  // Called only when sparse filters are used to prevent iteration through the
140  // entire image
141  virtual void UpdateSharedDataInsideParameters(const unsigned int & iId,
142  const FeaturePixelType & iVal, const ScalarValueType & iChange) = 0;
143 
144  virtual void UpdateSharedDataOutsideParameters(const unsigned int & iId,
145  const FeaturePixelType & iVal, const ScalarValueType & iChange) = 0;
146 
147 private:
148  ITK_DISALLOW_COPY_AND_ASSIGN(ScalarRegionBasedLevelSetFunction);
149 };
150 }
151 
152 #ifndef ITK_MANUAL_INSTANTIATION
153 #include "itkScalarRegionBasedLevelSetFunction.hxx"
154 #endif
155 
156 #endif
RegionBasedLevelSetFunction< TInputImage, TFeatureImage, TSharedData > Superclass
ImageRegionIteratorWithIndex< InputImageType > ImageIteratorType
Simulate a standard C array with copy semnatics.
Definition: itkFixedArray.h:50
A multi-dimensional iterator templated over image type that walks an image region and is specialized ...
Image< ListPixelType, itkGetStaticConstMacro(ImageDimension) > ListImageType
A multi-dimensional iterator templated over image type that walks a region of pixels.
A multi-dimensional iterator templated over image type that walks pixels within a region and is speci...
LevelSet function that computes a speed image based on regional integrals.
Superclass::InputImageConstPointer InputImageConstPointer
ImageRegionConstIteratorWithIndex< InputImageType > ConstImageIteratorType
ImageRegionConstIterator< FeatureImageType > ConstFeatureIteratorType
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.
Templated n-dimensional image class.
Definition: itkImage.h:75
LevelSet function that computes a speed image based on regional integrals.
ImageRegionIteratorWithIndex< FeatureImageType > FeatureImageIteratorType