[Insight-users] how to do FFT to an image
Ñî´ºÀ¼
lanlanny at bit.edu.cn
Sun Nov 14 07:12:39 EST 2004
I want to know how to do the FFT to an given image using the
itkFFTRealToComplexConjugateImageFilter. Can the class be instanced?
and how can I get the real part and imagic part respectively?
what's more, what does the fullMatrix mean? Can you give me an example using
the FFT of an image or correct the following code? thanks a lot!!
/****************************************************/
#include "itkFFTRealToComplexConjugateImageFilter.h"
#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
int main(int argc,char* argv[])
{
if(argc<3)
std::cerr<<"usage"<<argv[0];
std::cerr<<"inputfilename outputfilename";
return 1;
typedef unsigned char inputPixelType;
typedef unsigned char outputPixelType;
const unsigned int dimension=2;
typedef itk::Image<inputPixelType,2> InputImageType;
typedef itk::Image<std::complex<outputPixelType>,2> OutputImageType;
itk::FFTRealToComplexConjugateImageFilter<inputPixelType,dimension>
FFTRealToComplexConjugateImageFilterType;
FFTRealToComplexConjugateImageFilterType::Pointer
filter=FFTRealToComplexConjugateImageFilterType::New();
typedef itk::ImageFileReader<InputImageType> ReaderType;
ReaderType::Pointer reader=ReaderType::New();
typedef itk::ImageFileWriter<OutputImageType> WriterType;
WriterType::Pointer writer=WriterType::New();
reader->SetFileName(argv[1]);
filter->SetInput(reader->GetOutput());
filter->GenerateOutputInformation();
filter->Update();
writer->SetInput(filter->GetOutput());
writer->SetFileName(argv[2]);
writer->Update();
}
More information about the Insight-users
mailing list