Skip to content

Commit 811e772

Browse files
committed
v.0.0.4
1 parent 03437db commit 811e772

File tree

7 files changed

+17
-6
lines changed

7 files changed

+17
-6
lines changed

Correlescence_v_0.0.4.jar

248 Bytes
Binary file not shown.
314 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
202 Bytes
Binary file not shown.

src/Correlescence/Corr1DSTICS.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import ij.ImagePlus;
55
import ij.Prefs;
66
import ij.gui.GenericDialog;
7+
import ij.measure.Calibration;
78
import ij.plugin.PlugIn;
89

910
public class Corr1DSTICS implements PlugIn {
@@ -30,6 +31,7 @@ public void run(String arg)
3031
int nStackSize;
3132
int imHeight;
3233
String sTitle;
34+
ImagePlus finalImp;
3335

3436
imp = IJ.getImage();
3537
imHeight= imp.getHeight();
@@ -72,7 +74,11 @@ else if (imp.getType() != ImagePlus.GRAY8 && imp.getType() != ImagePlus.GRAY16 &
7274
else
7375
sTitle=sTitle+"_1Dxt_fft";
7476

75-
new ImagePlus(sTitle,x1D.xCorrSpaceTime(imp.getProcessor(), nMaxUserDelay1D,nCalcMethod,nNormMethod)).show();
77+
finalImp = new ImagePlus(sTitle,x1D.xCorrSpaceTime(imp.getProcessor(), nMaxUserDelay1D,nCalcMethod,nNormMethod));
78+
Calibration cal = finalImp.getCalibration();
79+
cal.xOrigin=Math.round(imp.getWidth()*0.5)-1;
80+
cal.yOrigin=0;
81+
finalImp.show();
7682
//x1D.xCorrSpaceTimeFFT();
7783
}
7884

src/Correlescence/Corr2DSTICS.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ else if (imp.getType() != ImagePlus.GRAY8 && imp.getType() != ImagePlus.GRAY16 &
9696
sTitle=imp.getTitle();
9797
IJ.showStatus("2D STICS calculation done.");
9898
finalImp=new ImagePlus(sTitle+"_2D_STICS", stSTICS);
99+
//calibration
99100
Calibration cal = finalImp.getCalibration();
100101
cal.xOrigin=Math.round(origW*0.5);
101102
cal.yOrigin=Math.round(origH*0.5);

src/Correlescence/Correlescence2D.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public void run(String arg) {
4848
int [] xymax;
4949
String sTitle;
5050
String sImTitle;
51+
String sInTitle;
5152
ImageStack crosscorrstack;
5253
int [][] xydrifttable;
5354
boolean bAutoCorr =false;
@@ -78,6 +79,7 @@ else if (imp.getType() != ImagePlus.GRAY8 && imp.getType() != ImagePlus.GRAY16 &
7879
IJ.log("Only one image in stack, limiting choice to autocorrelation");
7980
bAutoCorr=true;
8081
}
82+
sInTitle = imp.getTitle();
8183

8284
if(!x2Dialog(bAutoCorr))
8385
return;
@@ -101,7 +103,7 @@ else if (imp.getType() != ImagePlus.GRAY8 && imp.getType() != ImagePlus.GRAY16 &
101103
if(sChoice.equals("consecutive images"))
102104
{
103105
sImTitle =sImTitle +sChoice;
104-
sImTitle = sImTitle+"_delay_"+Integer.toString(nImNumber);
106+
sImTitle = sImTitle+"_delay_"+Integer.toString(nImNumber)+"_"+sInTitle;
105107
if (bDrift)
106108
{
107109
xydrifttable[0][0]=0;
@@ -162,8 +164,9 @@ else if (imp.getType() != ImagePlus.GRAY8 && imp.getType() != ImagePlus.GRAY16 &
162164
//current image in stack and all others
163165
if(sChoice.equals("current image in stack and all others"))
164166
{
165-
sImTitle =sImTitle +"vs_current_image";
167+
166168
i=imp.getCurrentSlice();
169+
sImTitle =sImTitle +"vs_frame"+Integer.toString(i)+"_"+sInTitle;
167170
ip1=getFloatversion(imp);
168171
//subtract average intensity value
169172
ip1.subtract(ImageStatistics.getStatistics(ip1,Measurements.MEAN,null).mean);
@@ -205,7 +208,7 @@ else if (imp.getType() != ImagePlus.GRAY8 && imp.getType() != ImagePlus.GRAY16 &
205208
//autocorrelation
206209
if(sChoice.equals("autocorrelation"))
207210
{
208-
sImTitle =sImTitle +"autocorrelation_";
211+
sImTitle =sImTitle +"autocorrelation_"+sInTitle;
209212

210213
//i=imp.getCurrentSlice();
211214
//ip1=getFloatversion(imp);
@@ -223,7 +226,8 @@ else if (imp.getType() != ImagePlus.GRAY8 && imp.getType() != ImagePlus.GRAY16 &
223226
{ip = x2D.calcFFTCorrelationImage(ip2, ip2);}
224227

225228
sTitle = String.format("corr_%d_x_%d", j,j);
226-
xymax = getmaxpositions(ip);
229+
xymax = getmaxpositionscenterlimit(ip);
230+
//xymax = getmaxpositions(ip);
227231

228232
ptable.incrementCounter();
229233
ptable.addLabel(sTitle);
@@ -299,7 +303,7 @@ public boolean x2Dialog(boolean bAutoOn)
299303
else
300304
{ x2DDial.addRadioButtonGroup("Calculate 2D cross correlation between:", items, 3, 1, Prefs.get("Correlescence.2Dcorr", "consecutive images"));}
301305

302-
x2DDial.addNumericField("for consecutive, distance between images", Prefs.get("Correlescence.2Ddist", 1), 0, 4, " ");
306+
x2DDial.addNumericField("for consecutive, interval between images", Prefs.get("Correlescence.2Ddist", 1), 0, 4, "frames (or slices) ");
303307
x2DDial.addChoice("Calculation method:", itemsC, Prefs.get("Correlescence.2Dcorrmethod", "FFT cross-correlation (fast)"));
304308

305309
x2DDial.addCheckbox("Correct drift (max of corr)?", Prefs.get("Correlescence.2Ddrift", false));

0 commit comments

Comments
 (0)