Skip to content

Instantly share code, notes, and snippets.

@romainGuiet
Created March 30, 2019 08:41
Show Gist options
  • Save romainGuiet/a6ec5e79dc84d816c82aa676dd9071fa to your computer and use it in GitHub Desktop.
Save romainGuiet/a6ec5e79dc84d816c82aa676dd9071fa to your computer and use it in GitHub Desktop.
An ImageJ macro language script to perform multi_DoG
title = getTitle;
close("\\Others");
roiManager("Reset");
sigma1 = newArray(1,2,3,4,5,10);
for (i = 0 ; i < lengthOf(sigma1) ; i++) {
selectWindow(title);
run("Duplicate...", "title=gb1");
run("Gaussian Blur...", "sigma="+sigma1[i]);
selectWindow(title);
run("Duplicate...", "title=gb2");
run("Gaussian Blur...", "sigma="+(1.6*sigma1[i]));
imageCalculator("Subtract create 32-bit", "gb2","gb1");
selectWindow("Result of gb2");
getStatistics(area, mean, min, max, std, histogram);
run("Subtract...", "value="+min);
run("Divide...", "value="+(max-min));
//run("Divide...", "value="+(mean));
resetMinAndMax;
rename("image_"+i);
selectImage("gb1");
close;
selectImage("gb2");
close;
}
run("Images to Stack", "name=multiDoG title=[image_] use");
run("Z Project...", "projection=[Min Intensity]");
//waitForUser;
noise = newArray(1, 0.5, 0.05, 0.01);
for (i = 0 ; i < lengthOf(noise) ; i++) {
run("Find Maxima...", "noise="+noise[i]+" output=[Point Selection] light");
Roi.setName("noise_"+noise[i]);
roiManager("Add");
}
selectWindow(title);
run("Restore Selection");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment