matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.FFTSize);
// matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.FFTSize);
int sensor_type = 0; // EO
matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.getFFTSize(sensor_type));
// matchSimulatedPattern.invalidateFlatFieldForGrid(); //It is already reset, no need to do it again
// matchSimulatedPattern.invalidateFocusMask();
matchSimulatedPattern.calculateDistortions(
...
...
@@ -1829,7 +1834,9 @@ if (MORE_BUTTONS) {
IJ.showMessage("Error","There are no images open\nProcess canceled");
return;
}
matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.FFTSize);
// matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.FFTSize);
int sensor_type = 0; // EO
matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.getFFTSize(sensor_type));
matchSimulatedPattern.debugLevel=DEBUG_LEVEL;
matchSimulatedPattern.distortionsTest (
DISTORTION, //
...
...
@@ -1858,7 +1865,10 @@ if (MORE_BUTTONS) {
DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
imp_sel = WindowManager.getCurrentImage();
// imp_distortions=imp_sel;
matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.FFTSize);
// matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.FFTSize);
int sensor_type = 0; // EO
matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.getFFTSize(sensor_type));
// matchSimulatedPattern.invalidateFlatFieldForGrid(); //It is already reset, no need to do it again
// matchSimulatedPattern.invalidateFocusMask();
int numAbsolutePoints=matchSimulatedPattern.calculateDistortions(
...
...
@@ -3183,7 +3193,10 @@ if (MORE_BUTTONS) {
if (label.equals("Update Focusing Grid")) {
DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
if (matchSimulatedPattern==null) {
matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.FFTSize); // new instance, all reset
// matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.FFTSize); // new instance, all reset
int sensor_type = 0; // EO
matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.getFFTSize(sensor_type));
}
matchSimulatedPattern.debugLevel=DEBUG_LEVEL;
imp_sel = WindowManager.getCurrentImage();
...
...
@@ -3345,7 +3358,10 @@ if (MORE_BUTTONS) {
//"Focusing Acquire PSF"
DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
if (matchSimulatedPattern==null) {
matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.FFTSize); // new instance, all reset
// matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.FFTSize); // new instance, all reset
int sensor_type = 0; // EO
matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.getFFTSize(sensor_type));
}
matchSimulatedPattern.debugLevel=DEBUG_LEVEL;
if (LENS_DISTORTION_PARAMETERS==null){
...
...
@@ -3556,7 +3572,9 @@ if (MORE_BUTTONS) {
if (DEBUG_LEVEL>0) System.out.println("Image acquisition (@"+FOCUS_MEASUREMENT_PARAMETERS.sensorTemperature+"C) done at "+ IJ.d2s(0.000000001*(System.nanoTime()-startTime),3));
// reset matchSimulatedPattern, so it will start from scratch
matchSimulatedPatternSet[imgCounter] = new MatchSimulatedPattern(DISTORTION.FFTSize); // new instance, all reset
int sensor_type = 0; // EO
// matchSimulatedPatternSet[imgCounter] = new MatchSimulatedPattern(DISTORTION.FFTSize); // new instance, all reset
matchSimulatedPatternSet[imgCounter] = new MatchSimulatedPattern(DISTORTION.getFFTSize(sensor_type)); // new instance, all reset
// next 2 lines are not needed for the new instance, but can be used alternatively if keeipg it
matchSimulatedPatternSet[imgCounter].invalidateFlatFieldForGrid(); //Reset Flat Field calibration - different image.
gd.addNumericField("Correlation minimal contrast for initial search (absolute)", distortionParameters.correlationMinAbsoluteInitialContrast, 3);
gd.addNumericField("Decrease contrast of cells that are too close to the border to be processed in refinement pass", distortionParameters.scaleFirstPassContrast, 3);
gd.addNumericField("Gaussian sigma to select correlation center in pixels, 2.0", distortionParameters.contrastSelectSigmaCenter, 3);
gd.addNumericField("Gaussian sigma to select correlation off-centers (fraction of UV period), 0.1", distortionParameters.contrastSelectSigma, 3);
gd.addNumericField("Gaussian sigma to average correlation variations (as contrast reference), 0.5", distortionParameters.contrastAverageSigma, 3);
gd.addCheckbox ("Use fast correlation on first pass", distortionParameters.fastCorrelationOnFirstPass);
gd.addCheckbox ("Use fast correlation on refine pass", distortionParameters.fastCorrelationOnFinalPass);
gd.addCheckbox ("Average correlation measurements between neighbors (on refine)", distortionParameters.correlationAverageOnRefine);
gd.addCheckbox ("Update coordinates of the grid points as they are recalculated (false - then update all at once)", distortionParameters.refineInPlace);
gd.addNumericField("Distance to ortho neighbors (for averaging)", distortionParameters.averageOrthoDist, 3,5,"sensor pix");
gd.addNumericField("Combined weight of ortho neighbors (fraction of 1.0)", distortionParameters.averageOrthoWeight, 3);
gd.addNumericField("Distance to diagonal neighbors (for averaging)", distortionParameters.averageDiagDist, 3,5,"sensor pix");
gd.addNumericField("Combined weight of diagonal neighbors (fraction of 1.0)", distortionParameters.averageDiagWeight, 3);
gd.addCheckbox ("Use quadratic extrapolation (false - force linear)", distortionParameters.useQuadratic);
gd.addCheckbox ("Remove outer (unreliable) layer before extrapolation", distortionParameters.removeLast);
gd.addNumericField("Number of extrapolated layers of nodes (final stage)", distortionParameters.numberExtrapolated, 0);
gd.addNumericField("Sigma during final extrapolation stage", distortionParameters.extrapolationSigma, 3,5,"nodes");
gd.addNumericField("Minimal UV span in correlation window to trigger FFT size increase", distortionParameters.minUVSpan, 3);
gd.addNumericField("Extrapolate pattern intensity map (relative to pattern period)", distortionParameters.flatFieldExtarpolate, 3);
gd.addNumericField("Blur pattern intensity map (relative to pattern period)", distortionParameters.flatFieldBlur, 3);
gd.addNumericField("Do not use areas where intensity map is below this part of maximal", distortionParameters.flatFieldMin, 3);
gd.addNumericField("Shrink before extrapolating intensity map (relative to the average grid period)", distortionParameters.flatFieldShrink, 3);
gd.addNumericField("Expand during extrapolation (relative to the average grid period)", distortionParameters.flatFieldExpand, 3);
gd.addNumericField("Extrapolation weight effective radius (relative to the average grid period)", distortionParameters.flatFieldSigmaRadius, 3);
gd.addNumericField("Consider pixels in a square with the side twice this (relative to flatFieldSigmaRadius)", distortionParameters.flatFieldExtraRadius, 3);
gd.addNumericField("Multiply the average grid period to determine the area for averaging the grig brightness", distortionParameters.averagingAreaScale, 3);
if((set_number>=start_set)&&(set_number<=end_set)&&// correct set range
((imageNumber<0)||(imageNumber==numGridImage))&&// either all images or selected image
(processAll||!dcd.gIP[numGridImage].enabled)&&// "process all" (including disabled) or this is disabled
((hintGridTolerance>0.0)||((dcd.gIP[numGridImage].matchedPointers>0)&&!ignoreLaserPointers))// hint tolerance is provided, or there are lasers not disabled
){// skip no-pointers if only orientation is hinted
gd.addNumericField("Correlation minimal contrast for initial search (absolute)",distortionParameters.correlationMinAbsoluteInitialContrast,3);
gd.addNumericField("Decrease contrast of cells that are too close to the border to be processed in refinement pass",distortionParameters.scaleFirstPassContrast,3);
gd.addNumericField("Gaussian sigma to select correlation center in pixels, 2.0",distortionParameters.contrastSelectSigmaCenter,3);
gd.addNumericField("Gaussian sigma to select correlation off-centers (fraction of UV period), 0.1",distortionParameters.contrastSelectSigma,3);
gd.addNumericField("Gaussian sigma to average correlation variations (as contrast reference), 0.5",distortionParameters.contrastAverageSigma,3);
gd.addNumericField("Extrapolate pattern intensity map (relative to pattern period)",distortionParameters.flatFieldExtarpolate,3);
gd.addNumericField("Blur pattern intensity map (relative to pattern period)",distortionParameters.flatFieldBlur,3);
gd.addNumericField("Do not use areas where intensity map is below this part of maximal",distortionParameters.flatFieldMin,3);
gd.addNumericField("Shrink before extrapolating intensity map (relative to the average grid period)",distortionParameters.flatFieldShrink,3);
gd.addNumericField("Expand during extrapolation (relative to the average grid period)",distortionParameters.flatFieldExpand,3);
gd.addNumericField("Extrapolation weight effective radius (relative to the average grid period)",distortionParameters.flatFieldSigmaRadius,3);
gd.addNumericField("Consider pixels in a square with the side twice this (relative to flatFieldSigmaRadius)",distortionParameters.flatFieldExtraRadius,3);
gd.addNumericField("Multiply the average grid period to determine the area for averaging the grig brightness",distortionParameters.averagingAreaScale,3);