DocumentationHoloJProcessorHoloJUtils

holoj
Class HoloJProcessor

java.lang.Object
  extended byholoj.HoloJProcessor

public class HoloJProcessor
extends java.lang.Object

Class HoloJProcessor contains data and methods to provide high level access and manipulation to complex valued pixel data.


Constructor Summary
HoloJProcessor(double[] realPixels, double[] complexPixels, int width, int height)
          Creates a new object of the HoloJProcessor class.
HoloJProcessor(double[] realPixels, int width, int height)
          Creates a new object of the HoloJProcessor class.
HoloJProcessor(ij.process.ImageProcessor ip)
          Creates a new object of the class HoloJProcessor.
HoloJProcessor(ij.process.ImageProcessor realIp, ij.process.ImageProcessor complexIp)
          Creates a new object of the class HoloJProcessor, starting from data contained in the two ImageProcessors provided.
HoloJProcessor(int width, int height)
          Creates a new object of the class HoloJProcessor.
 
Method Summary
 void add(double[] operandArray)
          Add to complex pixels the scalar data in operand array.
 void add(HoloJProcessor operand)
          Adds the complex pixels of operand HoloJProcessor to real and complex pixels.
 void add(ij.process.ImageProcessor operand)
          Add to real pixels the real pixels of operand ImageProcessor.
 void addPhase(double angle)
          Add to complex pixels phase the specified radians.
 void addPhasePlate(double[] plateArray)
          Add to complex pixels the phase plate specified by the double array.
 ij.process.FloatProcessor createAmplitudeProcessor()
          Creates a amplitude ImageProcessor from realPixels and complexPixels.
 ij.process.FloatProcessor createPhaseProcessor()
          Creates a phase ImageProcessor from realPixels and complexPixels.
 ij.process.FloatProcessor createPowerSpectrumProcessor()
          Creates a power spectrum ImageProcessor from realPixels and complexPixels.
 ij.process.FloatProcessor createSpectrumProcessor()
          Creates a spectrum ImageProcessor from realPixels and complexPixels.
 void divide(double[] operandArray)
          Divide complex pixels by scalar data in operand array.
 void divide(HoloJProcessor operand)
          Divides real and complex pixels by the complex pixels of operand HoloJProcessor.
 void divide(ij.process.ImageProcessor operand)
          Divide the real and complex pixels by the real pixels of operand ImageProcessor.
 void doFFT()
          Perform Fast Fourier Transform, in the forward direction of data stored in real and complex pixels.
 void doInverseFFT()
          Perform Fast Fourier Transform, in the backward direction of data stored in real and complex pixels.
 ij.measure.Calibration getCalibration()
          Return the calibration of this HoloJPpocessor.
 double[] getComplexPixelsArray()
          Returns a double array containing the complex pixels in row major mode.
 int getHeight()
          Returns the height of the image.
 java.awt.Point getMaximumPosition()
          Finds the maximum of the modulus of realPixels and complexPixels.
 java.awt.Point getMaximumPosition(ij.gui.Roi selection)
          Finds the maximum of the modulus of realPixels and complexPixels in the region specified by the selection.
 double[] getRealPixelsArray()
          Returns a double array containing the real pixels in row major mode.
 HoloJProcessor getSideband(java.awt.Point sideCenter, int radius, int scaleFactor, boolean useButterworth)
          Returns an HoloJProcessor containing the selected sideband data.
 java.awt.Point getSidebandCenter(int side)
          Finds the position of the maximum lateral peak of the spectrum.
 int getSize()
          Returns the size of the image.
 java.lang.String getTitle()
          Return the title of this HoloJProcessor.
 int getWidth()
          Returns the width of the image.
 boolean isSpectrumDomain()
          Returns true if the image has being Fourier transformed.
 ij.ImagePlus makeAmplitudeImage(java.lang.String title)
          Creates an ImagePlus with the amplitude of data.
 ij.ImagePlus makePhaseImage(java.lang.String title)
          Creates an ImagePlus with the phase of data.
 ij.ImagePlus makePowerSpectrumImage(java.lang.String title)
          Creates an ImagePlus with the power spectrum of data.
 ij.ImagePlus makeSpectrumImage(java.lang.String title)
          Creates an ImagePlus with the spectrum of data.
 void multiply(double[] operandArray)
          Multiply complex pixels by scalar data in operand array.
 void multiply(HoloJProcessor operand)
          Multiplies real and complex pixels by the complex pixels of operand HoloJProcessor.
 void multiply(ij.process.ImageProcessor operand)
          Multiplies real and complex pixels by the scalar pixels of operand ImageProcessor.
 void setCalibration(ij.measure.Calibration newCal)
          Set the calibration of this HoloJProcessor to new calibration.
 void setComplexOrigin()
          Set origin of this HoloJProcessor to Complex.
 void setComplexPixelsArray(double[] pixels)
          Sets complex pixels from a double array of data in row major mode.
 void setRealOrigin()
          Set origin of this HoloJProcessor to Real.
 void setRealPixelsArray(double[] pixels)
          Sets real pixels from a double array of data in row major mode.
 void setTitle(java.lang.String newTitle)
          Set the title of this HoloJProcesor to new title.
 void show(java.lang.String title)
          Creates and shows an ImagePlus containing the power spectrum.
 void showAmplitude(java.lang.String title)
          Creates and show an ImagePlus displaying the amplitude of data.
 void showPhase(java.lang.String title)
          Creates and show an ImagePlus displaying the phase of data.
 void showPowerSpectrum(java.lang.String title)
          Creates and show an ImagePlus displaying the power spectrum of data.
 void showSpectrum(java.lang.String title)
          Creates and show an ImagePlus displaying the spectrum of data.
 void subtract(double[] operandArray)
          Subtract to complex pixels the scalar data in operand array.
 void subtract(HoloJProcessor operand)
          Subtracts the complex pixels of operand HoloJProcessor to real and complex pixels.
 void subtract(ij.process.ImageProcessor operand)
          Subtract to real pixels, the real pixels of operand ImageProcessor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HoloJProcessor

public HoloJProcessor(int width,
                      int height)
Creates a new object of the class HoloJProcessor. The size of the image are given as parameter. The data pixels are empty and are not initialized.

Parameters:
width - the size of the image along the X-axis
height - the size of the image along the Y-axis

HoloJProcessor

public HoloJProcessor(ij.process.ImageProcessor ip)
Creates a new object of the class HoloJProcessor. Data is retrieved from ImageProcessor given as argument. ImageProcessor data fill the real pixels data, while complex data is empty and not initialized.

Parameters:
ip - ImageProcessor providing real data value.

HoloJProcessor

public HoloJProcessor(ij.process.ImageProcessor realIp,
                      ij.process.ImageProcessor complexIp)
Creates a new object of the class HoloJProcessor, starting from data contained in the two ImageProcessors provided.

Parameters:
realIp - ImageProcessor providing real data value.
complexIp - ImageProcessor providing complex data value.

HoloJProcessor

public HoloJProcessor(double[] realPixels,
                      double[] complexPixels,
                      int width,
                      int height)
Creates a new object of the HoloJProcessor class. Data is provided by two double array containing real and complex pixels.

Parameters:
realPixels - real pixels array.
complexPixels - complex pixels array.
width - image width.
height - image height.

HoloJProcessor

public HoloJProcessor(double[] realPixels,
                      int width,
                      int height)
Creates a new object of the HoloJProcessor class. Data is provided by double array containing real pixels.

Parameters:
realPixels - real pixels array.
width - image width.
height - image height.
Method Detail

getRealPixelsArray

public double[] getRealPixelsArray()
Returns a double array containing the real pixels in row major mode.

Returns:
the pixels array.

getComplexPixelsArray

public double[] getComplexPixelsArray()
Returns a double array containing the complex pixels in row major mode.

Returns:
the pixels array.

setRealPixelsArray

public void setRealPixelsArray(double[] pixels)
Sets real pixels from a double array of data in row major mode.

Parameters:
pixels - the pixels array.

setComplexPixelsArray

public void setComplexPixelsArray(double[] pixels)
Sets complex pixels from a double array of data in row major mode.

Parameters:
pixels - the pixels array.

getSize

public int getSize()
Returns the size of the image.

Returns:
the image size.

getWidth

public int getWidth()
Returns the width of the image.

Returns:
the image width.

getHeight

public int getHeight()
Returns the height of the image.

Returns:
the image height.

isSpectrumDomain

public boolean isSpectrumDomain()
Returns true if the image has being Fourier transformed.

Returns:
true if image is in spectrum domain.

add

public void add(HoloJProcessor operand)
Adds the complex pixels of operand HoloJProcessor to real and complex pixels.

Parameters:
operand - theHoloJProcessorr operand.

subtract

public void subtract(HoloJProcessor operand)
Subtracts the complex pixels of operand HoloJProcessor to real and complex pixels.

Parameters:
operand - theHoloJProcessorr operand.

multiply

public void multiply(HoloJProcessor operand)
Multiplies real and complex pixels by the complex pixels of operand HoloJProcessor.

Parameters:
operand - theHoloJProcessorr operand.

multiply

public void multiply(ij.process.ImageProcessor operand)
Multiplies real and complex pixels by the scalar pixels of operand ImageProcessor.

Parameters:
operand - the ImageProcessor operand.

add

public void add(ij.process.ImageProcessor operand)
Add to real pixels the real pixels of operand ImageProcessor.

Parameters:
operand - the ImageProcessor operand.

subtract

public void subtract(ij.process.ImageProcessor operand)
Subtract to real pixels, the real pixels of operand ImageProcessor.

Parameters:
operand - the ImageProcessor operand.

divide

public void divide(ij.process.ImageProcessor operand)
Divide the real and complex pixels by the real pixels of operand ImageProcessor.

Parameters:
operand - the ImageProcessor operand.

multiply

public void multiply(double[] operandArray)
Multiply complex pixels by scalar data in operand array.

Parameters:
operandArray - the array operand.

divide

public void divide(double[] operandArray)
Divide complex pixels by scalar data in operand array.

Parameters:
operandArray - the array operand.

add

public void add(double[] operandArray)
Add to complex pixels the scalar data in operand array.

Parameters:
operandArray - the array operand.

subtract

public void subtract(double[] operandArray)
Subtract to complex pixels the scalar data in operand array.

Parameters:
operandArray - the array operand.

divide

public void divide(HoloJProcessor operand)
Divides real and complex pixels by the complex pixels of operand HoloJProcessor.

Parameters:
operand - the HoloJProcessor operand.

addPhase

public void addPhase(double angle)
Add to complex pixels phase the specified radians.

Parameters:
angle - radians to add.

addPhasePlate

public void addPhasePlate(double[] plateArray)
Add to complex pixels the phase plate specified by the double array.

Parameters:
plateArray - the array of radians to add.

setRealOrigin

public void setRealOrigin()
Set origin of this HoloJProcessor to Real.


setComplexOrigin

public void setComplexOrigin()
Set origin of this HoloJProcessor to Complex.


setCalibration

public void setCalibration(ij.measure.Calibration newCal)
Set the calibration of this HoloJProcessor to new calibration.

Parameters:
newCal - new calibration to apply.

getCalibration

public ij.measure.Calibration getCalibration()
Return the calibration of this HoloJPpocessor.

Returns:
the calibration.

setTitle

public void setTitle(java.lang.String newTitle)
Set the title of this HoloJProcesor to new title.

Parameters:
newTitle - the new title to use.

getTitle

public java.lang.String getTitle()
Return the title of this HoloJProcessor.

Returns:
the title.

doFFT

public void doFFT()
Perform Fast Fourier Transform, in the forward direction of data stored in real and complex pixels. If source image is real, performes a RealToComplex transform using IJ FHT class.


doInverseFFT

public void doInverseFFT()
Perform Fast Fourier Transform, in the backward direction of data stored in real and complex pixels.


show

public void show(java.lang.String title)
Creates and shows an ImagePlus containing the power spectrum. The method uses showPowerSpectrum.

Parameters:
title - title for the image displayied.

showPowerSpectrum

public void showPowerSpectrum(java.lang.String title)
Creates and show an ImagePlus displaying the power spectrum of data.

Parameters:
title - the title of the displayied image.

showSpectrum

public void showSpectrum(java.lang.String title)
Creates and show an ImagePlus displaying the spectrum of data.

Parameters:
title - the title of the displayied image.

showAmplitude

public void showAmplitude(java.lang.String title)
Creates and show an ImagePlus displaying the amplitude of data.

Parameters:
title - the title of the displayied image.

showPhase

public void showPhase(java.lang.String title)
Creates and show an ImagePlus displaying the phase of data.

Parameters:
title - the title of the displayied image.

makePowerSpectrumImage

public ij.ImagePlus makePowerSpectrumImage(java.lang.String title)
Creates an ImagePlus with the power spectrum of data.

Parameters:
title - the title of the image.

makeSpectrumImage

public ij.ImagePlus makeSpectrumImage(java.lang.String title)
Creates an ImagePlus with the spectrum of data.

Parameters:
title - the title of the image.

makeAmplitudeImage

public ij.ImagePlus makeAmplitudeImage(java.lang.String title)
Creates an ImagePlus with the amplitude of data.

Parameters:
title - the title of the image.

makePhaseImage

public ij.ImagePlus makePhaseImage(java.lang.String title)
Creates an ImagePlus with the phase of data.

Parameters:
title - the title of the image.

createPowerSpectrumProcessor

public ij.process.FloatProcessor createPowerSpectrumProcessor()
Creates a power spectrum ImageProcessor from realPixels and complexPixels.

Returns:
the FloatProcessor

createSpectrumProcessor

public ij.process.FloatProcessor createSpectrumProcessor()
Creates a spectrum ImageProcessor from realPixels and complexPixels.

Returns:
the FloatProcessor

createAmplitudeProcessor

public ij.process.FloatProcessor createAmplitudeProcessor()
Creates a amplitude ImageProcessor from realPixels and complexPixels.

Returns:
the FloatProcessor

createPhaseProcessor

public ij.process.FloatProcessor createPhaseProcessor()
Creates a phase ImageProcessor from realPixels and complexPixels.

Returns:
the FloatProcessor

getMaximumPosition

public java.awt.Point getMaximumPosition()
Finds the maximum of the modulus of realPixels and complexPixels.

Returns:
the maximum position.

getMaximumPosition

public java.awt.Point getMaximumPosition(ij.gui.Roi selection)
Finds the maximum of the modulus of realPixels and complexPixels in the region specified by the selection.

Parameters:
selection - selected area of the pixels.
Returns:
the maximum position.

getSidebandCenter

public java.awt.Point getSidebandCenter(int side)
Finds the position of the maximum lateral peak of the spectrum. The method search for the maximum of the spectrum excluding a circular region of radius 20 pixels centered around the origin of the spectrum.

Parameters:
side - side of the spectrum where to look for the maximum.
Returns:
the sideband position.

getSideband

public HoloJProcessor getSideband(java.awt.Point sideCenter,
                                  int radius,
                                  int scaleFactor,
                                  boolean useButterworth)
Returns an HoloJProcessor containing the selected sideband data.

Parameters:
sideCenter - Point of sideband center.
radius - radius of the selected region.
scaleFactor - scale factor of final reconstructed image.
useButterworth - flag for using soft aperture.
Returns:
the selected sideband.

Creative Commons License Valid XHTML 1.0! Valid CSS!

Permission to use the software and accompanying documentation provided on these pages for educational, research, and not-for-profit purposes, without fee and without a signed licensing agreement, is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies. The copyright holder is free to make upgraded or improved versions of the software available for a fee or commercially only. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OF ANY KIND WHATSOEVER, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF HE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION IS PROVIDED "AS IS". THE COPYRIGHT HOLDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.