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 __itkApproximateSignedDistanceMapImageFilter_h 00019 #define __itkApproximateSignedDistanceMapImageFilter_h 00020 00021 #include "itkFastChamferDistanceImageFilter.h" 00022 #include "itkIsoContourDistanceImageFilter.h" 00023 00024 namespace itk 00025 { 00071 template< class TInputImage, class TOutputImage > 00072 class ITK_EXPORT ApproximateSignedDistanceMapImageFilter:public ImageToImageFilter< TInputImage, TOutputImage > 00073 { 00074 public: 00076 typedef ApproximateSignedDistanceMapImageFilter Self; 00077 typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass; 00078 typedef SmartPointer< Self > Pointer; 00079 typedef SmartPointer< const Self > ConstPointer; 00080 00082 itkTypeMacro(ApproximateSignedDistanceMapImageFilter, ImageToImageFilter); 00083 00085 itkNewMacro(Self); 00086 00088 typedef TInputImage InputImageType; 00089 00091 typedef TOutputImage OutputImageType; 00092 00094 typedef typename InputImageType::PixelType InputPixelType; 00095 00097 typedef typename OutputImageType::PixelType OutputPixelType; 00098 00100 typedef typename OutputImageType::SizeType OutputSizeType; 00101 typedef typename OutputSizeType::SizeValueType OutputSizeValueType; 00102 00104 itkStaticConstMacro(InputImageDimension, unsigned int, 00105 InputImageType::ImageDimension); 00106 00108 typedef typename InputImageType::ConstPointer InputImagePointer; 00109 00111 typedef typename OutputImageType::Pointer OutputImagePointer; 00112 00115 itkSetMacro(InsideValue, InputPixelType); 00116 itkGetConstMacro(InsideValue, InputPixelType); 00118 00120 itkSetMacro(OutsideValue, InputPixelType); 00121 itkGetConstMacro(OutsideValue, InputPixelType); 00123 00124 #ifdef ITK_USE_CONCEPT_CHECKING 00125 00126 itkConceptMacro( InputEqualityComparableCheck, 00127 ( Concept::EqualityComparable< typename InputImageType::PixelType > ) ); 00128 00130 #endif 00131 protected: 00132 ApproximateSignedDistanceMapImageFilter(); 00133 virtual ~ApproximateSignedDistanceMapImageFilter() {} 00134 virtual void GenerateData(); 00136 00137 void PrintSelf(std::ostream & os, Indent indent) const; 00138 00139 private: 00140 ApproximateSignedDistanceMapImageFilter(const Self &); //purposely not 00141 // implemented 00142 void operator=(const Self &); //purposely not 00143 00144 // implemented 00145 00146 typedef IsoContourDistanceImageFilter< InputImageType, OutputImageType > IsoContourType; 00147 typedef FastChamferDistanceImageFilter< OutputImageType, OutputImageType > ChamferType; 00148 typename IsoContourType::Pointer m_IsoContourFilter; 00149 00150 typename ChamferType::Pointer m_ChamferFilter; 00151 00152 InputPixelType m_InsideValue; 00153 InputPixelType m_OutsideValue; 00154 }; 00155 } // end of namespace itk 00156 00157 #ifndef ITK_MANUAL_INSTANTIATION 00158 #include "itkApproximateSignedDistanceMapImageFilter.hxx" 00159 #endif 00160 00161 #endif 00162