ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkScalarChanAndVeseLevelSetFunction.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkScalarChanAndVeseLevelSetFunction_h
00019 #define __itkScalarChanAndVeseLevelSetFunction_h
00020 
00021 #include "itkScalarRegionBasedLevelSetFunction.h"
00022 #include "itkScalarChanAndVeseLevelSetFunctionData.h"
00023 #include "itkConstrainedRegionBasedLevelSetFunctionSharedData.h"
00024 
00025 namespace itk
00026 {
00073 template< class TInputImage,
00074           class TFeatureImage,
00075           class TSharedData = ConstrainedRegionBasedLevelSetFunctionSharedData< TInputImage, TFeatureImage,
00076                                                                                 ScalarChanAndVeseLevelSetFunctionData<
00077                                                                                   TInputImage, TFeatureImage > > >
00078 class ITK_EXPORT ScalarChanAndVeseLevelSetFunction:
00079   public ScalarRegionBasedLevelSetFunction< TInputImage, TFeatureImage, TSharedData >
00080 {
00081 public:
00082   typedef ScalarChanAndVeseLevelSetFunction                                            Self;
00083   typedef ScalarRegionBasedLevelSetFunction< TInputImage, TFeatureImage, TSharedData > Superclass;
00084   typedef SmartPointer< Self >                                                         Pointer;
00085   typedef SmartPointer< const Self >                                                   ConstPointer;
00086 
00088   itkNewMacro(Self);
00089 
00091   itkTypeMacro(ScalarChanAndVeseLevelSetFunction, ScalarLevelSetFunction);
00092 
00093   itkStaticConstMacro(ImageDimension, unsigned int, TFeatureImage::ImageDimension);
00094 
00095   typedef TInputImage                                 InputImageType;
00096   typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
00097   typedef typename Superclass::InputImagePointer      InputImagePointer;
00098   typedef typename Superclass::InputPixelType         InputPixelType;
00099   typedef typename Superclass::InputIndexType         InputIndexType;
00100   typedef typename Superclass::InputIndexValueType    InputIndexValueType;
00101   typedef typename Superclass::InputSizeType          InputSizeType;
00102   typedef typename Superclass::InputSizeValueType     InputSizeValueType;
00103   typedef typename Superclass::InputRegionType        InputRegionType;
00104   typedef typename Superclass::InputPointType         InputPointType;
00105 
00106   typedef TFeatureImage                           FeatureImageType;
00107   typedef typename FeatureImageType::ConstPointer FeatureImageConstPointer;
00108   typedef typename Superclass::FeaturePixelType   FeaturePixelType;
00109   typedef typename Superclass::FeatureIndexType   FeatureIndexType;
00110   typedef typename Superclass::FeatureOffsetType  FeatureOffsetType;
00111 
00112   typedef typename Superclass::ScalarValueType  ScalarValueType;
00113   typedef typename Superclass::NeighborhoodType NeighborhoodType;
00114   typedef typename Superclass::FloatOffsetType  FloatOffsetType;
00115   typedef typename Superclass::RadiusType       RadiusType;
00116   typedef typename Superclass::TimeStepType     TimeStepType;
00117   typedef typename Superclass::GlobalDataStruct GlobalDataStruct;
00118   typedef typename Superclass::PixelType        PixelType;
00119   typedef typename Superclass::VectorType       VectorType;
00120 
00121   typedef typename Superclass::SharedDataType    SharedDataType;
00122   typedef typename Superclass::SharedDataPointer SharedDataPointer;
00123 
00124   typedef typename Superclass::ImageIteratorType        ImageIteratorType;
00125   typedef typename Superclass::ConstImageIteratorType   ConstImageIteratorType;
00126   typedef typename Superclass::FeatureImageIteratorType FeatureImageIteratorType;
00127   typedef typename Superclass::ConstFeatureIteratorType ConstFeatureIteratorType;
00128 
00129   typedef typename Superclass::ListPixelType          ListPixelType;
00130   typedef typename Superclass::ListPixelConstIterator ListPixelConstIterator;
00131   typedef typename Superclass::ListPixelIterator      ListPixelIterator;
00132   typedef typename Superclass::ListImageType          ListImageType;
00133 protected:
00134   ScalarChanAndVeseLevelSetFunction():Superclass() {}
00135   ~ScalarChanAndVeseLevelSetFunction(){}
00136 
00137   void ComputeParameters();
00138 
00139   void UpdateSharedDataParameters();
00140 
00141   ScalarValueType ComputeInternalTerm(const FeaturePixelType & iValue,
00142                                       const FeatureIndexType & iIdx);
00143 
00144   ScalarValueType ComputeExternalTerm(const FeaturePixelType & iValue,
00145                                       const FeatureIndexType & iIdx);
00146 
00147   void UpdateSharedDataInsideParameters(const unsigned int & iId,
00148                                         const FeaturePixelType & iVal, const ScalarValueType & iChange);
00149 
00150   void UpdateSharedDataOutsideParameters(const unsigned int & iId,
00151                                          const FeaturePixelType & iVal, const ScalarValueType & iChange);
00152 
00153 private:
00154   ScalarChanAndVeseLevelSetFunction(const Self &); //purposely not implemented
00155   void operator=(const Self &);                    //purposely not implemented
00156 };
00157 }
00158 
00159 #ifndef ITK_MANUAL_INSTANTIATION
00160 #include "itkScalarChanAndVeseLevelSetFunction.hxx"
00161 #endif
00162 
00163 #endif
00164