requires("1.37e");
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// MRNSD
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
pathToBlurredImage = "D:/Research/Images/grain-blur.png";
pathToPsf = "D:/Research/Images/grain-psf.png";
pathToDeblurredImage = "D:/Research/Images/grain-deblurred-mrnsd.png";
preconditioner = "FFT"; //available options: FFT, NONE
preconditionerTol = "-1"; //if -1, then GCV is used to compute preconditionerTol
boundary = "REFLEXIVE"; //available options: REFLEXIVE, PERIODIC, ZERO
resizing = "AUTO"; // available options: AUTO, MINIMAL, NEXT_POWER_OF_TWO
output = "SAME_AS_SOURCE"; // available options: SAME_AS_SOURCE, BYTE, SHORT, FLOAT 
precision = "SINGLE"; //available options: SINGLE, DOUBLE
stoppingTol = "-1"; //if -1, then stoppingTol is computed automatically
threshold = "-1"; //if -1, then disabled
logConvergence = "false";
maxIters = "5";
nOfThreads = "2";
showIter = "false";
call("edu.emory.mathcs.restoretools.iterative.ParallelIterativeDeconvolution2D.deconvolveMRNSD", pathToBlurredImage, pathToPsf, pathToDeblurredImage, preconditioner, preconditionerTol, boundary, resizing, output, precision, stoppingTol, threshold, logConvergence, maxIters, nOfThreads, showIter);
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// CGLS
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
pathToBlurredImage = "D:/Research/Images/grain-blur.png";
pathToPsf = "D:/Research/Images/grain-psf.png";
pathToDeblurredImage = "D:/Research/Images/grain-deblurred-cgls.png";
preconditioner = "FFT"; //available options: FFT, NONE
preconditionerTol = "-1"; //if -1, then GCV is used to compute preconditionerTol
boundary = "REFLEXIVE"; //available options: REFLEXIVE, PERIODIC, ZERO
resizing = "AUTO"; // available options: AUTO, MINIMAL, NEXT_POWER_OF_TWO
output = "SAME_AS_SOURCE"; // available options: SAME_AS_SOURCE, BYTE, SHORT, FLOAT  
precision = "SINGLE"; //available options: SINGLE, DOUBLE
stoppingTol = "-1"; //if -1, then stoppingTol is computed automatically
threshold = "0"; //if -1, then disabled
logConvergence = "false";
maxIters = "5";
nOfThreads = "2";
showIter = "false";
call("edu.emory.mathcs.restoretools.iterative.ParallelIterativeDeconvolution2D.deconvolveCGLS", pathToBlurredImage, pathToPsf, pathToDeblurredImage, preconditioner, preconditionerTol, boundary, resizing, output, precision, stoppingTol, threshold, logConvergence, maxIters, nOfThreads, showIter);
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// WPL
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
pathToBlurredImage = "D:/Research/Images/grain-blur.png";
pathToPsf = "D:/Research/Images/grain-psf.png";
pathToDeblurredImage = "D:/Research/Images/grain-deblurred-wpl.png";
boundary = "REFLEXIVE"; //available options: REFLEXIVE, PERIODIC, ZERO
resizing = "AUTO"; // available options: AUTO, MINIMAL, NEXT_POWER_OF_TWO
output = "SAME_AS_SOURCE"; // available options: SAME_AS_SOURCE, BYTE, SHORT, FLOAT  
precision = "SINGLE"; //available options: SINGLE, DOUBLE
threshold = "-1"; //if -1, then disabled
maxIters = "5";
nOfThreads = "2";
showIter = "false";
gamma = "0";
filterXY = "1.0";
normalize = "false";
logMean = "false";
antiRing = "true";
changeThreshPercent = "0.01";
db = "false";
detectDivergence = "true";
call("edu.emory.mathcs.restoretools.iterative.ParallelIterativeDeconvolution2D.deconvolveWPL", pathToBlurredImage, pathToPsf, pathToDeblurredImage, boundary, resizing, output, precision, threshold, maxIters, nOfThreads, showIter, gamma, filterXY, normalize, logMean, antiRing, changeThreshPercent, db, detectDivergence);
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// HyBR
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
pathToBlurredImage = "D:/Research/Images/grain-blur.png";
pathToPsf = "D:/Research/Images/grain-psf.png";
pathToDeblurredImage = "D:/Research/Images/grain-deblurred-hybr.png";
preconditioner = "FFT"; //available options: FFT, NONE
preconditionerTol = "-1"; //if -1, then GCV is used to compute preconditionerTol
boundary = "REFLEXIVE"; //available options: REFLEXIVE, PERIODIC, ZERO
resizing = "AUTO"; // available options: AUTO, MINIMAL, NEXT_POWER_OF_TWO
output = "SAME_AS_SOURCE"; // available options: SAME_AS_SOURCE, BYTE, SHORT, FLOAT  
precision = "SINGLE"; //available options: SINGLE, DOUBLE
threshold = "0"; //if -1, then disabled
logConvergence = "false";
maxIters = "5";
nOfThreads = "2";
showIter = "false";
innerSolver = "TIKHONOV"; //available options: TIKHONOV, NONE
regMethod = "ADAPTWGCV"; //available options: GCV, WGCV, ADAPTWGCV, NONE
regParam = "-1"; //only used if regMethod = "NONE"
omega = "0"; //only used if regMethod = "WGCV"
reorth = "false";
beginReg = "2";
flatTol = "1e-4";
call("edu.emory.mathcs.restoretools.iterative.ParallelIterativeDeconvolution2D.deconvolveHyBR", pathToBlurredImage, pathToPsf, pathToDeblurredImage, preconditioner, preconditionerTol, boundary, resizing, output, precision, threshold, logConvergence, maxIters, nOfThreads, showIter, innerSolver, regMethod, regParam, omega, reorth, beginReg, flatTol);
