Commit 4ca23a78 authored by Andrey Filippov's avatar Andrey Filippov

made clt-based correlation to work correctly

parent ddf19dcf
......@@ -3792,6 +3792,9 @@ private Panel panel1,
/* ======================================================================== */
} else if (label.equals("CLT correlate")) {
DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
runtime.gc();
System.out.println("--- Free memory="+runtime.freeMemory()+" (of "+runtime.totalMemory()+")");
// IJ.showMessage("DCT test 1");
if (!CLT_PARAMETERS.showDialog()) return;
// process selected image stack
......@@ -3997,6 +4000,7 @@ private Panel panel1,
for (int chn = 0; chn < clt_corr.length; chn++) {
image_dtt.clt_dtt2( // DCCT2, DSCT2, DCST2, DSST2 - in-place
clt_corr[chn], // final double [][][][] clt_data,
true, // final boolean transpose, // when doing inverse transform, the data comes in transposed form, so CS <->SC
THREADS_MAX, // maximal number of threads to launch
DEBUG_LEVEL); // globalDebugLevel)
}
......
......@@ -1093,6 +1093,7 @@ public class ImageDtt {
public void clt_dtt2( // transform dcct2, dsct2, dcst2, dsst2
final double [][][][] data,
final boolean transpose, // when doing inverse transform, the data comes in transposed form, so CS <->SC
final int threadsMax, // maximal number of threads to launch
final int globalDebugLevel)
{
......@@ -1112,7 +1113,8 @@ public class ImageDtt {
tileY = nTile/tilesX;
tileX = nTile - tileY * tilesX;
for (int quadrant = 0; quadrant < 4; quadrant++){
data[tileY][tileX][quadrant] = dtt.dttt_iie(data[tileY][tileX][quadrant], quadrant, dct_size);
int mode = transpose ? (((quadrant << 1) & 2) | ((quadrant >> 1) & 1)) : quadrant;
data[tileY][tileX][quadrant] = dtt.dttt_iie(data[tileY][tileX][quadrant], mode, dct_size);
}
}
}
......
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