casa::ImageFFT Class Reference
FFT an image.
More...
#include <ImageFFT.h>
List of all members.
Public Member Functions |
| ImageFFT () |
| ImageFFT (const ImageFFT &other) |
ImageFFT & | operator= (const ImageFFT &other) |
| Assignment (reference semantics).
|
| ~ImageFFT () |
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 | fftsky (const ImageInterface< Complex > &in) |
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) |
void | _fftsky2 (ImageInterface< Complex > &out, const ImageInterface< Complex > &in, const Vector< Int > &pixelAxes) |
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 (Int &dC, Vector< Int > &pixelAxes, Vector< Int > &worldAxes, const CoordinateSystem &cSys, Bool throwIt) |
| Find the sky axes in this CoordinateSystem.
|
void | _setSkyCoordinates (ImageInterface< Complex > &out, const CoordinateSystem &csys, const IPosition &shape, uInt dC) |
| Overwrite the coordinate system with Fourier coordinates for sky axes only.
|
void | _setCoordinates (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 |
SPIIC | _tempImagePtr |
SPIIF | _floatImage |
SPIIC | _complexImage |
Bool | _done |
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
IPosition shape(2, 10, 20);
PagedImage<Float> im1(shape, CoordinateUtil::defaultCoords2D(), "im1");
im1.set(1.0);
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");
}
ImageFFT fft;
fft.fftsky(im1);
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 130 of file ImageFFT.h.
Constructor & Destructor Documentation
casa::ImageFFT::ImageFFT |
( |
|
) |
|
casa::ImageFFT::ImageFFT |
( |
const ImageFFT & |
other |
) |
|
casa::ImageFFT::~ImageFFT |
( |
|
) |
|
Member Function Documentation
void casa::ImageFFT::_fftsky2 |
( |
ImageInterface< Complex > & |
out, |
|
|
const ImageInterface< Complex > & |
in, |
|
|
const Vector< Int > & |
pixelAxes | |
|
) |
| | [private] |
void casa::ImageFFT::_fftsky2 |
( |
ImageInterface< Complex > & |
out, |
|
|
const ImageInterface< Float > & |
in, |
|
|
const Vector< Int > & |
pixelAxes | |
|
) |
| | [private] |
Bool casa::ImageFFT::_findSky |
( |
Int & |
dC, |
|
|
Vector< Int > & |
pixelAxes, |
|
|
Vector< Int > & |
worldAxes, |
|
|
const CoordinateSystem & |
cSys, |
|
|
Bool |
throwIt | |
|
) |
| | [private] |
Find the sky axes in this CoordinateSystem.
void casa::ImageFFT::_setCoordinates |
( |
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 |
( |
ImageInterface< Complex > & |
out, |
|
|
const CoordinateSystem & |
csys, |
|
|
const IPosition & |
shape, |
|
|
uInt |
dC | |
|
) |
| | [private] |
Overwrite the coordinate system with Fourier coordinates for sky axes only.
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< Complex > & |
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< Float > & |
out, |
|
|
const ImageInterface< Complex > & |
in | |
|
) |
| | const [private] |
void casa::ImageFFT::copyMask |
( |
ImageInterface< Float > & |
out, |
|
|
const ImageInterface< Float > & |
in | |
|
) |
| | const [private] |
void casa::ImageFFT::copyMask |
( |
ImageInterface< Complex > & |
out |
) |
const [private] |
void casa::ImageFFT::copyMask |
( |
ImageInterface< Float > & |
out |
) |
const [private] |
Copy the mask to the output.
void casa::ImageFFT::copyMiscellaneous |
( |
ImageInterface< Complex > & |
out |
) |
const [private] |
void casa::ImageFFT::copyMiscellaneous |
( |
ImageInterface< Float > & |
out |
) |
const [private] |
Copy MiscInfo, ImageInfo, Unit, logSInk to output.
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::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::fft2 |
( |
ImageInterface< Complex > & |
out, |
|
|
const ImageInterface< Float > & |
in, |
|
|
const Vector< Bool > & |
axes | |
|
) |
| | [private] |
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< Complex > & |
in |
) |
|
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::getAmplitude |
( |
ImageInterface< Float > & |
out |
) |
const |
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::getImaginary |
( |
ImageInterface< Float > & |
out |
) |
const |
void casa::ImageFFT::getPhase |
( |
ImageInterface< Float > & |
out |
) |
const |
void casa::ImageFFT::getReal |
( |
ImageInterface< Float > & |
out |
) |
const |
Assignment (reference semantics).
Member Data Documentation
The documentation for this class was generated from the following file: