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 __itkSimpleContourExtractorImageFilter_h 00019 #define __itkSimpleContourExtractorImageFilter_h 00020 00021 #include "itkBoxImageFilter.h" 00022 #include "itkImage.h" 00023 #include "itkNumericTraits.h" 00024 00025 namespace itk 00026 { 00049 template< class TInputImage, class TOutputImage > 00050 class ITK_EXPORT SimpleContourExtractorImageFilter: 00051 public BoxImageFilter< TInputImage, TOutputImage > 00052 { 00053 public: 00055 itkStaticConstMacro(InputImageDimension, unsigned int, 00056 TInputImage::ImageDimension); 00057 itkStaticConstMacro(OutputImageDimension, unsigned int, 00058 TOutputImage::ImageDimension); 00060 00062 typedef TInputImage InputImageType; 00063 typedef TOutputImage OutputImageType; 00064 00066 typedef SimpleContourExtractorImageFilter Self; 00067 typedef BoxImageFilter< InputImageType, OutputImageType > Superclass; 00068 typedef SmartPointer< Self > Pointer; 00069 typedef SmartPointer< const Self > ConstPointer; 00070 00072 itkNewMacro(Self); 00073 00075 itkTypeMacro(SimpleContourExtractorImageFilter, ImageToImageFilter); 00076 00078 typedef typename InputImageType::PixelType InputPixelType; 00079 typedef typename OutputImageType::PixelType OutputPixelType; 00080 typedef typename NumericTraits< InputPixelType >::RealType InputRealType; 00081 00082 typedef typename InputImageType::RegionType InputImageRegionType; 00083 typedef typename OutputImageType::RegionType OutputImageRegionType; 00084 00085 typedef typename InputImageType::SizeType InputSizeType; 00086 00089 itkSetMacro(InputForegroundValue, InputPixelType); 00090 00093 itkGetConstReferenceMacro(InputForegroundValue, InputPixelType); 00094 00097 itkSetMacro(InputBackgroundValue, InputPixelType); 00098 00101 itkGetConstReferenceMacro(InputBackgroundValue, InputPixelType); 00102 00105 itkSetMacro(OutputForegroundValue, OutputPixelType); 00106 00109 itkGetConstReferenceMacro(OutputForegroundValue, OutputPixelType); 00110 00113 itkSetMacro(OutputBackgroundValue, OutputPixelType); 00114 00117 itkGetConstReferenceMacro(OutputBackgroundValue, OutputPixelType); 00118 00119 #ifdef ITK_USE_CONCEPT_CHECKING 00120 00121 itkConceptMacro( InputHasNumericTraitsCheck, 00122 ( Concept::HasNumericTraits< InputPixelType > ) ); 00123 itkConceptMacro( OutputHasNumericTraitsCheck, 00124 ( Concept::HasNumericTraits< OutputPixelType > ) ); 00125 00127 #endif 00128 protected: 00129 SimpleContourExtractorImageFilter(); 00130 virtual ~SimpleContourExtractorImageFilter() {} 00131 void PrintSelf(std::ostream & os, Indent indent) const; 00133 00145 void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, 00146 ThreadIdType threadId); 00147 00148 private: 00149 SimpleContourExtractorImageFilter(const Self &); //purposely not implemented 00150 void operator=(const Self &); //purposely not implemented 00151 00152 InputPixelType m_InputForegroundValue; 00153 InputPixelType m_InputBackgroundValue; 00154 OutputPixelType m_OutputForegroundValue; 00155 OutputPixelType m_OutputBackgroundValue; 00156 }; 00157 } // end namespace itk 00158 00159 #ifndef ITK_MANUAL_INSTANTIATION 00160 #include "itkSimpleContourExtractorImageFilter.hxx" 00161 #endif 00162 00163 #endif 00164