Class ImRegPOC
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.registration.ImRegPOC
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class ImRegPOC extends AlgorithmBase
- Author:
- aailb This is a port of the MATLAB code poc_prototype.m by Yoshi Ri at the University of Tokyo updated on 2017/8/11. This code is ported to Java with the 2-clause BSD license: The 2-clause BSD License Copyright (c) 2018, Yoshi Ri All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. The warpPolar routine is derived from warpPolar in the Open Source Computer Vision Library with the license: /*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, install, // copy or use the software. // // // License Agreement // For Open Source Computer Vision Library // // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. // Copyright (C) 2009, Willow Garage Inc., all rights reserved. // Copyright (C) 2014-2015, Itseez Inc., all rights reserved. // Third party copyrights are property of their respective owners. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistribution's of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // * Redistribution's in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // * The name of the copyright holders may not be used to endorse or promote products // derived from this software without specific prior written permission. // // This software is provided by the copyright holders and contributors "as is" and // any express or implied warranties, including, but not limited to, the implied // warranties of merchantability and fitness for a particular purpose are disclaimed. // In no event shall the Intel Corporation or contributors be liable for any direct, // indirect, incidental, special, exemplary, or consequential damages // (including, but not limited to, procurement of substitute goods or services; // loss of use, data, or profits; or business interruption) however caused // and on any theory of liability, whether in contract, strict liability, // or tort (including negligence or otherwise) arising in any way out of // the use of this software, even if advised of the possibility of such damage. // //M
-
-
Field Summary
Fields Modifier and Type Field Description private double
alpha
private double
beta
private double[]
hanw
private int
height
private ModelImage
inputImage
This image is to registered to the reference image.private boolean
isMATLABVersion
private int
length
private ModelImage
refImage
The inputImage will be registered to this reference image.private int
width
-
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 ImRegPOC(ModelImage dstImage, ModelImage imageA, ModelImage imageB)
ImRegPOC(ModelImage dstImage, ModelImage imageA, ModelImage imageB, double alpha, double beta)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private double[]
CenterOfGravity(double[][] mat)
private double[]
createHanningWindow()
private double[][]
fftshift(double[] in, int yDim, int xDim)
private double[][]
ImageRotateScale(double[][] Image, double theta, double scale, int width, int height)
private double[]
imtranslate(double[][] Image, double translateX, double translateY, double outOfBoundsValue)
private double
log2(double input)
private double[][]
PhaseCorrelation(double[] a, double[] b, double[] Diff, double[] peak)
private Jama.Matrix
poc2warp(double cx, double cy, double dx, double dy, double theta, double scale)
void
runAlgorithm()
Actually runs the algorithm.void
runMATLABVersion()
void
runPythonVersion()
private double[]
Warp_4dof(double[] Img, double dx, double dy, double theta, double scale, double outOfBoundsValue)
private double[]
WeightedCOG(double[][] mat)
-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, 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
-
refImage
private ModelImage refImage
The inputImage will be registered to this reference image.
-
inputImage
private ModelImage inputImage
This image is to registered to the reference image.
-
height
private int height
-
width
private int width
-
length
private int length
-
isMATLABVersion
private boolean isMATLABVersion
-
alpha
private double alpha
-
beta
private double beta
-
hanw
private double[] hanw
-
-
Constructor Detail
-
ImRegPOC
public ImRegPOC(ModelImage dstImage, ModelImage imageA, ModelImage imageB)
-
ImRegPOC
public ImRegPOC(ModelImage dstImage, ModelImage imageA, ModelImage imageB, double alpha, double beta)
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBase
Actually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithm
in classAlgorithmBase
-
runPythonVersion
public void runPythonVersion()
-
Warp_4dof
private double[] Warp_4dof(double[] Img, double dx, double dy, double theta, double scale, double outOfBoundsValue)
-
poc2warp
private Jama.Matrix poc2warp(double cx, double cy, double dx, double dy, double theta, double scale)
-
PhaseCorrelation
private double[][] PhaseCorrelation(double[] a, double[] b, double[] Diff, double[] peak)
-
WeightedCOG
private double[] WeightedCOG(double[][] mat)
-
CenterOfGravity
private double[] CenterOfGravity(double[][] mat)
-
createHanningWindow
private double[] createHanningWindow()
-
runMATLABVersion
public void runMATLABVersion()
-
imtranslate
private double[] imtranslate(double[][] Image, double translateX, double translateY, double outOfBoundsValue)
-
ImageRotateScale
private double[][] ImageRotateScale(double[][] Image, double theta, double scale, int width, int height)
-
log2
private double log2(double input)
-
fftshift
private double[][] fftshift(double[] in, int yDim, int xDim)
-
-