Commit 6dd7be11 authored by Andrey Filippov's avatar Andrey Filippov

Implemented LMA-based filtering of the moving targets

parent 4342fd2a
...@@ -1067,7 +1067,7 @@ G= Y +Pr*(- 2*Kr*(1-Kr))/Kg + Pb*(-2*Kb*(1-Kb))/Kg ...@@ -1067,7 +1067,7 @@ G= Y +Pr*(- 2*Kr*(1-Kr))/Kg + Pb*(-2*Kb*(1-Kb))/Kg
if (pslice_titles != null) { if (pslice_titles != null) {
pslice_titles[0] = slice_l; pslice_titles[0] = slice_l;
} }
double [][] file_data = ShowDoubleFloatArrays.readDoubleArray( double [][] file_data = readDoubleArray(
imp, // ImagePlus imp, imp, // ImagePlus imp,
0, // int num_slices, // (0 - all) 0, // int num_slices, // (0 - all)
wh); // int [] wh); // int [] wh) wh); // int [] wh); // int [] wh)
......
This diff is collapsed.
...@@ -2422,12 +2422,18 @@ public class Correlation2d { ...@@ -2422,12 +2422,18 @@ public class Correlation2d {
boolean ignore_border, // only if fpn_mask != null - ignore tile if maximum touches fpn_mask boolean ignore_border, // only if fpn_mask != null - ignore tile if maximum touches fpn_mask
boolean debug) boolean debug)
{ {
boolean exclude_margins = false;
if ((fpn_mask!=null) && (fpn_mask.length==0)) {
exclude_margins = true;
fpn_mask = null;
}
boolean calc_fraction = data_width < 0; boolean calc_fraction = data_width < 0;
if (calc_fraction) { if (calc_fraction) {
data_width = -data_width; data_width = -data_width;
} }
int data_height = data.length/data_width; int data_height = data.length/data_width;
int center_xy = (data_width - 1)/2; // = transform_size - 1; // int center_xy = (data_width - 1)/2; // = transform_size - 1;
int center_xy = data_width / 2; // = transform_size - 1;
double x0 = center_xy, y0 = center_xy; double x0 = center_xy, y0 = center_xy;
int imax= 0; int imax= 0;
for (int i= 1; i < data.length;i++) { for (int i= 1; i < data.length;i++) {
...@@ -2438,6 +2444,12 @@ public class Correlation2d { ...@@ -2438,6 +2444,12 @@ public class Correlation2d {
double mx = data[imax]; double mx = data[imax];
int ix0 = imax % data_width; int ix0 = imax % data_width;
int iy0 = imax / data_width; int iy0 = imax / data_width;
if (exclude_margins) {
if ((ix0 == 0) || (iy0== 0) || (ix0 == (data_width-1)) || (iy0 == (data_height-1))) {
return null; // maximum is on the tile border.
}
}
x0 = ix0; x0 = ix0;
y0 = iy0; y0 = iy0;
// if (fpn_mask != null // if (fpn_mask != null
......
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