ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkScalarChanAndVeseSparseLevelSetImageFilter.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 __itkScalarChanAndVeseSparseLevelSetImageFilter_h
19 #define __itkScalarChanAndVeseSparseLevelSetImageFilter_h
20 
24 
25 namespace itk
26 {
63 template< class TInputImage, class TFeatureImage, class TOutputImage,
64  class TFunction = ScalarChanAndVeseLevelSetFunction< TInputImage, TFeatureImage >,
65  class TSharedData = typename TFunction::SharedDataType,
66  typename TIdCell = unsigned int >
68  public MultiphaseSparseFiniteDifferenceImageFilter< TInputImage, TFeatureImage,
69  TOutputImage, TFunction, TIdCell >
70 {
71 public:
74  TFeatureImage, TOutputImage, TFunction, TIdCell > Superclass;
77 
79  itkNewMacro(Self);
80 
84 
85  itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
86 
88  typedef typename Superclass::InputImageType InputImageType;
89  typedef typename Superclass::InputImagePointer InputImagePointer;
90  typedef typename Superclass::InputPointType InputPointType;
91  typedef typename Superclass::ValueType ValueType;
92  typedef typename Superclass::InputSpacingType InputSpacingType;
93 
94  typedef TFeatureImage FeatureImageType;
95  typedef typename FeatureImageType::Pointer FeatureImagePointer;
96  typedef typename FeatureImageType::PixelType FeaturePixelType;
97  typedef typename FeatureImageType::IndexType FeatureIndexType;
99  typedef typename FeatureImageType::RegionType FeatureRegionType;
100 
102  typedef TOutputImage OutputImageType;
103  typedef typename OutputImageType::IndexType IndexType;
104  typedef typename OutputImageType::PixelType OutputPixelType;
105 
106  typedef typename Superclass::TimeStepType TimeStepType;
107  typedef typename Superclass::FiniteDifferenceFunctionType
109 
110  typedef typename Superclass::IdCellType IdCellType;
111 
112  typedef TFunction FunctionType;
113  typedef typename FunctionType::Pointer FunctionPtr;
114 
115  typedef TSharedData SharedDataType;
116  typedef typename SharedDataType::Pointer SharedDataPointer;
117 
120 
121 #ifdef ITK_USE_CONCEPT_CHECKING
122 
123  itkConceptMacro( OutputHasNumericTraitsCheck,
125 
127 #endif
128 
131  virtual void SetFeatureImage(const FeatureImagePointer f)
132  {
133  this->SetInput(f);
134  }
135 
136 protected:
138  {
139  this->SetNumberOfLayers(2); // Narrow-band usage
140  this->m_SharedData = SharedDataType::New();
141  }
142 
144 
146 
147  virtual void Initialize();
148 
149  virtual void InitializeIteration();
150 
151  virtual void UpdatePixel(unsigned int functionIndex,
152  unsigned int idx, NeighborhoodIterator< InputImageType > & iterator,
153  ValueType & newValue, bool & status);
154 };
155 } //end namespace itk
156 
157 #ifndef ITK_MANUAL_INSTANTIATION
158 #include "itkScalarChanAndVeseSparseLevelSetImageFilter.hxx"
159 #endif
160 
161 #endif
162