Commit 689efe82 authored by Andrey Filippov's avatar Andrey Filippov

trying to speed up

parent 103e97e7
...@@ -2514,8 +2514,8 @@ if (PROCESS_PARAMETERS.saveSettings) saveProperties(FILE_PARAMETERS.resultsDirec ...@@ -2514,8 +2514,8 @@ if (PROCESS_PARAMETERS.saveSettings) saveProperties(FILE_PARAMETERS.resultsDirec
tileY = nTile /tilesX; tileY = nTile /tilesX;
tileX = nTile % tilesX; tileX = nTile % tilesX;
if (tileX==0) { if (tileX==0) {
if (updateStatus) IJ.showStatus("Reducing sampling aliases, row "+(tileY+1)+" of "+tilesY); if (updateStatus) IJ.showStatus("(3)Reducing sampling aliases, row "+(tileY+1)+" of "+tilesY);
if (MASTER_DEBUG_LEVEL>2) System.out.println("Reducing sampling aliases, row "+(tileY+1)+" of "+tilesY+" : "+IJ.d2s(0.000000001*(System.nanoTime()-startTime),3)); if (MASTER_DEBUG_LEVEL>2) System.out.println("(3)Reducing sampling aliases, row "+(tileY+1)+" of "+tilesY+" : "+IJ.d2s(0.000000001*(System.nanoTime()-startTime),3));
} }
if ((tileY==yTileDebug) && (tileX==xTileDebug)) DEBUG_LEVEL=4; if ((tileY==yTileDebug) && (tileX==xTileDebug)) DEBUG_LEVEL=4;
......
...@@ -119,8 +119,8 @@ public class DebayerScissors { ...@@ -119,8 +119,8 @@ public class DebayerScissors {
tileY = nTile /tilesX; tileY = nTile /tilesX;
tileX = nTile % tilesX; tileX = nTile % tilesX;
if (tileX==0) { if (tileX==0) {
if (updateStatus) IJ.showStatus("Reducing sampling aliases, row "+(tileY+1)+" of "+tilesY); if (updateStatus) IJ.showStatus("(1)Reducing sampling aliases, row "+(tileY+1)+" of "+tilesY);
if (globalDebugLevel>2) System.out.println("Reducing sampling aliases, row "+(tileY+1)+" of "+tilesY+" : "+IJ.d2s(0.000000001*(System.nanoTime()-startTime),3)); if (globalDebugLevel>2) System.out.println("(1)Reducing sampling aliases, row "+(tileY+1)+" of "+tilesY+" : "+IJ.d2s(0.000000001*(System.nanoTime()-startTime),3));
} }
// if ((tileY==yTileDebug) && (tileX==xTileDebug)) this.debugLevel=4; // if ((tileY==yTileDebug) && (tileX==xTileDebug)) this.debugLevel=4;
......
...@@ -2213,7 +2213,7 @@ public class EyesisAberrations { ...@@ -2213,7 +2213,7 @@ public class EyesisAberrations {
public double [][][][] createPSFMap( public double [][][][] createPSFMap(
final MatchSimulatedPattern commonMatchSimulatedPattern, // to be cloned in threads, using common data final MatchSimulatedPattern commonMatchSimulatedPattern, // to be cloned in threads, using common data
final ImagePlus imp_sel, // linearized Bayer mosaic image form the camera, GR/BG final ImagePlus imp_sel, // linearized Bayer mosaic image from the camera, GR/BG
final int [][][] sampleList, // optional (or null) 2-d array: list of coordinate pairs (2d - to match existent pdfKernelMap structure) final int [][][] sampleList, // optional (or null) 2-d array: list of coordinate pairs (2d - to match existent pdfKernelMap structure)
final double overexposedAllowed, // fraction of pixels OK to be overexposed final double overexposedAllowed, // fraction of pixels OK to be overexposed
final SimulationPattern.SimulParameters simulParameters, final SimulationPattern.SimulParameters simulParameters,
......
...@@ -1712,6 +1712,20 @@ public class EyesisCorrections { ...@@ -1712,6 +1712,20 @@ public class EyesisCorrections {
final AtomicInteger ai = new AtomicInteger(0); final AtomicInteger ai = new AtomicInteger(0);
final int numberOfKernels= tilesY*tilesX*nChn; final int numberOfKernels= tilesY*tilesX*nChn;
final int numberOfKernelsInChn=tilesY*tilesX; final int numberOfKernelsInChn=tilesY*tilesX;
// if (globalDebugLevel>1)
System.out.println("Eyesis_Correction:convolveStackWithKernelStack :\n"+
"globalDebugLevel="+globalDebugLevel+"\n"+
"imgWidth="+imgWidth+"\n"+
"imgHeight="+imgHeight+"\n"+
"tilesX="+tilesX+"\n"+
"tilesY="+tilesY+"\n"+
"step="+step+"\n"+
"kernelSize="+kernelSize+"\n"+
"kernelWidth="+kernelWidth+"\n"+
"kernelNumHor="+kernelNumHor+"\n"+
"numberOfKernelsInChn="+numberOfKernelsInChn+"\n");
final long startTime = System.nanoTime(); final long startTime = System.nanoTime();
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
......
...@@ -3444,7 +3444,7 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos ...@@ -3444,7 +3444,7 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos
continue; continue;
} }
convolutionKernelStack=imp_kernels.getStack(); convolutionKernelStack=imp_kernels.getStack();
if (DEBUG_LEVEL>1) System.out.println("Using kernel stack "+kernelPath+" for convolution with "+result[nFile][nChn][nSubChn].getTitle()); if (DEBUG_LEVEL>1) System.out.println("(1)Using kernel stack "+kernelPath+" for convolution with "+result[nFile][nChn][nSubChn].getTitle());
stack_d= convolveStackWithKernelStack( stack_d= convolveStackWithKernelStack(
stack, // stack with 3 colors/slices with the image stack, // stack with 3 colors/slices with the image
convolutionKernelStack, // stack with 3 colors/slices convolution kernels convolutionKernelStack, // stack with 3 colors/slices convolution kernels
...@@ -3472,7 +3472,7 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos ...@@ -3472,7 +3472,7 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos
continue; continue;
} }
convolutionKernelStack=imp_kernels.getStack(); convolutionKernelStack=imp_kernels.getStack();
if (DEBUG_LEVEL>1) System.out.println("Using Gaussian stack "+kernelPath+" for convolution with "+result[nFile][nChn][nSubChn].getTitle()); if (DEBUG_LEVEL>1) System.out.println("(2)Using Gaussian stack "+kernelPath+" for convolution with "+result[nFile][nChn][nSubChn].getTitle());
stack_g= convolveStackWithKernelStack( stack_g= convolveStackWithKernelStack(
stack, // stack with 3 colors/slices with the image stack, // stack with 3 colors/slices with the image
convolutionKernelStack, // stack with 3 colors/slices convolution kernels convolutionKernelStack, // stack with 3 colors/slices convolution kernels
...@@ -3572,7 +3572,7 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos ...@@ -3572,7 +3572,7 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos
continue; continue;
} }
convolutionKernelStack=imp_kernels.getStack(); convolutionKernelStack=imp_kernels.getStack();
if (DEBUG_LEVEL>1) System.out.println("Using Gaussian stack "+kernelPath+" for convolution with "+result[nFile][nChn][nSubChn].getTitle()); if (DEBUG_LEVEL>1) System.out.println("(3)Using Gaussian stack "+kernelPath+" for convolution with "+result[nFile][nChn][nSubChn].getTitle());
stack_g= convolveStackWithKernelStack( stack_g= convolveStackWithKernelStack(
stack, // stack with 3 colors/slices with the image stack, // stack with 3 colors/slices with the image
convolutionKernelStack, // stack with 3 colors/slices convolution kernels convolutionKernelStack, // stack with 3 colors/slices convolution kernels
...@@ -3957,7 +3957,6 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos ...@@ -3957,7 +3957,6 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos
final int tilesY=imgHeight/step-1; // vertical number of overlapping tiles in the source image (should be expanded from the registerd one by "step" in each direction) final int tilesY=imgHeight/step-1; // vertical number of overlapping tiles in the source image (should be expanded from the registerd one by "step" in each direction)
final int kernelWidth=kernelStack.getWidth(); final int kernelWidth=kernelStack.getWidth();
final int kernelNumHor=kernelWidth/(size/2); final int kernelNumHor=kernelWidth/(size/2);
final int nChn=imageStack.getSize(); final int nChn=imageStack.getSize();
final float [][] outPixels=new float[nChn][length]; // GLOBAL same as input final float [][] outPixels=new float[nChn][length]; // GLOBAL same as input
// float [][] outPixels=new float[nChn][length]; // same as input // float [][] outPixels=new float[nChn][length]; // same as input
...@@ -3968,6 +3967,21 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos ...@@ -3968,6 +3967,21 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos
final AtomicInteger ai = new AtomicInteger(0); final AtomicInteger ai = new AtomicInteger(0);
final int numberOfKernels= tilesY*tilesX*nChn; final int numberOfKernels= tilesY*tilesX*nChn;
final int numberOfKernelsInChn=tilesY*tilesX; final int numberOfKernelsInChn=tilesY*tilesX;
// if (MASTER_DEBUG_LEVEL>1)
System.out.println("Eyesis_Correction:convolveStackWithKernelStack :\n"+
"MASTER_DEBUG_LEVEL="+MASTER_DEBUG_LEVEL+"\n"+
"imgWidth="+imgWidth+"\n"+
"imgHeight="+imgHeight+"\n"+
"tilesX="+tilesX+"\n"+
"tilesY="+tilesY+"\n"+
"step="+step+"\n"+
"kernelSize="+kernelSize+"\n"+
"tilesX="+tilesX+"\n"+
"tilesY="+tilesY+"\n"+
"kernelWidth="+kernelWidth+"\n"+
"kernelNumHor="+kernelNumHor+"\n"+
"numberOfKernelsInChn="+numberOfKernelsInChn+"\n");
final long startTime = System.nanoTime(); final long startTime = System.nanoTime();
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
...@@ -4133,8 +4147,8 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos ...@@ -4133,8 +4147,8 @@ private Panel panel1,panel2,panel3,panel4,panel5,panel5a, panel6,panel7,panelPos
tileY = nTile /tilesX; tileY = nTile /tilesX;
tileX = nTile % tilesX; tileX = nTile % tilesX;
if (tileX==0) { if (tileX==0) {
if (updateStatus) IJ.showStatus("Reducing sampling aliases, row "+(tileY+1)+" of "+tilesY); if (updateStatus) IJ.showStatus("(2)Reducing sampling aliases, row "+(tileY+1)+" of "+tilesY);
if (MASTER_DEBUG_LEVEL>2) System.out.println("Reducing sampling aliases, row "+(tileY+1)+" of "+tilesY+" : "+IJ.d2s(0.000000001*(System.nanoTime()-startTime),3)); if (MASTER_DEBUG_LEVEL>1) System.out.println("(2)Reducing sampling aliases, row "+(tileY+1)+" of "+tilesY+" : "+IJ.d2s(0.000000001*(System.nanoTime()-startTime),3));
} }
if ((tileY==yTileDebug) && (tileX==xTileDebug)) DEBUG_LEVEL=4; if ((tileY==yTileDebug) && (tileX==xTileDebug)) DEBUG_LEVEL=4;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment