[Insight-users] how to do FFT to an image
Luis Ibanez
luis.ibanez at kitware.com
Sun Nov 14 20:34:31 EST 2004
Hi Lanlanny,
We just committed a new example to the CVS repository
illustrating how to use the FFT image filter.
You will find this new example under:
Insight/Examples/Filtering/
FFTImageFilter.cxx
We also added some convenience filters for making
easier to extract the Real and Imaginary parts of
the complex image that is produced as output of the
VnlFFTRealToComplexConjugate filter.
You will need to update your CVS checkout of ITK
in order to get these new files.
BTW, The lack of this example was entered as Bug #1349
http://www.itk.org/Bug/bug.php?op=show&bugid=1349&pos=0
This bug was marked as closed+fixed now that the example
has been commited.
Please let us know if you have any further questions.
Thanks,
Luis
---------------------------
Ñî´ºÀ¼ wrote:
> 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();
>
>
> }
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
More information about the Insight-users
mailing list