ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkExtensionVelocitiesImageFilter.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 __itkExtensionVelocitiesImageFilter_h
00019 #define __itkExtensionVelocitiesImageFilter_h
00020 
00021 #include "itkLevelSetVelocityNeighborhoodExtractor.h"
00022 #include "itkFastMarchingExtensionImageFilter.h"
00023 #include "itkReinitializeLevelSetImageFilter.h"
00024 
00025 namespace itk
00026 {
00049 template<
00050   class TLevelSet,
00051   class TAuxValue = float,
00052   unsigned int VAuxDimension = 1
00053   >
00054 class ITK_EXPORT ExtensionVelocitiesImageFilter:
00055   public ReinitializeLevelSetImageFilter< TLevelSet >
00056 {
00057 public:
00058 
00060   typedef ExtensionVelocitiesImageFilter               Self;
00061   typedef ReinitializeLevelSetImageFilter< TLevelSet > Superclass;
00062   typedef SmartPointer< Self >                         Pointer;
00063   typedef SmartPointer< const Self >                   ConstPointer;
00064 
00066   itkNewMacro(Self);
00067 
00069   itkTypeMacro(ExtensionVelocitiesImageFilter, ReinitializeLevelSetImageFilter);
00070 
00072   typedef LevelSetTypeDefault< TLevelSet >            LevelSetType;
00073   typedef typename LevelSetType::LevelSetPointer      LevelSetPointer;
00074   typedef typename LevelSetType::LevelSetConstPointer LevelSetConstPointer;
00075   typedef typename LevelSetType::PixelType            PixelType;
00076   typedef typename LevelSetType::NodeType             NodeType;
00077   typedef typename LevelSetType::NodeContainer        NodeContainer;
00078   typedef typename LevelSetType::NodeContainerPointer NodeContainerPointer;
00079 
00081   itkStaticConstMacro(SetDimension, unsigned int, LevelSetType::SetDimension);
00082 
00084   typedef AuxVarTypeDefault< TAuxValue, VAuxDimension,
00085                              itkGetStaticConstMacro(SetDimension) >
00086   AuxVarType;
00087   typedef typename AuxVarType::AuxValueType         AuxValueType;
00088   typedef typename AuxVarType::AuxValueVectorType   AuxValueVectorType;
00089   typedef typename AuxVarType::AuxValueContainer    AuxValueContainer;
00090   typedef typename AuxVarType::AuxImageType         AuxImageType;
00091   typedef typename AuxVarType::AuxImagePointer      AuxImagePointer;
00092   typedef typename AuxVarType::AuxImageConstPointer AuxImageConstPointer;
00093 
00095   itkStaticConstMacro(AuxDimension, unsigned int, VAuxDimension);
00096 
00098   void SetInputVelocityImage(const AuxImageType *ptr, unsigned int idx = 0);
00099 
00100   const AuxImageType * GetInputVelocityImage(unsigned int idx = 0);
00101 
00103   AuxImageType * GetOutputVelocityImage(unsigned int idx = 0);
00104 
00105 #ifdef ITK_USE_CONCEPT_CHECKING
00106 
00107   itkConceptMacro( AuxValueHasNumericTraitsCheck,
00108                    ( Concept::HasNumericTraits< TAuxValue > ) );
00109   itkConceptMacro( LevelSetOStreamWritableCheck,
00110                    ( Concept::OStreamWritable< PixelType > ) );
00111 
00113 #endif
00114 protected:
00115   ExtensionVelocitiesImageFilter();
00116   ~ExtensionVelocitiesImageFilter(){}
00117 
00118   virtual void GenerateDataFull();
00119 
00120   virtual void GenerateDataNarrowBand();
00121 
00122   virtual void AllocateOutput();
00123 
00124   virtual void EnlargeOutputRequestedRegion(DataObject *);
00125 
00126 private:
00127   ExtensionVelocitiesImageFilter(const Self &); //purposely not implemented
00128   void operator=(const Self &);                 //purposely not implemented
00129 
00131   typedef Image< float, itkGetStaticConstMacro(SetDimension) > SpeedImageType;
00132 
00133   typedef LevelSetVelocityNeighborhoodExtractor< TLevelSet, TAuxValue, VAuxDimension > LocatorType;
00134   typedef FastMarchingExtensionImageFilter< TLevelSet, TAuxValue, VAuxDimension,
00135                                             SpeedImageType > FastMarchingImageFilterType;
00136 
00137   typename LocatorType::Pointer m_Locator;
00138 
00139   typename FastMarchingImageFilterType::Pointer m_Marcher;
00140 };
00141 } // namespace itk
00142 
00143 #ifndef ITK_MANUAL_INSTANTIATION
00144 #include "itkExtensionVelocitiesImageFilter.hxx"
00145 #endif
00146 
00147 #endif
00148