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 __itkPathToImageFilter_h 00019 #define __itkPathToImageFilter_h 00020 00021 #include "itkImageSource.h" 00022 #include "itkConceptChecking.h" 00023 00024 namespace itk 00025 { 00035 template< class TInputPath, class TOutputImage > 00036 class ITK_EXPORT PathToImageFilter:public ImageSource< TOutputImage > 00037 { 00038 public: 00040 typedef PathToImageFilter Self; 00041 typedef ImageSource< TOutputImage > Superclass; 00042 typedef SmartPointer< Self > Pointer; 00043 typedef SmartPointer< const Self > ConstPointer; 00044 00046 itkNewMacro(Self); 00047 00049 itkTypeMacro(PathToImageFilter, ImageSource); 00050 00052 typedef typename Superclass::OutputImageRegionType OutputImageRegionType; 00053 typedef TInputPath InputPathType; 00054 typedef typename InputPathType::Pointer InputPathPointer; 00055 typedef typename InputPathType::ConstPointer InputPathConstPointer; 00056 typedef TOutputImage OutputImageType; 00057 typedef typename OutputImageType::Pointer OutputImagePointer; 00058 typedef typename OutputImageType::SizeType SizeType; 00059 typedef typename OutputImageType::ValueType ValueType; 00060 00062 itkStaticConstMacro(OutputImageDimension, unsigned int, 00063 TOutputImage::ImageDimension); 00064 00066 using Superclass::SetInput; 00067 virtual void SetInput(const InputPathType *path); 00068 00069 virtual void SetInput(unsigned int, const TInputPath *path); 00070 00071 const InputPathType * GetInput(void); 00072 00073 const InputPathType * GetInput(unsigned int idx); 00074 00079 virtual void SetSpacing(const double *spacing); 00080 00081 virtual void SetSpacing(const float *spacing); 00082 00083 virtual const double * GetSpacing() const; 00084 00087 itkSetMacro(PathValue, ValueType); 00088 itkGetConstMacro(PathValue, ValueType); 00089 itkSetMacro(BackgroundValue, ValueType); 00090 itkGetConstMacro(BackgroundValue, ValueType); 00092 00097 virtual void SetOrigin(const double *origin); 00098 00099 virtual void SetOrigin(const float *origin); 00100 00101 virtual const double * GetOrigin() const; 00102 00104 itkSetMacro(Size, SizeType); 00105 itkGetConstMacro(Size, SizeType); 00106 protected: 00107 PathToImageFilter(); 00108 ~PathToImageFilter(); 00110 00111 virtual void GenerateOutputInformation(){} // do nothing 00112 virtual void GenerateData(); 00113 00114 SizeType m_Size; 00115 double m_Spacing[OutputImageDimension]; 00116 double m_Origin[OutputImageDimension]; 00117 ValueType m_PathValue; 00118 ValueType m_BackgroundValue; 00119 00120 virtual void PrintSelf(std::ostream & os, Indent indent) const; 00121 00122 private: 00123 PathToImageFilter(const Self &); //purposely not implemented 00124 void operator=(const Self &); //purposely not implemented 00125 }; 00126 } // end namespace itk 00127 00128 #ifndef ITK_MANUAL_INSTANTIATION 00129 #include "itkPathToImageFilter.hxx" 00130 #endif 00131 00132 #endif 00133