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 __itkContourMeanDistanceImageFilter_h 00019 #define __itkContourMeanDistanceImageFilter_h 00020 00021 #include "itkImageToImageFilter.h" 00022 #include "itkNumericTraits.h" 00023 00024 namespace itk 00025 { 00067 template< class TInputImage1, class TInputImage2 > 00068 class ITK_EXPORT ContourMeanDistanceImageFilter: 00069 public ImageToImageFilter< TInputImage1, TInputImage1 > 00070 { 00071 public: 00073 typedef ContourMeanDistanceImageFilter Self; 00074 typedef ImageToImageFilter< TInputImage1, TInputImage1 > Superclass; 00075 typedef SmartPointer< Self > Pointer; 00076 typedef SmartPointer< const Self > ConstPointer; 00077 00079 itkNewMacro(Self); 00080 00082 itkTypeMacro(ContourMeanDistanceImageFilter, ImageToImageFilter); 00083 00085 typedef TInputImage1 InputImage1Type; 00086 typedef TInputImage2 InputImage2Type; 00087 typedef typename TInputImage1::Pointer InputImage1Pointer; 00088 typedef typename TInputImage2::Pointer InputImage2Pointer; 00089 typedef typename TInputImage1::ConstPointer InputImage1ConstPointer; 00090 typedef typename TInputImage2::ConstPointer InputImage2ConstPointer; 00091 00092 typedef typename TInputImage1::RegionType RegionType; 00093 typedef typename TInputImage1::SizeType SizeType; 00094 typedef typename TInputImage1::IndexType IndexType; 00095 00096 typedef typename TInputImage1::PixelType InputImage1PixelType; 00097 typedef typename TInputImage2::PixelType InputImage2PixelType; 00098 00100 itkStaticConstMacro(ImageDimension, unsigned int, 00101 TInputImage1::ImageDimension); 00102 00104 typedef typename NumericTraits< InputImage1PixelType >::RealType RealType; 00105 00107 void SetInput1(const InputImage1Type *image); 00108 00110 void SetInput2(const InputImage2Type *image); 00111 00113 const InputImage1Type * GetInput1(void); 00114 00116 const InputImage2Type * GetInput2(void); 00117 00119 itkGetConstMacro(MeanDistance, RealType); 00120 00122 itkSetMacro( UseImageSpacing, bool ); 00123 00124 #ifdef ITK_USE_CONCEPT_CHECKING 00125 00126 itkConceptMacro( InputHasNumericTraitsCheck, 00127 ( Concept::HasNumericTraits< InputImage1PixelType > ) ); 00128 00130 #endif 00131 protected: 00132 ContourMeanDistanceImageFilter(); 00133 ~ContourMeanDistanceImageFilter(){} 00134 void PrintSelf(std::ostream & os, Indent indent) const; 00136 00138 void GenerateData(); 00139 00140 // Override since the filter needs all the data for the algorithm 00141 void GenerateInputRequestedRegion(); 00142 00143 // Override since the filter produces all of its output 00144 void EnlargeOutputRequestedRegion(DataObject *data); 00145 00146 private: 00147 ContourMeanDistanceImageFilter(const Self &); //purposely not implemented 00148 void operator=(const Self &); //purposely not implemented 00149 00150 RealType m_MeanDistance; 00151 bool m_UseImageSpacing; 00152 }; // end of class 00153 } // end namespace itk 00154 00155 #ifndef ITK_MANUAL_INSTANTIATION 00156 #include "itkContourMeanDistanceImageFilter.hxx" 00157 #endif 00158 00159 #endif 00160