[Insight-users] FFTImageFilter

Markus Neuner neuner.markus at gmx.net
Wed Aug 4 15:38:17 EDT 2010


What is the pixel type of "ImageType"?

On 04.08.2010 21:11, Ming Chao wrote:
> I checked the complex image FFT created from the input image was fine.
> Also I checked the real and imaginary parts in floating point format,
> respectively. They both are fine. The problem started to happen when
> rescaling the real/imaginary image into an interger-type image. Here
> is part of the rescaling code:
>
>   typedef unsigned char WritePixelType;
>   typedef itk::Image< WritePixelType, Dimension > WriteImageType;
>  
>   typedef itk::RescaleIntensityImageFilter<ImageType, WriteImageType >
> RescaleFilterType;
>
>   RescaleFilterType::Pointer intensityRescaler = RescaleFilterType::New();
>   intensityRescaler->SetOutputMinimum(  0  );
>   intensityRescaler->SetOutputMaximum( 255 );
>  
>   intensityRescaler->SetInput( realFilter->GetOutput() );
>
>   typedef itk::ImageFileWriter< WriteImageType > WriterType;
>   WriterType::Pointer writer = WriterType::New();
>   writer->SetFileName( argv[2] );
>   writer->SetInput( intensityRescaler->GetOutput() );
>
>   try
>     {
> writer->Update();
>     }
>   catch( itk::ExceptionObject & excp )
>     {
> std::cerr << "Error writing the real image: " << std::endl;
> std::cerr << excp << std::endl;
> return EXIT_FAILURE;
>     }
>
>   typedef itk::ImageRegionConstIterator< WriteImageType >
> ConstIteratorType;
>   WriteImageType::Pointer RealImage = intensityRescaler->GetOutput();
>   ConstIteratorType in( RealImage, RealImage->GetRequestedRegion() );
>   
>   for ( in.GoToBegin(); !in.IsAtEnd(); ++in )
>   {
>  std::cout << in.Get() << std::endl;
>   }
>
>
> From the output I got all zeros....Apparently something wrong with the
> rescaler. Could anybody take a look? Thanks very much,
>
> Ming
>
>
> On Wed, Aug 4, 2010 at 9:35 AM, Ming Chao <mingchao2005 at gmail.com
> <mailto:mingchao2005 at gmail.com>> wrote:
>
>     I tried to run FFTImageFilter.cxx to do an FFT of an image. The
>     input image is a 512x512, 24 bit thoracic CT image in jpg format.
>     The output of the example cxx code are the real and imaginary
>     parts of FFT of the input image. However, when I look at the two
>     output images, they are just uniformly grey/black, depending on 
>
>       intensityRescaler->SetOutputMinimum(  0  );
>       intensityRescaler->SetOutputMaximum( 255 );
>
>     in the code. What did I do wrong? Many thanks,
>
>     Ming
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100804/1f26763b/attachment.htm>


More information about the Insight-users mailing list