Package gov.nih.mipav.model.algorithms
Class HartleyTransform
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.HartleyTransform
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class HartleyTransform extends AlgorithmBase
The MIT License (MIT) Copyright (c) 2015 Eugeniy Sokol Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
Field Summary
Fields Modifier and Type Field Description private static double
cos22
private static double
cos45
private int[]
fht_instance_count
private int[]
fht_revbin_counts
private int[][]
fht_revbin_tables
private double[][]
fht_trig_tables
private ModelImage
inverseImage
private int
ldn
private static double
pi
private static double
pi4
private static double
sin22
private int
size
private static double
sqrt2
private ModelImage
transformImage
-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description HartleyTransform()
HartleyTransform(int size)
HartleyTransform(ModelImage transformImage, ModelImage inverseImage, ModelImage srcImg)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addsub(double[] u, double[] v)
private void
addsub(double[] u, double[] v, double scale)
void
back_transform(double[] fht_data)
void
finalize()
Calls garbage collector to release system resources.double[]
get_frequency(double[] fht_data, int number)
void
hartley_multiply(double[] fht_data, double[] fht_fir, boolean scaled)
private void
revbin_permute(double[] data)
private void
rotate(double[] u, double[] v, double c, double s)
void
runAlgorithm()
Actually runs the algorithm.void
show(double[] data, int size)
private void
step_addsub(double[] data, int ldn)
private void
step_addsub4(double[] data)
private void
step_addsub8(double[] data)
private void
step_rotate(double[] data, int ldn)
private void
step_rotate8(double[] data)
void
testHartley()
void
transform(double[] data, boolean scaled)
private double
zabs(double zr, double zi)
zabs computes the absolute value or magnitude of a double precision complex variable zr + j*zi.-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
transformImage
private ModelImage transformImage
-
inverseImage
private ModelImage inverseImage
-
pi
private static final double pi
- See Also:
- Constant Field Values
-
pi4
private static final double pi4
- See Also:
- Constant Field Values
-
sqrt2
private static final double sqrt2
- See Also:
- Constant Field Values
-
cos45
private static final double cos45
- See Also:
- Constant Field Values
-
cos22
private static final double cos22
- See Also:
- Constant Field Values
-
sin22
private static final double sin22
- See Also:
- Constant Field Values
-
fht_instance_count
private int[] fht_instance_count
-
fht_trig_tables
private double[][] fht_trig_tables
-
fht_revbin_tables
private int[][] fht_revbin_tables
-
fht_revbin_counts
private int[] fht_revbin_counts
-
size
private int size
-
ldn
private int ldn
-
-
Constructor Detail
-
HartleyTransform
public HartleyTransform()
-
HartleyTransform
public HartleyTransform(int size)
-
HartleyTransform
public HartleyTransform(ModelImage transformImage, ModelImage inverseImage, ModelImage srcImg)
-
-
Method Detail
-
finalize
public void finalize()
Description copied from class:AlgorithmBase
Calls garbage collector to release system resources.- Overrides:
finalize
in classAlgorithmBase
-
show
public void show(double[] data, int size)
-
testHartley
public void testHartley()
-
transform
public void transform(double[] data, boolean scaled)
-
back_transform
public void back_transform(double[] fht_data)
-
hartley_multiply
public void hartley_multiply(double[] fht_data, double[] fht_fir, boolean scaled)
-
get_frequency
public double[] get_frequency(double[] fht_data, int number)
-
revbin_permute
private void revbin_permute(double[] data)
-
step_addsub
private void step_addsub(double[] data, int ldn)
-
step_rotate
private void step_rotate(double[] data, int ldn)
-
step_addsub8
private void step_addsub8(double[] data)
-
step_rotate8
private void step_rotate8(double[] data)
-
step_addsub4
private void step_addsub4(double[] data)
-
addsub
private void addsub(double[] u, double[] v)
-
addsub
private void addsub(double[] u, double[] v, double scale)
-
rotate
private void rotate(double[] u, double[] v, double c, double s)
-
zabs
private double zabs(double zr, double zi)
zabs computes the absolute value or magnitude of a double precision complex variable zr + j*zi.- Parameters:
zr
- doublezi
- double- Returns:
- double
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBase
Actually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithm
in classAlgorithmBase
-
-