casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
casa::ImageFFT Class Reference

FFT an image. More...

#include <ImageFFT.h>

List of all members.

Public Member Functions

 ImageFFT ()
 Default constructor.
 ImageFFT (const ImageFFT &other)
 Copy constructor (reference semantics)
ImageFFToperator= (const ImageFFT &other)
 Assignment (reference semantics)
 ~ImageFFT ()
 Destructor.
void fftsky (const ImageInterface< Float > &in)
 Do the FFT of the sky plane to the uv plane Masked pixels are set to zero before the FT.
void fft (const ImageInterface< Float > &in, const Vector< Bool > &axes)
 Do the FFT of the specified pixel axes (True to FT).
void fft (const ImageInterface< Complex > &in, const Vector< Bool > &axes)
 Do the FFT of the specified pixel axes (True to FT).
void getComplex (ImageInterface< Complex > &out) const
 Return the FFT (from the last call to fftsky or fft) in the desired form.
void getReal (ImageInterface< Float > &out) const
void getImaginary (ImageInterface< Float > &out) const
void getAmplitude (ImageInterface< Float > &out) const
void getPhase (ImageInterface< Float > &out) const

Private Member Functions

void checkAxes (const CoordinateSystem &cSys, uInt ndim, const Vector< Bool > &axes)
 Check axes for multi-dim FFT.
void copyMask (ImageInterface< Float > &out) const
 Copy the mask to the output.
void copyMask (ImageInterface< Complex > &out) const
void copyMask (ImageInterface< Float > &out, const ImageInterface< Float > &in) const
void copyMask (ImageInterface< Float > &out, const ImageInterface< Complex > &in) const
void copyMask (ImageInterface< Complex > &out, const ImageInterface< Float > &in) const
void copyMask (ImageInterface< Complex > &out, const ImageInterface< Complex > &in) const
void copyMiscellaneous (ImageInterface< Float > &out) const
 Copy MiscInfo, ImageInfo, Unit, logSInk to output.
void copyMiscellaneous (ImageInterface< Complex > &out) const
void fftsky2 (ImageInterface< Complex > &out, const ImageInterface< Float > &in, const Vector< Int > &pixelAxes)
 FFT the sky.
void fft2 (ImageInterface< Complex > &out, const ImageInterface< Float > &in, const Vector< Bool > &axes)
 FFT (Float) given axes.
void fft3 (ImageInterface< Complex > &out, const ImageInterface< Complex > &in, const Vector< Bool > &axes)
 FFT (Complex) given axes.
Bool findSky (LogIO &os, Int &dC, Vector< Int > &pixelAxes, Vector< Int > &worldAxes, const CoordinateSystem &cSys, Bool throwIt)
 Find the sky axes in this CoordinateSystem.
void setSkyCoordinates (LogIO &os, ImageInterface< Complex > &out, const ImageInterface< Float > &in, uInt dC)
 Overwrite the coordinate system with Fourier coordinates for sky axes only.
void setCoordinates (LogIO &os, ImageInterface< Complex > &out, const CoordinateSystem &cSys, const Vector< Bool > &axes, const IPosition &shape)
 Overwrite the coordinate system with Fourier coordinates for all desginated axes.

Private Attributes

ImageInterface< Complex > * itsTempImagePtr
 
 

ImageInterface< Float > * itsInImagePtrFloat
ImageInterface< Complex > * itsInImagePtrComplex
Bool itsDone

Detailed Description

FFT an image.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Take the fast Fourier Transform of an image.

Synopsis

This class takes the FFT of an image. It can take the FFT of just the sky plane(s) of an image or the specified axes.

When you specify axes, if any of them are a sky axis (DirectionCoordinate) you must give both sky axes.

Masked pixels are given the value 0.0 before the FFT is taken and the mask is copied to the output. Note that it is the callers responsibility to give the output a mask if the input is masked. Otherwise the mask will not be copied to the output

This class holds the FourierTransform internally in a TempImage object. This is in memory or on disk depending upon its size and the amount of memory in your computer. The algorithm used is that in TempLattice .

In generating the Fourier Coordinates, it is currently assumed that there is no coordinate rotation. This needs to be dealt with.

Example

    // Make a constant image
   
         IPosition shape(2, 10, 20);
         PagedImage<Float> im1(shape, CoordinateUtil::defaultCoords2D(), "im1");
         im1.set(1.0);
   
    // Create output images with masks if needed
   
         PagedImage<Float> r1(shape, CoordinateUtil::defaultCoords2D(), "real1");
         PagedImage<Float> i1(shape, CoordinateUtil::defaultCoords2D(), "imag1");
         if (im1.isMasked()) {
            LCPagedMask mask1 = LCPagedMask(RegionHandler::makeMask (r1, "mask0"));
            mask1.set(True);
            r1.defineRegion ("mask0", ImageRegion(mask1), RegionHandler::Masks);
            r1.setDefaultMask("mask0");
            LCPagedMask mask2 = LCPagedMask(RegionHandler::makeMask (i1, "mask0"));
            mask2.set(True);
            i1.defineRegion ("mask0", ImageRegion(mask1), RegionHandler::Masks);
            i1.setDefaultMask("mask0");
         }
    //
    // FFT
   
         ImageFFT fft;
         fft.fftsky(im1);
   
    // The coordinates and mask will be updated
   
         fft.getReal(r1);
         fft.getImag(i1);

Motivation

Taking the Fourier Transform of an image is a basic part of image analysis

To Do

Definition at line 129 of file ImageFFT.h.


Constructor & Destructor Documentation

Default constructor.

casa::ImageFFT::ImageFFT ( const ImageFFT other)

Copy constructor (reference semantics)

Destructor.


Member Function Documentation

void casa::ImageFFT::checkAxes ( const CoordinateSystem cSys,
uInt  ndim,
const Vector< Bool > &  axes 
) [private]

Check axes for multi-dim FFT.

void casa::ImageFFT::copyMask ( ImageInterface< Float > &  out) const [private]

Copy the mask to the output.

void casa::ImageFFT::copyMask ( ImageInterface< Complex > &  out) const [private]
void casa::ImageFFT::copyMask ( ImageInterface< Float > &  out,
const ImageInterface< Float > &  in 
) const [private]
void casa::ImageFFT::copyMask ( ImageInterface< Float > &  out,
const ImageInterface< Complex > &  in 
) const [private]
void casa::ImageFFT::copyMask ( ImageInterface< Complex > &  out,
const ImageInterface< Float > &  in 
) const [private]
void casa::ImageFFT::copyMask ( ImageInterface< Complex > &  out,
const ImageInterface< Complex > &  in 
) const [private]
void casa::ImageFFT::copyMiscellaneous ( ImageInterface< Float > &  out) const [private]

Copy MiscInfo, ImageInfo, Unit, logSInk to output.

void casa::ImageFFT::copyMiscellaneous ( ImageInterface< Complex > &  out) const [private]
void casa::ImageFFT::fft ( const ImageInterface< Float > &  in,
const Vector< Bool > &  axes 
)

Do the FFT of the specified pixel axes (True to FT).

The rest are iterated over. Masked pixels are set to zero before the FT

void casa::ImageFFT::fft ( const ImageInterface< Complex > &  in,
const Vector< Bool > &  axes 
)

Do the FFT of the specified pixel axes (True to FT).

The rest are iterated over Masked pixels are set to zero before the FT

void casa::ImageFFT::fft2 ( ImageInterface< Complex > &  out,
const ImageInterface< Float > &  in,
const Vector< Bool > &  axes 
) [private]

FFT (Float) given axes.

void casa::ImageFFT::fft3 ( ImageInterface< Complex > &  out,
const ImageInterface< Complex > &  in,
const Vector< Bool > &  axes 
) [private]

FFT (Complex) given axes.

void casa::ImageFFT::fftsky ( const ImageInterface< Float > &  in)

Do the FFT of the sky plane to the uv plane Masked pixels are set to zero before the FT.

void casa::ImageFFT::fftsky2 ( ImageInterface< Complex > &  out,
const ImageInterface< Float > &  in,
const Vector< Int > &  pixelAxes 
) [private]

FFT the sky.

Bool casa::ImageFFT::findSky ( LogIO os,
Int dC,
Vector< Int > &  pixelAxes,
Vector< Int > &  worldAxes,
const CoordinateSystem cSys,
Bool  throwIt 
) [private]

Find the sky axes in this CoordinateSystem.

void casa::ImageFFT::getComplex ( ImageInterface< Complex > &  out) const

Return the FFT (from the last call to fftsky or fft) in the desired form.

The CoordinateSystem, MiscInfo, ImageInfo, history and units are copied/updated in the output image from the image that was FFTd. If the input image is masked, and the output image has a writable mask, the mask will be transferred. Any output mask should be initialized to True before calling these functions.

void casa::ImageFFT::getPhase ( ImageInterface< Float > &  out) const
void casa::ImageFFT::getReal ( ImageInterface< Float > &  out) const
ImageFFT& casa::ImageFFT::operator= ( const ImageFFT other)

Assignment (reference semantics)

void casa::ImageFFT::setCoordinates ( LogIO os,
ImageInterface< Complex > &  out,
const CoordinateSystem cSys,
const Vector< Bool > &  axes,
const IPosition shape 
) [private]

Overwrite the coordinate system with Fourier coordinates for all desginated axes.

void casa::ImageFFT::setSkyCoordinates ( LogIO os,
ImageInterface< Complex > &  out,
const ImageInterface< Float > &  in,
uInt  dC 
) [private]

Overwrite the coordinate system with Fourier coordinates for sky axes only.


Member Data Documentation

Definition at line 181 of file ImageFFT.h.

Definition at line 180 of file ImageFFT.h.

Definition at line 179 of file ImageFFT.h.

 

Definition at line 178 of file ImageFFT.h.


The documentation for this class was generated from the following file: