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 __itkDirectFourierReconstructionImageToImageFilter_h 00019 #define __itkDirectFourierReconstructionImageToImageFilter_h 00020 00021 #include "itkImageToImageFilter.h" 00022 #include "itkImage.h" 00023 00024 #include "itkVnlForwardFFTImageFilter.h" 00025 #include "itkVnlInverseFFTImageFilter.h" 00026 00027 #include "itkImageRegionIteratorWithIndex.h" 00028 #include "itkImageSliceConstIteratorWithIndex.h" 00029 00030 #include "itkComplexBSplineInterpolateImageFunction.h" 00031 00032 #include <math.h> 00033 00034 namespace itk 00035 { 00050 template< class TInputImage, class TOutputImage=TInputImage > 00051 class ITK_EXPORT DirectFourierReconstructionImageToImageFilter: 00052 public ImageToImageFilter< TInputImage, TOutputImage > 00053 { 00054 public: 00055 00057 typedef DirectFourierReconstructionImageToImageFilter Self; 00058 00059 typedef TInputImage InputImageType; 00060 typedef typename InputImageType::PixelType InputPixelType; 00061 typedef TOutputImage OutputImageType; 00062 typedef typename OutputImageType::PixelType OutputPixelType; 00063 00065 typedef ImageToImageFilter< InputImageType, OutputImageType > Superclass; 00066 00068 typedef SmartPointer< Self > Pointer; 00069 00071 typedef SmartPointer< const Self > ConstPointer; 00072 00073 itkNewMacro(Self); 00074 itkTypeMacro(DirectFourierReconstructionImageToImageFilter, ImageToImageFilter); 00075 00077 typedef typename InputImageType::RegionType RegionType; 00078 00080 typedef typename InputImageType::IndexType IndexType; 00081 00083 typedef typename InputImageType::SizeType SizeType; 00084 00086 typedef typename InputImageType::PointType PointType; 00087 00089 typedef typename InputImageType::SpacingType SpacingType; 00090 00092 typedef typename InputImageType::ConstPointer ConstInputImagePointer; 00093 00095 typedef typename InputImageType::Pointer InputImagePointer; 00096 00098 typedef typename OutputImageType::Pointer OutputImagePointer; 00099 00100 itkSetMacro(ZeroPadding, unsigned short int); 00101 itkGetConstMacro(ZeroPadding, unsigned short int); 00102 00103 itkSetMacro(OverSampling, unsigned short int); 00104 itkGetConstMacro(OverSampling, unsigned short int); 00105 00106 itkSetMacro(Cutoff, double); 00107 itkGetConstMacro(Cutoff, double); 00108 00109 itkSetMacro(AlphaRange, double); 00110 itkGetConstMacro(AlphaRange, double); 00111 00112 itkSetMacro(AlphaDirection, unsigned short int); 00113 itkGetConstMacro(AlphaDirection, unsigned short int); 00114 00115 itkSetMacro(ZDirection, unsigned short int); 00116 itkGetConstMacro(ZDirection, unsigned short int); 00117 00118 itkSetMacro(RDirection, unsigned short int); 00119 itkGetConstMacro(RDirection, unsigned short int); 00120 00121 itkSetMacro(RadialSplineOrder, unsigned short int); 00122 itkGetConstMacro(RadialSplineOrder, unsigned short int); 00123 00124 protected: 00126 DirectFourierReconstructionImageToImageFilter(); 00127 00129 ~DirectFourierReconstructionImageToImageFilter() {} 00130 00132 void PrintSelf(std::ostream & os, Indent indent) const; 00133 00135 void GenerateOutputInformation(); 00136 00138 void GenerateInputRequestedRegion(); 00139 00141 void GenerateData(); 00142 00143 private: 00145 typedef ImageSliceConstIteratorWithIndex< InputImageType > InputSliceIteratorType; 00146 00148 typedef Image< double, 1 > LineImageType; 00149 typedef VnlForwardFFTImageFilter< LineImageType > FFTLineFilterType; 00150 00152 typedef FFTLineFilterType::OutputImageType FFTLineType; 00153 00155 typedef FFTLineFilterType::InputImageType ProjectionLineType; 00156 00158 typedef ImageRegionIteratorWithIndex< FFTLineType > FFTLineIteratorType; 00159 00161 typedef ComplexBSplineInterpolateImageFunction< FFTLineType, double, double > FFTLineInterpolatorType; 00162 00164 typedef Image< std::complex<double>, 2> IFFTImageType; 00165 typedef VnlInverseFFTImageFilter< IFFTImageType > IFFTSliceFilterType; 00166 00168 typedef IFFTSliceFilterType::InputImageType FFTSliceType; 00169 00171 typedef IFFTSliceFilterType::OutputImageType OutputSliceType; 00172 00174 typedef ImageRegionIteratorWithIndex< FFTSliceType > FFTSliceIteratorType; 00175 00177 typedef ImageRegionIteratorWithIndex< OutputSliceType > OutputSliceIteratorType; 00178 00205 DirectFourierReconstructionImageToImageFilter(const Self &); 00206 void operator=(const Self &); 00207 }; 00208 } // namespace itk 00210 00211 #ifndef ITK_MANUAL_INSTANTIATION 00212 #include "itkDirectFourierReconstructionImageToImageFilter.hxx" 00213 #endif 00214 00215 #endif /* __itkDirectFourierReconstructionImageToImageFilter_h */ 00216