ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
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 __itkFastMarchingExtensionImageFilter_h 00019 #define __itkFastMarchingExtensionImageFilter_h 00020 00021 #include "itkFastMarchingImageFilter.h" 00022 00023 namespace itk 00024 { 00051 template< 00052 class TLevelSet, 00053 class TAuxValue, 00054 unsigned int VAuxDimension = 1, 00055 class TSpeedImage = Image< float, ::itk::GetImageDimension< TLevelSet >::ImageDimension > 00056 > 00057 class ITK_EXPORT FastMarchingExtensionImageFilter: 00058 public FastMarchingImageFilter< TLevelSet, TSpeedImage > 00059 { 00060 public: 00062 typedef FastMarchingExtensionImageFilter Self; 00063 typedef FastMarchingImageFilter< TLevelSet, TSpeedImage > Superclass; 00064 typedef SmartPointer< Self > Pointer; 00065 typedef SmartPointer< const Self > ConstPointer; 00066 00068 itkNewMacro(Self); 00069 00071 itkTypeMacro(FastMarchingExtensionImageFilter, FastMarchingImageFilter); 00072 00074 typedef typename Superclass::LevelSetType LevelSetType; 00075 typedef typename Superclass::SpeedImageType SpeedImageType; 00076 typedef typename Superclass::LevelSetImageType LevelSetImageType; 00077 00079 itkStaticConstMacro(SetDimension, unsigned int, Superclass::SetDimension); 00080 00082 itkStaticConstMacro(AuxDimension, unsigned int, VAuxDimension); 00083 00085 typedef AuxVarTypeDefault< TAuxValue, 00086 itkGetStaticConstMacro(AuxDimension), 00087 itkGetStaticConstMacro(SetDimension) > 00088 AuxVarType; 00089 typedef typename AuxVarType::AuxValueType AuxValueType; 00090 typedef typename AuxVarType::AuxValueVectorType AuxValueVectorType; 00091 typedef typename AuxVarType::AuxValueContainer AuxValueContainer; 00092 typedef typename AuxVarType::AuxImageType AuxImageType; 00093 typedef typename AuxVarType::AuxImagePointer AuxImagePointer; 00095 00097 typedef Index< itkGetStaticConstMacro(SetDimension) > IndexType; 00098 00100 AuxImageType * GetAuxiliaryImage(unsigned int idx); 00101 00103 void SetAuxiliaryAliveValues(AuxValueContainer *values) 00104 { 00105 m_AuxAliveValues = values; 00106 } 00107 00109 AuxValueContainer * GetAuxiliaryAliveValues(void) 00110 { 00111 return m_AuxAliveValues.GetPointer(); 00112 } 00113 00115 void SetAuxiliaryTrialValues(AuxValueContainer *values) 00116 { 00117 m_AuxTrialValues = values; 00118 } 00119 00121 typename AuxValueContainer::Pointer GetAuxiliaryTrialValues() 00122 { 00123 return m_AuxTrialValues; 00124 } 00125 00126 #ifdef ITK_USE_CONCEPT_CHECKING 00127 00128 itkConceptMacro( AuxValueHasNumericTraitsCheck, 00129 ( Concept::HasNumericTraits< TAuxValue > ) ); 00130 00132 #endif 00133 protected: 00134 FastMarchingExtensionImageFilter(); 00135 ~FastMarchingExtensionImageFilter(){} 00136 void PrintSelf(std::ostream & os, Indent indent) const; 00138 00139 virtual void Initialize(LevelSetImageType *); 00140 00141 virtual double UpdateValue(const IndexType & index, 00142 const SpeedImageType *speed, LevelSetImageType *output); 00143 00145 virtual void GenerateOutputInformation(); 00146 00147 virtual void EnlargeOutputRequestedRegion(DataObject *output); 00148 00149 private: 00150 FastMarchingExtensionImageFilter(const Self &); //purposely not implemented 00151 void operator=(const Self &); //purposely not implemented 00152 00153 typename AuxValueContainer::Pointer m_AuxAliveValues; 00154 typename AuxValueContainer::Pointer m_AuxTrialValues; 00155 }; 00156 } // namespace itk 00157 00158 #ifndef ITK_MANUAL_INSTANTIATION 00159 #include "itkFastMarchingExtensionImageFilter.hxx" 00160 #endif 00161 00162 #endif 00163