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 __itkGaussianImageSource_h 00019 #define __itkGaussianImageSource_h 00020 00021 #include "itkParametricImageSource.h" 00022 #include "itkFixedArray.h" 00023 #include "itkSize.h" 00024 00025 namespace itk 00026 { 00043 template< typename TOutputImage > 00044 class ITK_EXPORT GaussianImageSource : 00045 public ParametricImageSource< TOutputImage > 00046 { 00047 public: 00049 typedef GaussianImageSource Self; 00050 typedef ParametricImageSource< TOutputImage > Superclass; 00051 typedef SmartPointer< Self > Pointer; 00052 typedef SmartPointer< const Self > ConstPointer; 00053 00055 typedef typename TOutputImage::PixelType OutputImagePixelType; 00056 00058 typedef typename TOutputImage::RegionType OutputImageRegionType; 00059 00062 typedef typename TOutputImage::SpacingType SpacingType; 00063 00066 typedef typename TOutputImage::PointType PointType; 00067 00070 typedef typename TOutputImage::DirectionType DirectionType; 00071 00073 itkStaticConstMacro(NDimensions, unsigned int, TOutputImage::ImageDimension); 00074 00076 typedef FixedArray< double, itkGetStaticConstMacro(NDimensions) > ArrayType; 00077 00079 typedef typename TOutputImage::SizeType SizeType; 00080 typedef typename TOutputImage::SizeValueType SizeValueType; 00081 00083 typedef typename Superclass::ParametersValueType ParametersValueType; 00084 typedef typename Superclass::ParametersType ParametersType; 00085 00087 itkTypeMacro(GaussianImageSource, ParametricImageSource); 00088 00090 itkNewMacro(Self); 00091 00093 itkSetMacro(Scale, double); 00094 itkGetConstReferenceMacro(Scale, double); 00095 itkSetMacro(Normalized, bool); 00096 itkGetConstReferenceMacro(Normalized, bool); 00097 itkSetMacro(Sigma, ArrayType); 00098 itkGetConstReferenceMacro(Sigma, ArrayType); 00099 itkSetMacro(Mean, ArrayType); 00100 itkGetConstReferenceMacro(Mean, ArrayType); 00102 00108 virtual void SetParameters(const ParametersType & parameters); 00109 virtual ParametersType GetParameters() const; 00111 00115 virtual unsigned int GetNumberOfParameters() const; 00116 00117 protected: 00118 GaussianImageSource(); 00119 // ~GaussianImageSource(); default implementation ok 00120 void PrintSelf(std::ostream & os, Indent indent) const; 00121 00122 void GenerateData(); 00123 00124 private: 00125 GaussianImageSource(const GaussianImageSource &); //purposely not implemented 00126 void operator=(const GaussianImageSource &); //purposely not implemented 00127 00128 SizeType m_Size; // size of the output image 00129 SpacingType m_Spacing; // spacing 00130 PointType m_Origin; // origin 00131 DirectionType m_Direction; // direction 00132 00136 ArrayType m_Sigma; 00137 00139 ArrayType m_Mean; 00140 00142 double m_Scale; 00143 00145 bool m_Normalized; 00146 }; 00147 } // end namespace itk 00148 00149 #ifndef ITK_MANUAL_INSTANTIATION 00150 #include "itkGaussianImageSource.hxx" 00151 #endif 00152 00153 #endif 00154