ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkLevelSetVelocityNeighborhoodExtractor.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 __itkLevelSetVelocityNeighborhoodExtractor_h
00019 #define __itkLevelSetVelocityNeighborhoodExtractor_h
00020 
00021 #include "itkLevelSetNeighborhoodExtractor.h"
00022 
00023 namespace itk
00024 {
00053 template<
00054   class TLevelSet,
00055   class TAuxValue,
00056   unsigned int VAuxDimension = 1
00057   >
00058 class ITK_EXPORT LevelSetVelocityNeighborhoodExtractor:
00059   public LevelSetNeighborhoodExtractor< TLevelSet >
00060 {
00061 public:
00063   typedef LevelSetVelocityNeighborhoodExtractor      Self;
00064   typedef LevelSetNeighborhoodExtractor< TLevelSet > Superclass;
00065   typedef SmartPointer< Self >                       Pointer;
00066   typedef SmartPointer< const Self >                 ConstPointer;
00067 
00069   itkNewMacro(Self);
00070 
00072   itkTypeMacro(LevelSetVelocityNeighborhoodExtractor,
00073                LevelSetNeighborhoodExtractor);
00074 
00076   typedef LevelSetTypeDefault< TLevelSet > LevelSetType;
00077 
00079   itkStaticConstMacro(SetDimension, unsigned int,
00080                       LevelSetType::SetDimension);
00081 
00083   typedef::itk::Index< itkGetStaticConstMacro(SetDimension) > Index;
00084 
00086   typedef AuxVarTypeDefault< TAuxValue, VAuxDimension, itkGetStaticConstMacro(SetDimension) >
00087   AuxVarType;
00088   typedef typename AuxVarType::AuxValueType         AuxValueType;
00089   typedef typename AuxVarType::AuxValueVectorType   AuxValueVectorType;
00090   typedef typename AuxVarType::AuxValueContainer    AuxValueContainer;
00091   typedef typename AuxVarType::AuxImageType         AuxImageType;
00092   typedef typename AuxVarType::AuxImagePointer      AuxImagePointer;
00093   typedef typename AuxVarType::AuxImageConstPointer AuxImageConstPointer;
00094 
00096   void SetAuxImage(const AuxImageType *ptr, unsigned int idx = 0)
00097   {
00098     if ( idx < VAuxDimension && m_AuxImage[idx] != ptr )
00099       {
00100       m_AuxImage[idx] = ptr;
00101       }
00102     this->Modified();
00103   }
00105 
00107   AuxImageConstPointer GetAuxImage(unsigned int idx = 0)
00108   {
00109     if ( idx >= VAuxDimension )
00110       {
00111       return NULL;
00112       }
00113     else
00114       {
00115       return m_AuxImage[idx];
00116       }
00117   }
00119 
00122   itkGetObjectMacro(AuxInsideValues, AuxValueContainer);
00123 
00126   itkGetObjectMacro(AuxOutsideValues, AuxValueContainer);
00127 protected:
00128   LevelSetVelocityNeighborhoodExtractor();
00129   ~LevelSetVelocityNeighborhoodExtractor(){}
00130   void PrintSelf(std::ostream & os, Indent indent) const;
00132 
00133   virtual void Initialize();
00134 
00135   virtual double CalculateDistance(Index & index);
00136 
00137 private:
00138   LevelSetVelocityNeighborhoodExtractor(const Self &); //purposely not
00139                                                        // implemented
00140   void operator=(const Self &);                        //purposely not
00141                                                        // implemented
00142 
00143   typename AuxValueContainer::Pointer m_AuxInsideValues;
00144   typename AuxValueContainer::Pointer m_AuxOutsideValues;
00145   AuxImageConstPointer m_AuxImage[VAuxDimension];
00146 };
00147 } // namespace itk
00148 
00149 #ifndef ITK_MANUAL_INSTANTIATION
00150 #include "itkLevelSetVelocityNeighborhoodExtractor.hxx"
00151 #endif
00152 
00153 #endif
00154