Skip to content

Commit

Permalink
v.0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ekatrukha committed Feb 5, 2021
1 parent 03437db commit 811e772
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 6 deletions.
Binary file modified Correlescence_v_0.0.4.jar
Binary file not shown.
Binary file modified bin/Correlescence/Corr1DSTICS.class
Binary file not shown.
Binary file modified bin/Correlescence/Corr2DSTICS.class
Binary file not shown.
Binary file modified bin/Correlescence/Correlescence2D.class
Binary file not shown.
8 changes: 7 additions & 1 deletion src/Correlescence/Corr1DSTICS.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import ij.ImagePlus;
import ij.Prefs;
import ij.gui.GenericDialog;
import ij.measure.Calibration;
import ij.plugin.PlugIn;

public class Corr1DSTICS implements PlugIn {
Expand All @@ -30,6 +31,7 @@ public void run(String arg)
int nStackSize;
int imHeight;
String sTitle;
ImagePlus finalImp;

imp = IJ.getImage();
imHeight= imp.getHeight();
Expand Down Expand Up @@ -72,7 +74,11 @@ else if (imp.getType() != ImagePlus.GRAY8 && imp.getType() != ImagePlus.GRAY16 &
else
sTitle=sTitle+"_1Dxt_fft";

new ImagePlus(sTitle,x1D.xCorrSpaceTime(imp.getProcessor(), nMaxUserDelay1D,nCalcMethod,nNormMethod)).show();
finalImp = new ImagePlus(sTitle,x1D.xCorrSpaceTime(imp.getProcessor(), nMaxUserDelay1D,nCalcMethod,nNormMethod));
Calibration cal = finalImp.getCalibration();
cal.xOrigin=Math.round(imp.getWidth()*0.5)-1;
cal.yOrigin=0;
finalImp.show();
//x1D.xCorrSpaceTimeFFT();
}

Expand Down
1 change: 1 addition & 0 deletions src/Correlescence/Corr2DSTICS.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ else if (imp.getType() != ImagePlus.GRAY8 && imp.getType() != ImagePlus.GRAY16 &
sTitle=imp.getTitle();
IJ.showStatus("2D STICS calculation done.");
finalImp=new ImagePlus(sTitle+"_2D_STICS", stSTICS);
//calibration
Calibration cal = finalImp.getCalibration();
cal.xOrigin=Math.round(origW*0.5);
cal.yOrigin=Math.round(origH*0.5);
Expand Down
14 changes: 9 additions & 5 deletions src/Correlescence/Correlescence2D.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public void run(String arg) {
int [] xymax;
String sTitle;
String sImTitle;
String sInTitle;
ImageStack crosscorrstack;
int [][] xydrifttable;
boolean bAutoCorr =false;
Expand Down Expand Up @@ -78,6 +79,7 @@ else if (imp.getType() != ImagePlus.GRAY8 && imp.getType() != ImagePlus.GRAY16 &
IJ.log("Only one image in stack, limiting choice to autocorrelation");
bAutoCorr=true;
}
sInTitle = imp.getTitle();

if(!x2Dialog(bAutoCorr))
return;
Expand All @@ -101,7 +103,7 @@ else if (imp.getType() != ImagePlus.GRAY8 && imp.getType() != ImagePlus.GRAY16 &
if(sChoice.equals("consecutive images"))
{
sImTitle =sImTitle +sChoice;
sImTitle = sImTitle+"_delay_"+Integer.toString(nImNumber);
sImTitle = sImTitle+"_delay_"+Integer.toString(nImNumber)+"_"+sInTitle;
if (bDrift)
{
xydrifttable[0][0]=0;
Expand Down Expand Up @@ -162,8 +164,9 @@ else if (imp.getType() != ImagePlus.GRAY8 && imp.getType() != ImagePlus.GRAY16 &
//current image in stack and all others
if(sChoice.equals("current image in stack and all others"))
{
sImTitle =sImTitle +"vs_current_image";

i=imp.getCurrentSlice();
sImTitle =sImTitle +"vs_frame"+Integer.toString(i)+"_"+sInTitle;
ip1=getFloatversion(imp);
//subtract average intensity value
ip1.subtract(ImageStatistics.getStatistics(ip1,Measurements.MEAN,null).mean);
Expand Down Expand Up @@ -205,7 +208,7 @@ else if (imp.getType() != ImagePlus.GRAY8 && imp.getType() != ImagePlus.GRAY16 &
//autocorrelation
if(sChoice.equals("autocorrelation"))
{
sImTitle =sImTitle +"autocorrelation_";
sImTitle =sImTitle +"autocorrelation_"+sInTitle;

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

sTitle = String.format("corr_%d_x_%d", j,j);
xymax = getmaxpositions(ip);
xymax = getmaxpositionscenterlimit(ip);
//xymax = getmaxpositions(ip);

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

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

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

0 comments on commit 811e772

Please sign in to comment.