ITK  4.3.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< class TInputImage, class TFeatureImage, class TSharedData >
67  public RegionBasedLevelSetFunction< TInputImage, TFeatureImage, TSharedData >
68 {
69 public:
74 
75  // itkNewMacro() is purposely not provided since this is an abstract class.
76 
79 
80  itkStaticConstMacro(ImageDimension, unsigned int, TFeatureImage::ImageDimension);
81 
92 
94  typedef typename FeatureImageType::ConstPointer FeatureImageConstPointer;
98 
104  typedef typename Superclass::GlobalDataStruct GlobalDataStruct;
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);
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  ScalarRegionBasedLevelSetFunction(const Self &); //purposely not implemented
149  void operator=(const Self &); //purposely not implemented
150 };
151 }
152 
153 #ifndef ITK_MANUAL_INSTANTIATION
154 #include "itkScalarRegionBasedLevelSetFunction.hxx"
155 #endif
156 
157 #endif
158