jm.jigl
Class ComplexImage

java.lang.Object
  |
  +--jm.jigl.ComplexImage
All Implemented Interfaces:
Image

public class ComplexImage
extends java.lang.Object
implements Image

A complex image is a set of two real gray image planes.

ComplexImage implements Image

See Also:
jigl.image.ComplexImage

Field Summary
protected  RealGrayImage imag
          The Imaginary part of the image
protected  RealGrayImage real
          The Real plane of the image
protected  int X
          Cartesian width of the image
protected  int Y
          Cartesian height of the image
 
Constructor Summary
ComplexImage()
          Creates a ComplexImage with height and width of zero and the real and imaginary planes set to null
ComplexImage(ComplexImage img)
          Creates a ComplexImage as a shallow copy of a complex image
ComplexImage(java.awt.Image img)
          Creates a ComplexImage from the standard java.awt.Image
ComplexImage(int x, int y)
          Creates a ComplexImage with height and width of x and y repectively
 
Method Summary
 void add(ComplexImage im)
          Adds another ComplexImage to this image
 void add(ComplexImage im, ROI sourceImage, ROI destImage)
          Adds a Region of Interest in another GrayImage from a Region of Interest of this image
 ComplexImage add(float r, float i)
          Adds a value to all the pixels in this image
 ComplexImage add(float r, float i, ROI r2)
          Adds a value to all the pixels in a Region of Interest
 void add(int x, int y, float r, float i)
          Adds a value to a single pixel
 void add(int x, int y, float r, float i, ROI r2)
          Adds a value to a single pixel in a Region of Interest
 Image copy()
          Makes a deep copy of this image
 Image copy(ROI r)
          Makes a deep copy of a Region of Interest
 ComplexImage diff(ComplexImage im)
          Subtracts a RealColorImage from this image and returns the absolute value
 void divide(ComplexImage im)
          Divides this image by another ComplexImage
 void divide(ComplexImage im, ROI sourceImage, ROI destImage)
          Divides by a Region of Interest in this image by a Region of Interest of another ComplexImage
 ComplexImage divide(float r, float i)
          Divides all the pixels by a value in this image
 ComplexImage divide(float r, float i, ROI r2)
          Divides all the pixels by a value in a Region of Interest
 void divide(int x, int y, float r, float i)
          Divide a single pixel by a value
 void divide(int x, int y, float r, float i, ROI r2)
          Divide a single pixel by a value in a Region of Interest
 float getImag(int x, int y)
          Returns the pixel value at the given x, y value of the imaginary plane
 float getImag(int x, int y, ROI r)
          Returns the pixel value at the given x, y value of a Region of Interest in the imaginary plane
 java.awt.image.ImageProducer getJavaImage()
          Returns the Java Image from this image
 RealGrayImage getMagnitudeImage()
          Returns the MagnitudeImage (RealGrayImage) of the this ComplexImage
 float getReal(int x, int y)
          Returns the pixel value at the given x, y value of the real plane
 float getReal(int x, int y, ROI r)
          Returns the pixel value at the given x, y value of a Region of Interest in the real plane
 RealGrayImage imag()
          Returns the imaginary plane of this image
 Complex max()
          Returns the maximum magnitude of the complex number in this image
 Complex max(ROI r)
          Returns the maximum magnitude of a Region of Interest
 Complex min()
          Returns the minimum magnitude of the complex number in this image
 Complex min(ROI r)
          Returns the minimum magnitude of a Region of Interest
 void multiply(ComplexImage im)
          Multiplies this image by another ComplexImage
 void multiply(ComplexImage im, ROI sourceImage, ROI destImage)
          Multiplies a Region of Interest of another GrayImage by a Region of Interest of this image
 ComplexImage multiply(float r, float i)
          Multiplies all the pixels in this image by a value
 ComplexImage multiply(float r, float i, ROI r2)
          Multiplies all the pixels by a value in a Region of Interest
 void multiply(int x, int y, float r, float i)
          Multiply a single pixel by a value
 void multiply(int x, int y, float r, float i, ROI r2)
          Multiply a single pixel by a value in a Region of Interest
 RealGrayImage real()
          Returns the real plane of this image
 void set(int x, int y, float r, float i)
          Sets the pixel value at x, y to a given value of this image
 void set(int x, int y, float r, float i, ROI r2)
          Sets the pixel value at x, y to a given value in a Region of Interest
 void setImag(int x, int y, float v)
          Sets the pixel value at x, y to a given value of the imaginary
 void setImag(int x, int y, float v, ROI r)
          Sets the pixel value at the given x, y value of a Region of Interest in the imaginary plane
 void setImag(RealGrayImage pl)
          Set the real plane of this image
 void setReal(int x, int y, float v)
          Sets the pixel value at x, y to a given value of the real plane
 void setReal(int x, int y, float v, ROI r)
          Sets tthe pixel value at the given x, y value of a Region of Interest in the real plane
 void setReal(RealGrayImage pl)
          Set the real plane of this image
 void subtract(ComplexImage im)
          Subtracts another ComplexImage from this image
 void subtract(ComplexImage im, ROI sourceImage, ROI destImage)
          Subtracts a Region of Interest in another GrayImage from a Region of Interest of this image
 ComplexImage subtract(float r, float i)
          Subtracts a value from all the pixels in this image
 ComplexImage subtract(float r, float i, ROI r2)
          Subtracts a value from all the pixels in a Region of Interest
 void subtract(int x, int y, float r, float i)
          Subtracts a value from a single pixel
 void subtract(int x, int y, float r, float i, ROI r2)
          Subtracts a value from a single pixel in a Region of Interest
 java.lang.String toString()
          Prints the image in integer format.
 java.lang.String toString(ROI r)
          Prints the Region of Interest in integer format.
 int X()
          Returns the width (maximum X value)
 int Y()
          Returns the height (maximum Y value)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

real

protected RealGrayImage real
The Real plane of the image


imag

protected RealGrayImage imag
The Imaginary part of the image


X

protected int X
Cartesian width of the image


Y

protected int Y
Cartesian height of the image

Constructor Detail

ComplexImage

public ComplexImage()
Creates a ComplexImage with height and width of zero and the real and imaginary planes set to null


ComplexImage

public ComplexImage(int x,
                    int y)
Creates a ComplexImage with height and width of x and y repectively


ComplexImage

public ComplexImage(ComplexImage img)
Creates a ComplexImage as a shallow copy of a complex image


ComplexImage

public ComplexImage(java.awt.Image img)
Creates a ComplexImage from the standard java.awt.Image

Method Detail

getJavaImage

public java.awt.image.ImageProducer getJavaImage()
Returns the Java Image from this image

Specified by:
getJavaImage in interface Image
See Also:
ImageProducer

X

public final int X()
Returns the width (maximum X value)

Specified by:
X in interface Image

Y

public final int Y()
Returns the height (maximum Y value)

Specified by:
Y in interface Image

copy

public Image copy()
Makes a deep copy of this image

Specified by:
copy in interface Image
Returns:
a deep copy of ComplexImage

real

public final RealGrayImage real()
Returns the real plane of this image


setReal

public final void setReal(RealGrayImage pl)
Set the real plane of this image

Parameters:
pl - the RealGrayImage to set the real plane to

imag

public final RealGrayImage imag()
Returns the imaginary plane of this image


setImag

public final void setImag(RealGrayImage pl)
Set the real plane of this image

Parameters:
pl - the RealGrayImage to set the real plane to

getReal

public final float getReal(int x,
                           int y)
Returns the pixel value at the given x, y value of the real plane

Parameters:
x - the X coordinant
y - the Y coordinant

getImag

public final float getImag(int x,
                           int y)
Returns the pixel value at the given x, y value of the imaginary plane

Parameters:
x - the X coordinant
y - the Y coordinant

setReal

public final void setReal(int x,
                          int y,
                          float v)
Sets the pixel value at x, y to a given value of the real plane

Parameters:
x - the X coordinant
y - the Y coordinant
v - the value to set the pixel to

setImag

public final void setImag(int x,
                          int y,
                          float v)
Sets the pixel value at x, y to a given value of the imaginary

Parameters:
x - the X coordinant
y - the Y coordinant
v - the value to set the pixel to

set

public final void set(int x,
                      int y,
                      float r,
                      float i)
Sets the pixel value at x, y to a given value of this image

Parameters:
x - the X coordinant
y - the Y coordinant
r - the value to set the pixel to in the real plane
i - the value to set the pixel to in the imaginary plane

min

public final Complex min()
Returns the minimum magnitude of the complex number in this image


max

public final Complex max()
Returns the maximum magnitude of the complex number in this image


add

public final void add(int x,
                      int y,
                      float r,
                      float i)
Adds a value to a single pixel

Parameters:
x - X-coordinant
y - Y-coordinant
r - the value to add to the pixel in the real plane
i - the value to add to the pixel in the imaginary plane

subtract

public final void subtract(int x,
                           int y,
                           float r,
                           float i)
Subtracts a value from a single pixel

Parameters:
x - X-coordinant
y - Y-coordinant
r - the value to add to the pixel in the real plane
i - the value to add to the pixel in the imaginary plane

multiply

public final void multiply(int x,
                           int y,
                           float r,
                           float i)
Multiply a single pixel by a value

Parameters:
x - X-coordinant
y - Y-coordinant
r - the value to add to the pixel in the real plane
i - the value to add to the pixel in the imaginary plane

divide

public final void divide(int x,
                         int y,
                         float r,
                         float i)
Divide a single pixel by a value

Parameters:
x - X-coordinant
y - Y-coordinant
r - the value to add to the pixel in the real plane
i - the value to add to the pixel in the imaginary plane

add

public final void add(ComplexImage im)
Adds another ComplexImage to this image

Parameters:
im - the ComplexImage to add
Returns:
this

subtract

public final void subtract(ComplexImage im)
Subtracts another ComplexImage from this image

Parameters:
im - the ComplexImage to subtract
Returns:
this

diff

public final ComplexImage diff(ComplexImage im)
Subtracts a RealColorImage from this image and returns the absolute value

Parameters:
im - the RealColorImage to diff
Returns:
this

multiply

public final void multiply(ComplexImage im)
Multiplies this image by another ComplexImage

Parameters:
im - the ComplexImage to multiply
Returns:
this

divide

public final void divide(ComplexImage im)
Divides this image by another ComplexImage

Parameters:
im - the ComplexImage to divide
Returns:
this

add

public final ComplexImage add(float r,
                              float i)
Adds a value to all the pixels in this image

Parameters:
r - value to be added to the pixels in the real plane
i - value to be added to the pixels in the imaginary plane
Returns:
this

subtract

public final ComplexImage subtract(float r,
                                   float i)
Subtracts a value from all the pixels in this image

Parameters:
r - value to be subtract from the pixels in the real plane
i - value to be subtracted from pixels in the imaginary plane
Returns:
this

multiply

public final ComplexImage multiply(float r,
                                   float i)
Multiplies all the pixels in this image by a value

Parameters:
r - value to be multiplied by the pixels in the real plane
i - value to be multiplied by the pixels in the imaginary plane
Returns:
this

divide

public final ComplexImage divide(float r,
                                 float i)
Divides all the pixels by a value in this image

Parameters:
r - value to be divided into the pixels in the real plane
i - value to be divided into the pixels in the imaginary plane
Returns:
this

toString

public java.lang.String toString()
Prints the image in integer format.
-Example of output on an image with width 100 and height 120:
100 : 120
5 23 54 7 3 23 46 253 23 53 65 34 ...
100 : 120
10 20 32 12 32 56 40 59 42 39 43 ...

Specified by:
toString in interface Image
Overrides:
toString in class java.lang.Object

copy

public Image copy(ROI r)
Makes a deep copy of a Region of Interest

Specified by:
copy in interface Image
Parameters:
r - Region of Interest
Returns:
a deep copy of ComplexImage
See Also:

getReal

public final float getReal(int x,
                           int y,
                           ROI r)
Returns the pixel value at the given x, y value of a Region of Interest in the real plane

Parameters:
x - the X coordinant
y - the Y coordinant
r - Region of Interest

getImag

public final float getImag(int x,
                           int y,
                           ROI r)
Returns the pixel value at the given x, y value of a Region of Interest in the imaginary plane

Parameters:
x - the X coordinant
y - the Y coordinant
r - Region of Interest

setReal

public final void setReal(int x,
                          int y,
                          float v,
                          ROI r)
Sets tthe pixel value at the given x, y value of a Region of Interest in the real plane

Parameters:
x - the X coordinant
y - the Y coordinant
r - Region of Interest

setImag

public final void setImag(int x,
                          int y,
                          float v,
                          ROI r)
Sets the pixel value at the given x, y value of a Region of Interest in the imaginary plane

Parameters:
x - the X coordinant
y - the Y coordinant
r - Region of Interest

set

public final void set(int x,
                      int y,
                      float r,
                      float i,
                      ROI r2)
Sets the pixel value at x, y to a given value in a Region of Interest

Parameters:
x - the X coordinant
y - the Y coordinant
r - the value to set the pixel to in the real plane
i - the value to set the pixel to in the imaginary plane
r2 - Region of Interest

min

public final Complex min(ROI r)
Returns the minimum magnitude of a Region of Interest

Parameters:
r - Region of Interest

max

public final Complex max(ROI r)
Returns the maximum magnitude of a Region of Interest

Parameters:
r - Region of Interest

add

public final void add(int x,
                      int y,
                      float r,
                      float i,
                      ROI r2)
Adds a value to a single pixel in a Region of Interest

Parameters:
x - X-coordinant
y - Y-coordinant
r - the value to add to the pixel in the real plane
i - the value to add to the pixel in the imaginary plane
r2 - Region of Interest

subtract

public final void subtract(int x,
                           int y,
                           float r,
                           float i,
                           ROI r2)
Subtracts a value from a single pixel in a Region of Interest

Parameters:
x - X-coordinant
y - Y-coordinant
r - the value to add to the pixel in the real plane
i - the value to add to the pixel in the imaginary plane
r2 - Region of Interest

multiply

public final void multiply(int x,
                           int y,
                           float r,
                           float i,
                           ROI r2)
Multiply a single pixel by a value in a Region of Interest

Parameters:
x - X-coordinant
y - Y-coordinant
r - the value to add to the pixel in the real plane
i - the value to add to the pixel in the imaginary plane
r2 - Region of Interest

divide

public final void divide(int x,
                         int y,
                         float r,
                         float i,
                         ROI r2)
Divide a single pixel by a value in a Region of Interest

Parameters:
x - X-coordinant
y - Y-coordinant
r - the value to add to the pixel in the real plane
i - the value to add to the pixel in the imaginary plane
r2 - Region of Interest

add

public final ComplexImage add(float r,
                              float i,
                              ROI r2)
Adds a value to all the pixels in a Region of Interest

Parameters:
r - value to be added to the pixels in the real plane
i - value to be added to the pixels in the imaginary plane
r2 - Region of Interest
Returns:
this

subtract

public final ComplexImage subtract(float r,
                                   float i,
                                   ROI r2)
Subtracts a value from all the pixels in a Region of Interest

Parameters:
r - value to be subtract from the pixels in the real plane
i - value to be subtracted from pixels in the imaginary plane
r2 - Region of Interest
Returns:
this

multiply

public final ComplexImage multiply(float r,
                                   float i,
                                   ROI r2)
Multiplies all the pixels by a value in a Region of Interest

Parameters:
r - value to be multiplied by the pixels in the real plane
i - value to be multiplied by the pixels in the imaginary plane
r2 - Region of Interest
Returns:
this

divide

public final ComplexImage divide(float r,
                                 float i,
                                 ROI r2)
Divides all the pixels by a value in a Region of Interest

Parameters:
r - value to be divided into the pixels in the real plane
i - value to be divided into the pixels in the imaginary plane
r2 - Region of Interest
Returns:
this

toString

public java.lang.String toString(ROI r)
Prints the Region of Interest in integer format.
-Example of output on an image with width 100 and height 120:
100 : 120
5 23 54 7 3 23 46 253 23 53 65 34 ...
100 : 120
10 20 32 12 32 56 40 59 42 39 43 ...

Parameters:
r - Region of Interest

add

public final void add(ComplexImage im,
                      ROI sourceImage,
                      ROI destImage)
Adds a Region of Interest in another GrayImage from a Region of Interest of this image

Parameters:
im - the ComplexImage to add
sourceImage - Region of Interest for the Source Image
destImage - Region of Interest for the Destination Image
Returns:
this

subtract

public final void subtract(ComplexImage im,
                           ROI sourceImage,
                           ROI destImage)
Subtracts a Region of Interest in another GrayImage from a Region of Interest of this image

Parameters:
im - the ComplexImage to subtract
sourceImage - Region of Interest for the Source Image
destImage - Region of Interest for the Destination Image
Returns:
this

multiply

public final void multiply(ComplexImage im,
                           ROI sourceImage,
                           ROI destImage)
Multiplies a Region of Interest of another GrayImage by a Region of Interest of this image

Parameters:
im - the ComplexImage to multiply
sourceImage - Region of Interest for the Source Image
destImage - Region of Interest for the Destination Image
Returns:
this

divide

public final void divide(ComplexImage im,
                         ROI sourceImage,
                         ROI destImage)
Divides by a Region of Interest in this image by a Region of Interest of another ComplexImage

Parameters:
im - the ComplexImage to divide
sourceImage - Region of Interest for the Source Image
destImage - Region of Interest for the Destination Image
Returns:
this

getMagnitudeImage

public final RealGrayImage getMagnitudeImage()
Returns the MagnitudeImage (RealGrayImage) of the this ComplexImage