Commit 8991226b authored by Andrey Filippov's avatar Andrey Filippov

Tweaking software to handle more precise disparity measurements

parent 957badd3
...@@ -539,6 +539,7 @@ public class CLTPass3d{ ...@@ -539,6 +539,7 @@ public class CLTPass3d{
final AtomicInteger ai = new AtomicInteger(0); final AtomicInteger ai = new AtomicInteger(0);
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
@Override
public void run() { public void run() {
for (int nTile = ai.getAndIncrement(); nTile < nTiles; nTile = ai.getAndIncrement()) { for (int nTile = ai.getAndIncrement(); nTile < nTiles; nTile = ai.getAndIncrement()) {
if (((strength[nTile] < weakStrength) || if (((strength[nTile] < weakStrength) ||
...@@ -597,6 +598,7 @@ public class CLTPass3d{ ...@@ -597,6 +598,7 @@ public class CLTPass3d{
ai.set(0); ai.set(0);
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
@Override
public void run() { public void run() {
for (int nTile = ai.getAndIncrement(); nTile < nTiles; nTile = ai.getAndIncrement()) { for (int nTile = ai.getAndIncrement(); nTile < nTiles; nTile = ai.getAndIncrement()) {
if (nTile == dbg_nTile){ if (nTile == dbg_nTile){
...@@ -656,6 +658,7 @@ public class CLTPass3d{ ...@@ -656,6 +658,7 @@ public class CLTPass3d{
final AtomicInteger ai = new AtomicInteger(0); final AtomicInteger ai = new AtomicInteger(0);
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
@Override
public void run() { public void run() {
for (int nTile = ai.getAndIncrement(); nTile < num_tiles; nTile = ai.getAndIncrement()) { for (int nTile = ai.getAndIncrement(); nTile < num_tiles; nTile = ai.getAndIncrement()) {
if (known[nTile]){ if (known[nTile]){
...@@ -688,6 +691,7 @@ public class CLTPass3d{ ...@@ -688,6 +691,7 @@ public class CLTPass3d{
final AtomicInteger ai = new AtomicInteger(0); final AtomicInteger ai = new AtomicInteger(0);
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
@Override
public void run() { public void run() {
for (int nTile = ai.getAndIncrement(); nTile < num_tiles; nTile = ai.getAndIncrement()) { for (int nTile = ai.getAndIncrement(); nTile < num_tiles; nTile = ai.getAndIncrement()) {
int tX = nTile % tilesX; int tX = nTile % tilesX;
...@@ -790,6 +794,7 @@ public class CLTPass3d{ ...@@ -790,6 +794,7 @@ public class CLTPass3d{
final AtomicInteger ai = new AtomicInteger(0); final AtomicInteger ai = new AtomicInteger(0);
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
@Override
public void run() { public void run() {
for (int nTile = ai.getAndIncrement(); nTile < num_tiles; nTile = ai.getAndIncrement()) { for (int nTile = ai.getAndIncrement(); nTile < num_tiles; nTile = ai.getAndIncrement()) {
int imax1 = 0; int imax1 = 0;
...@@ -813,6 +818,7 @@ public class CLTPass3d{ ...@@ -813,6 +818,7 @@ public class CLTPass3d{
ai.set(0); ai.set(0);
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
@Override
public void run() { public void run() {
for (int nTile = ai.getAndIncrement(); nTile < num_tiles; nTile = ai.getAndIncrement()) if (measured[nTile]) { for (int nTile = ai.getAndIncrement(); nTile < num_tiles; nTile = ai.getAndIncrement()) if (measured[nTile]) {
double sw = 0.0; double sw = 0.0;
...@@ -851,6 +857,7 @@ public class CLTPass3d{ ...@@ -851,6 +857,7 @@ public class CLTPass3d{
final AtomicInteger ai = new AtomicInteger(0); final AtomicInteger ai = new AtomicInteger(0);
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
@Override
public void run() { public void run() {
for (int nTile = ai.getAndIncrement(); nTile < num_tiles; nTile = ai.getAndIncrement()) { for (int nTile = ai.getAndIncrement(); nTile < num_tiles; nTile = ai.getAndIncrement()) {
if (known[nTile]){ if (known[nTile]){
...@@ -897,6 +904,15 @@ public class CLTPass3d{ ...@@ -897,6 +904,15 @@ public class CLTPass3d{
int smplNum, // = 3; // Number after removing worst int smplNum, // = 3; // Number after removing worst
double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
boolean smplWnd, // use window functions for the samples boolean smplWnd, // use window functions for the samples
double max_abs_tilt, // 2.0; // pix per tile
double max_rel_tilt, // 0.2; // (pix / disparity) per tile
double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
int measSel) int measSel)
{ {
this.superTiles = new SuperTiles( this.superTiles = new SuperTiles(
...@@ -914,6 +930,14 @@ public class CLTPass3d{ ...@@ -914,6 +930,14 @@ public class CLTPass3d{
smplNum, // = 3; // Number after removing worst smplNum, // = 3; // Number after removing worst
smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // final boolean smplWnd, // use window functions for the samples smplWnd, // final boolean smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
// true, // boolean null_if_none,
measSel); measSel);
return this.superTiles; return this.superTiles;
} }
...@@ -926,6 +950,15 @@ public class CLTPass3d{ ...@@ -926,6 +950,15 @@ public class CLTPass3d{
int smplNum, // = 3; // Number after removing worst int smplNum, // = 3; // Number after removing worst
double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
boolean smplWnd, // use window functions for the samples boolean smplWnd, // use window functions for the samples
double max_abs_tilt, // 2.0; // pix per tile
double max_rel_tilt, // 0.2; // (pix / disparity) per tile
double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
int measSel) int measSel)
{ {
if (this.superTiles == null){ if (this.superTiles == null){
...@@ -940,6 +973,15 @@ public class CLTPass3d{ ...@@ -940,6 +973,15 @@ public class CLTPass3d{
smplNum, // = 3; // Number after removing worst smplNum, // = 3; // Number after removing worst
smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // use window functions for the samples smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
measSel); measSel);
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -572,6 +572,7 @@ private Panel panel1, ...@@ -572,6 +572,7 @@ private Panel panel1,
addButton("Infinity offset", panelClt3, color_configure); addButton("Infinity offset", panelClt3, color_configure);
addButton("Setup CLT Batch parameters", panelClt3, color_configure); addButton("Setup CLT Batch parameters", panelClt3, color_configure);
addButton("CLT batch process", panelClt3, color_process); addButton("CLT batch process", panelClt3, color_process);
addButton("CM Test", panelClt3, color_stop);
// addButton("JTabbed", panelClt3, color_stop); // addButton("JTabbed", panelClt3, color_stop);
// addButton("Demo", panelClt3, color_process); // addButton("Demo", panelClt3, color_process);
...@@ -3752,7 +3753,7 @@ private Panel panel1, ...@@ -3752,7 +3753,7 @@ private Panel panel1,
/* ======================================================================== */ /* ======================================================================== */
} else if (label.equals("Setup CLT parameters")) { } else if (label.equals("Setup CLT parameters")) {
CLT_PARAMETERS.showDialog(); CLT_PARAMETERS.showJDialog();
return; return;
/* ======================================================================== */ /* ======================================================================== */
} else if (label.equals("Setup CLT")) { } else if (label.equals("Setup CLT")) {
...@@ -3769,7 +3770,7 @@ private Panel panel1, ...@@ -3769,7 +3770,7 @@ private Panel panel1,
} else if (label.equals("Select CLT image")) { } else if (label.equals("Select CLT image")) {
DEBUG_LEVEL=MASTER_DEBUG_LEVEL; DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
// IJ.showMessage("DCT test 1"); // IJ.showMessage("DCT test 1");
if (!CLT_PARAMETERS.showDialog()) return; if (!CLT_PARAMETERS.showJDialog()) return;
// process selected image stack // process selected image stack
ImagePlus imp_src = WindowManager.getCurrentImage(); ImagePlus imp_src = WindowManager.getCurrentImage();
if (imp_src==null){ if (imp_src==null){
...@@ -3802,7 +3803,7 @@ private Panel panel1, ...@@ -3802,7 +3803,7 @@ private Panel panel1,
} else if (label.equals("Select second CLT image")) { } else if (label.equals("Select second CLT image")) {
DEBUG_LEVEL=MASTER_DEBUG_LEVEL; DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
// IJ.showMessage("DCT test 1"); // IJ.showMessage("DCT test 1");
if (!CLT_PARAMETERS.showDialog()) return; if (!CLT_PARAMETERS.showJDialog()) return;
// process selected image stack // process selected image stack
ImagePlus imp_src = WindowManager.getCurrentImage(); ImagePlus imp_src = WindowManager.getCurrentImage();
if (imp_src==null){ if (imp_src==null){
...@@ -3837,7 +3838,7 @@ private Panel panel1, ...@@ -3837,7 +3838,7 @@ private Panel panel1,
} else if (label.equals("CLT stack")) { } else if (label.equals("CLT stack")) {
DEBUG_LEVEL=MASTER_DEBUG_LEVEL; DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
// IJ.showMessage("DCT test 1"); // IJ.showMessage("DCT test 1");
if (!CLT_PARAMETERS.showDialog()) return; if (!CLT_PARAMETERS.showJDialog()) return;
// process selected image stack // process selected image stack
if (DBG_IMP == null) { if (DBG_IMP == null) {
ImagePlus imp_src = WindowManager.getCurrentImage(); ImagePlus imp_src = WindowManager.getCurrentImage();
...@@ -3937,7 +3938,7 @@ private Panel panel1, ...@@ -3937,7 +3938,7 @@ private Panel panel1,
System.out.println("--- Free memory="+runtime.freeMemory()+" (of "+runtime.totalMemory()+")"); System.out.println("--- Free memory="+runtime.freeMemory()+" (of "+runtime.totalMemory()+")");
// IJ.showMessage("DCT test 1"); // IJ.showMessage("DCT test 1");
if (!CLT_PARAMETERS.showDialog()) return; if (!CLT_PARAMETERS.showJDialog()) return;
// process selected image stack // process selected image stack
if (DBG_IMP == null) { if (DBG_IMP == null) {
ImagePlus imp_src = WindowManager.getCurrentImage(); ImagePlus imp_src = WindowManager.getCurrentImage();
...@@ -4191,7 +4192,7 @@ private Panel panel1, ...@@ -4191,7 +4192,7 @@ private Panel panel1,
//============================================================================== //==============================================================================
} else if (label.equals("Create CLT kernels")) { } else if (label.equals("Create CLT kernels")) {
if (!CLT_PARAMETERS.showDialog()) return; if (!CLT_PARAMETERS.showJDialog()) return;
if (QUAD_CLT == null){ if (QUAD_CLT == null){
QUAD_CLT = new QuadCLT ( QUAD_CLT = new QuadCLT (
PROPERTIES, PROPERTIES,
...@@ -4250,7 +4251,7 @@ private Panel panel1, ...@@ -4250,7 +4251,7 @@ private Panel panel1,
} }
} else if (label.equals("Read CLT kernels")) { } else if (label.equals("Read CLT kernels")) {
if (!CLT_PARAMETERS.showDialog()) return; if (!CLT_PARAMETERS.showJDialog()) return;
if (QUAD_CLT == null){ if (QUAD_CLT == null){
QUAD_CLT = new QuadCLT ( QUAD_CLT = new QuadCLT (
PROPERTIES, PROPERTIES,
...@@ -5161,6 +5162,9 @@ private Panel panel1, ...@@ -5161,6 +5162,9 @@ private Panel panel1,
PROPERTIES); PROPERTIES);
} }
return; return;
} else if (label.equals("CM Test")) {
cm_test();
return;
//JTabbedTest //JTabbedTest
// End of buttons code // End of buttons code
...@@ -5185,8 +5189,137 @@ private Panel panel1, ...@@ -5185,8 +5189,137 @@ private Panel panel1,
return true; return true;
} }
public boolean cm_test() {
double hsize_x = 1.5;
double hsize_y = 1.5;
int steps = 20;
double sigma = 0.0;
boolean separable = true; // false;
double pwr = 1.0;
GenericJTabbedDialog gd = new GenericJTabbedDialog("Set CLT parameters",400,300);
gd.addNumericField("Half size X", hsize_x, 6, 8, "pix",
"Correlation maximum half width in disparity direction");
gd.addNumericField("Half size Y", hsize_y, 6, 8, "pix",
"Correlation maximum half width in orthogonal direction");
gd.addNumericField("Number of steps", steps, 0, 6, "",
"Number of steps to subdivide [0,1) half-interval");
gd.addNumericField("Low pass sigma", sigma, 3, 6, "pix",
"Correlation maximum half width in orthogonal direction");
gd.addCheckbox ("X/Y separable", separable);
gd.addNumericField("Value power", pwr, 6, 8, "",
"Raise values to this power before calculating CM");
gd.showDialog();
if (gd.wasCanceled()) return false;
DoubleGaussianBlur gb=new DoubleGaussianBlur();
hsize_x = gd.getNextNumber();
hsize_y = gd.getNextNumber();
steps = (int) gd.getNextNumber();
sigma = gd.getNextNumber();
separable = gd.getNextBoolean();
pwr = gd.getNextNumber();
int size_x = 2*((int) Math.round(hsize_x+ 2*sigma+1)) + 1;
int size_y = 2*((int) Math.round(hsize_y+ 2*sigma+1)) + 1;
System.out.println("size_x="+size_x+", size_y="+size_y+" sigma = "+sigma+" separable "+separable+" pwr=" + pwr);
String [] titles = new String[steps];
double [][] data = new double [steps][size_x*size_y];
for (int i = 0;i<steps; i++) {
double dx = 1.0*i/steps;
titles[i] = IJ.d2s(dx,3);
for (int iy = 0; iy < size_y; iy++) {
double y = (iy - (size_y - 1)/2)/hsize_y;
if ((y >= -1.0) && (y <= 1.0)) {
double ay = separable ? (0.5*(Math.cos(y * Math.PI) + 1.0)):1.0;
for (int ix = 0; ix < size_x; ix++) {
double x = (ix - (size_x - 1)/2 - dx)/hsize_x;
double r = separable? Math.abs(x) : Math.sqrt(x*x+y*y);
// if ((r >= -hsize_x) && (x <= hsize_x)) {
if (r <= 1.0) {
double ax = 0.5*(Math.cos(r * Math.PI) + 1.0);
data[i][iy*size_x+ix] = ax*ay;
}
}
}
}
}
(new showDoubleFloatArrays()) .showArrays(data, size_x, size_y, true, "pre-gauss", titles);
if (sigma > 0.0) {
for (int i = 0; i < steps; i++) {
gb.blurDouble(
data[i],
size_x,
size_y,
sigma,
sigma,
0.01);
}
(new showDoubleFloatArrays()) .showArrays(data, size_x, size_y, true, "blured", titles);
}
double [] cm_x = new double [steps];
for (int i = 0;i<steps; i++) {
double s0=0,sx=0;
for (int iy = 0; iy < size_y; iy++ ) {
for (int ix = 0; ix < size_x; ix++ ) {
double d = Math.pow(data[i][iy*size_y+ix], pwr);
s0+=d;
sx+=ix*d;
}
}
cm_x[i] = sx/s0 - (size_x - 1)/2;
}
for (int i = 0;i <= steps/2; i++) {
double dx = 1.0*i/steps;
System.out.println(String.format("%3d %8.5f %8.5f %8.5f %8.5f %8.5f", i, dx, cm_x[i],cm_x[i]-dx, cm_x[i]/(dx+0.00000001), dx/(cm_x[i]+0.00000001)));
}
return true;
/*
double s0 = 0, sx=0,sy = 0;
for (int y = - iradius ; y <= iradius; y++){
int dataY = icenter[1] +y;
if ((dataY >= 0) && (dataY < data_size)){
int y2 = y*y;
for (int x = - iradius ; x <= iradius; x++){
int dataX = icenter[0] +x;
double r2 = y2 + x * x;
// if ((dataX >= 0) && (dataX < data_size) && (square || ((y2 + x * x) <= ir2))){
if ((dataX >= 0) && (dataX < data_size) && (square || (r2 <= ir2))){
// double w = max_corr_double? (1.0 - r2/ir2):1.0;
// double d = w* data[dataY * data_size + dataX];
double d = data[dataY * data_size + dataX];
s0 += d;
sx += d * dataX;
sy += d * dataY;
}
}
}
}
double [] rslt = {sx / s0, sy / s0};
*
* showDoubleFloatArrays sdfa_instance = new showDoubleFloatArrays(); // just for debugging?
sdfa_instance.showArrays(double_stack, imp_src.getWidth(), imp_src.getHeight(), true, "BEFORE_CLT_PROC", rbg_titles);
*
gb.blurDouble(
results[indexVar],
size,
size,
blurVarianceSigma,
blurVarianceSigma,
0.01);
*/
}
private boolean loadCorrelations(){ private boolean loadCorrelations(){
String []patterns={".corr-tiff",".tiff",".tif"}; String []patterns={".corr-tiff",".tiff",".tif"};
String path= selectFile( String path= selectFile(
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import java.awt.Font; import java.awt.Font;
import java.awt.GridBagConstraints; import java.awt.GridBagConstraints;
...@@ -109,7 +110,13 @@ public class GenericJTabbedDialog implements ActionListener { ...@@ -109,7 +110,13 @@ public class GenericJTabbedDialog implements ActionListener {
} }
if (tooltip != null) { if (tooltip != null) {
label.setToolTipText(tooltip); label.setToolTipText(tooltip);
if (component != null) component.setToolTipText(tooltip); if (component != null) {
component.setToolTipText(tooltip);
Component [] comps = component.getComponents();
if ((comps != null) && (comps.length >0)) {
((JComponent) comps[0]).setToolTipText(tooltip);
}
}
} }
labels.get(labels.size()-1).add(label); labels.get(labels.size()-1).add(label);
components.get(components.size()-1).add(component); components.get(components.size()-1).add(component);
...@@ -148,6 +155,7 @@ public class GenericJTabbedDialog implements ActionListener { ...@@ -148,6 +155,7 @@ public class GenericJTabbedDialog implements ActionListener {
inp_units.putClientProperty("type", "String"); inp_units.putClientProperty("type", "String");
inp_units.setLayout(new FlowLayout(FlowLayout.LEFT)); inp_units.setLayout(new FlowLayout(FlowLayout.LEFT));
addLine(label, inp_units, tooltip); addLine(label, inp_units, tooltip);
} }
public void addNumericField(String label, double defaultValue, int digits) { // as in IJ public void addNumericField(String label, double defaultValue, int digits) { // as in IJ
......
This diff is collapsed.
...@@ -222,6 +222,7 @@ public class MacroCorrelation { ...@@ -222,6 +222,7 @@ public class MacroCorrelation {
// double [][][][] texture_tiles = save_textures ? new double [tilesY][tilesX][][] : null; // ["RGBA".length()][]; // double [][][][] texture_tiles = save_textures ? new double [tilesY][tilesX][][] : null; // ["RGBA".length()][];
ImageDtt image_dtt = new ImageDtt(); ImageDtt image_dtt = new ImageDtt();
image_dtt.clt_aberrations_quad_corr( image_dtt.clt_aberrations_quad_corr(
clt_parameters.img_dtt, // final ImageDttParameters imgdtt_params, // Now just extra correlation parameters, later will include, most others
8, // final int macro_scale, // to correlate tile data instead of the pixel data: 1 - pixels, 8 - tiles 8, // final int macro_scale, // to correlate tile data instead of the pixel data: 1 - pixels, 8 - tiles
macro_scan.tile_op, // per-tile operation bit codes macro_scan.tile_op, // per-tile operation bit codes
macro_scan.disparity, // clt_parameters.disparity, // final double disparity, macro_scan.disparity, // clt_parameters.disparity, // final double disparity,
...@@ -410,6 +411,7 @@ public class MacroCorrelation { ...@@ -410,6 +411,7 @@ public class MacroCorrelation {
double [] arr = {disparity, strength}; double [] arr = {disparity, strength};
return arr; return arr;
} }
@Override
public String toString(){ public String toString(){
return String.format("disparity=%7.3f strength=%7.4f",disparity, strength); return String.format("disparity=%7.3f strength=%7.4f",disparity, strength);
} }
...@@ -447,6 +449,7 @@ public class MacroCorrelation { ...@@ -447,6 +449,7 @@ public class MacroCorrelation {
final double kexp = (mc_trust_sigma == 0.0) ? 0.0: (0.5/mc_trust_sigma/mc_trust_sigma); final double kexp = (mc_trust_sigma == 0.0) ? 0.0: (0.5/mc_trust_sigma/mc_trust_sigma);
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
@Override
public void run() { public void run() {
int this_thread = ai_thread.getAndIncrement(); int this_thread = ai_thread.getAndIncrement();
...@@ -557,6 +560,7 @@ public class MacroCorrelation { ...@@ -557,6 +560,7 @@ public class MacroCorrelation {
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
@Override
public void run() { public void run() {
// int this_thread = ai_thread.getAndIncrement(); // int this_thread = ai_thread.getAndIncrement();
int tileSize = tp.getTileSize(); int tileSize = tp.getTileSize();
......
This diff is collapsed.
...@@ -3572,7 +3572,7 @@ public class QuadCLT { ...@@ -3572,7 +3572,7 @@ public class QuadCLT {
showDoubleFloatArrays sdfa_instance = new showDoubleFloatArrays(); // just for debugging? showDoubleFloatArrays sdfa_instance = new showDoubleFloatArrays(); // just for debugging?
// may use this.StartTime to report intermediate steps execution times // may use this.StartTime to report intermediate steps execution times
String name=(String) imp_quad[0].getProperty("name"); String name=this.correctionsParameters.getModelName((String) imp_quad[0].getProperty("name"));
// int channel= Integer.parseInt((String) imp_src.getProperty("channel")); // int channel= Integer.parseInt((String) imp_src.getProperty("channel"));
// int channel= (Integer) imp_quad[0].getProperty("channel"); // int channel= (Integer) imp_quad[0].getProperty("channel");
String path= (String) imp_quad[0].getProperty("path"); String path= (String) imp_quad[0].getProperty("path");
...@@ -3666,6 +3666,7 @@ public class QuadCLT { ...@@ -3666,6 +3666,7 @@ public class QuadCLT {
} }
final double disparity_corr = (z_correction == 0) ? 0.0 : geometryCorrection.getDisparityFromZ(1.0/z_correction); final double disparity_corr = (z_correction == 0) ? 0.0 : geometryCorrection.getDisparityFromZ(1.0/z_correction);
double [][][][][][] clt_data = image_dtt.clt_aberrations_quad_corr( double [][][][][][] clt_data = image_dtt.clt_aberrations_quad_corr(
clt_parameters.img_dtt, // final ImageDttParameters imgdtt_params, // Now just extra correlation parameters, later will include, most others
1, // final int macro_scale, // to correlate tile data instead of the pixel data: 1 - pixels, 8 - tiles 1, // final int macro_scale, // to correlate tile data instead of the pixel data: 1 - pixels, 8 - tiles
tile_op, // per-tile operation bit codes tile_op, // per-tile operation bit codes
disparity_array, // final double disparity, disparity_array, // final double disparity,
...@@ -4740,6 +4741,7 @@ public class QuadCLT { ...@@ -4740,6 +4741,7 @@ public class QuadCLT {
final double disparity_corr = (z_correction == 0) ? 0.0 : geometryCorrection.getDisparityFromZ(1.0/z_correction); final double disparity_corr = (z_correction == 0) ? 0.0 : geometryCorrection.getDisparityFromZ(1.0/z_correction);
image_dtt.clt_aberrations_quad_corr( image_dtt.clt_aberrations_quad_corr(
clt_parameters.img_dtt, // final ImageDttParameters imgdtt_params, // Now just extra correlation parameters, later will include, most others
1, // final int macro_scale, // to correlate tile data instead of the pixel data: 1 - pixels, 8 - tiles 1, // final int macro_scale, // to correlate tile data instead of the pixel data: 1 - pixels, 8 - tiles
tile_op, // per-tile operation bit codes tile_op, // per-tile operation bit codes
disparity_array, // clt_parameters.disparity, // final double disparity, disparity_array, // clt_parameters.disparity, // final double disparity,
...@@ -5632,13 +5634,13 @@ public class QuadCLT { ...@@ -5632,13 +5634,13 @@ public class QuadCLT {
debugLevel); debugLevel);
tp.clt_3d_passes.add(bgnd_data); tp.clt_3d_passes.add(bgnd_data);
// if (show_init_refine) // if (show_init_refine)
if (debugLevel > -1) { if ((debugLevel > -2) && clt_parameters.show_first_bg) {
tp.showScan( tp.showScan(
tp.clt_3d_passes.get(0), // CLTPass3d scan, tp.clt_3d_passes.get(0), // CLTPass3d scan,
"bgnd_data-"+tp.clt_3d_passes.size()); "bgnd_data-"+tp.clt_3d_passes.size());
} }
//TODO: Move away form here? //TODO: Move away from here?
ImagePlus imp_bgnd = getBackgroundImage( ImagePlus imp_bgnd = getBackgroundImage(
clt_parameters, clt_parameters,
colorProcParameters, colorProcParameters,
...@@ -5827,7 +5829,8 @@ public class QuadCLT { ...@@ -5827,7 +5829,8 @@ public class QuadCLT {
tp.clt_3d_passes.add(refined); tp.clt_3d_passes.add(refined);
/// if (debugLevel > 1) /// if (debugLevel > 1)
if (debugLevel > 0) // if (debugLevel > 0)
if ((debugLevel > -2) && clt_parameters.show_first_bg)
tp.showScan( tp.showScan(
tp.clt_3d_passes.get(refine_pass), // CLTPass3d scan, tp.clt_3d_passes.get(refine_pass), // CLTPass3d scan,
"before_makeUnique-"+refine_pass); "before_makeUnique-"+refine_pass);
...@@ -5973,8 +5976,9 @@ public class QuadCLT { ...@@ -5973,8 +5976,9 @@ public class QuadCLT {
threadsMax, // maximal number of threads to launch threadsMax, // maximal number of threads to launch
updateStatus, updateStatus,
debugLevel); debugLevel);
if (debugLevel > -1){ // if (debugLevel > -1){
System.out.println("CLTMeasure("+refine_pass+")"); if (debugLevel > -2){
System.out.println("?.CLTMeasure("+refine_pass+")");
} }
if (show_init_refine) tp.showScan( if (show_init_refine) tp.showScan(
tp.clt_3d_passes.get(refine_pass), // CLTPass3d scan, tp.clt_3d_passes.get(refine_pass), // CLTPass3d scan,
...@@ -7041,7 +7045,7 @@ public class QuadCLT { ...@@ -7041,7 +7045,7 @@ public class QuadCLT {
"after_pass3-"+(next_pass-1)); //String title) "after_pass3-"+(next_pass-1)); //String title)
} }
String x3d_path= correctionsParameters.selectX3dDirectory( // for x3d and obj String x3d_path= correctionsParameters.selectX3dDirectory( // for x3d and obj
this.image_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false correctionsParameters.getModelName(this.image_name), // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
correctionsParameters.x3dModelVersion, correctionsParameters.x3dModelVersion,
true, // smart, true, // smart,
true); //newAllowed, // save true); //newAllowed, // save
...@@ -7058,7 +7062,7 @@ public class QuadCLT { ...@@ -7058,7 +7062,7 @@ public class QuadCLT {
try { try {
wfOutput = new WavefrontExport( wfOutput = new WavefrontExport(
x3d_path, x3d_path,
this.image_name, correctionsParameters.getModelName(this.image_name),
clt_parameters, clt_parameters,
correctionsParameters, correctionsParameters,
geometryCorrection, geometryCorrection,
...@@ -7117,7 +7121,7 @@ public class QuadCLT { ...@@ -7117,7 +7121,7 @@ public class QuadCLT {
clt_parameters, clt_parameters,
colorProcParameters, colorProcParameters,
rgbParameters, rgbParameters,
this.image_name+"-img_infinity", // +scanIndex, correctionsParameters.getModelName(this.image_name)+"-img_infinity", // +scanIndex,
bgndIndex, bgndIndex,
threadsMax, // maximal number of threads to launch threadsMax, // maximal number of threads to launch
updateStatus, updateStatus,
...@@ -7198,7 +7202,7 @@ public class QuadCLT { ...@@ -7198,7 +7202,7 @@ public class QuadCLT {
clt_parameters, clt_parameters,
colorProcParameters, colorProcParameters,
rgbParameters, rgbParameters,
this.image_name+"-img"+scanIndex, correctionsParameters.getModelName(this.image_name)+"-img"+scanIndex,
scanIndex, scanIndex,
threadsMax, // maximal number of threads to launch threadsMax, // maximal number of threads to launch
updateStatus, updateStatus,
...@@ -7275,9 +7279,9 @@ public class QuadCLT { ...@@ -7275,9 +7279,9 @@ public class QuadCLT {
if ((x3d_path != null) && (x3dOutput != null)){ if ((x3d_path != null) && (x3dOutput != null)){
// x3d_path+=Prefs.getFileSeparator()+this.image_name+".x3d"; // x3d_path+=Prefs.getFileSeparator()+correctionsParameters.getModelName(this.image_name)+".x3d";
// x3dOutput.generateX3D(x3d_path); // x3dOutput.generateX3D(x3d_path);
x3dOutput.generateX3D(x3d_path+Prefs.getFileSeparator()+this.image_name+".x3d"); x3dOutput.generateX3D(x3d_path+Prefs.getFileSeparator()+correctionsParameters.getModelName(this.image_name)+".x3d");
} }
if (wfOutput != null){ if (wfOutput != null){
wfOutput.close(); wfOutput.close();
...@@ -7562,7 +7566,7 @@ public class QuadCLT { ...@@ -7562,7 +7566,7 @@ public class QuadCLT {
debugLevel); debugLevel);
String path= correctionsParameters.selectX3dDirectory( String path= correctionsParameters.selectX3dDirectory(
//TODO: Which one to use - name or this.image_name ? //TODO: Which one to use - name or this.image_name ?
this.image_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false correctionsParameters.getModelName(this.image_name), // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
correctionsParameters.x3dModelVersion, correctionsParameters.x3dModelVersion,
// name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false // name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
true, // smart, true, // smart,
...@@ -7711,7 +7715,7 @@ public class QuadCLT { ...@@ -7711,7 +7715,7 @@ public class QuadCLT {
String path= correctionsParameters.selectX3dDirectory( String path= correctionsParameters.selectX3dDirectory(
//TODO: Which one to use - name or this.image_name ? //TODO: Which one to use - name or this.image_name ?
this.image_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false correctionsParameters.getModelName(this.image_name), // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
correctionsParameters.x3dModelVersion, correctionsParameters.x3dModelVersion,
// name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false // name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
true, // smart, true, // smart,
...@@ -7841,6 +7845,7 @@ public class QuadCLT { ...@@ -7841,6 +7845,7 @@ public class QuadCLT {
final double disparity_corr = (z_correction == 0) ? 0.0 : geometryCorrection.getDisparityFromZ(1.0/z_correction); final double disparity_corr = (z_correction == 0) ? 0.0 : geometryCorrection.getDisparityFromZ(1.0/z_correction);
image_dtt.clt_aberrations_quad_corr( image_dtt.clt_aberrations_quad_corr(
clt_parameters.img_dtt, // final ImageDttParameters imgdtt_params, // Now just extra correlation parameters, later will include, most others
1, // final int macro_scale, // to correlate tile data instead of the pixel data: 1 - pixels, 8 - tiles 1, // final int macro_scale, // to correlate tile data instead of the pixel data: 1 - pixels, 8 - tiles
tile_op, // per-tile operation bit codes tile_op, // per-tile operation bit codes
disparity_array, // clt_parameters.disparity, // final double disparity, disparity_array, // clt_parameters.disparity, // final double disparity,
...@@ -8054,6 +8059,7 @@ public class QuadCLT { ...@@ -8054,6 +8059,7 @@ public class QuadCLT {
final double disparity_corr = (z_correction == 0) ? 0.0 : geometryCorrection.getDisparityFromZ(1.0/z_correction); final double disparity_corr = (z_correction == 0) ? 0.0 : geometryCorrection.getDisparityFromZ(1.0/z_correction);
image_dtt.clt_aberrations_quad_corr( image_dtt.clt_aberrations_quad_corr(
clt_parameters.img_dtt, // final ImageDttParameters imgdtt_params, // Now just extra correlation parameters, later will include, most others
1, // final int macro_scale, // to correlate tile data instead of the pixel data: 1 - pixels, 8 - tiles 1, // final int macro_scale, // to correlate tile data instead of the pixel data: 1 - pixels, 8 - tiles
tile_op, // per-tile operation bit codes tile_op, // per-tile operation bit codes
disparity_array, // clt_parameters.disparity, // final double disparity, disparity_array, // clt_parameters.disparity, // final double disparity,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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