|
| 1 | +CHANNEL = 1; |
| 2 | +SIGMA = 10; |
| 3 | +PROEMINENCE = 0; |
| 4 | +TABLE = "Number of Rosettes"; |
| 5 | + |
| 6 | +folder = getDir("Select the input folder!"); |
| 7 | +outFolder = getDir("Select_the output folder!"); |
| 8 | +files = getFileList(folder); |
| 9 | + |
| 10 | +for (i = 0; i < files.length; i++) { |
| 11 | + file = files[i]; |
| 12 | + run("Bio-Formats", "open=["+folder + file+"] autoscale color_mode=Default rois_import=[ROI manager] view=Hyperstack stack_order=XYCZT"); |
| 13 | + makeRectangle(408, 393, 1374, 1353); |
| 14 | + inputImageID = getImageID(); |
| 15 | + title = getTitle(); |
| 16 | + if (!isOpen(TABLE)) { |
| 17 | + Table.create(TABLE); |
| 18 | + } |
| 19 | + run("Clear Results"); |
| 20 | + run("Duplicate...", "duplicate channels="+CHANNEL); |
| 21 | + run("Invert"); |
| 22 | + run("FeatureJ Laplacian", "compute smoothing="+SIGMA); |
| 23 | + run("Find Maxima...", "prominence="+PROEMINENCE+" exclude light output=[Point Selection]"); |
| 24 | + run("Measure"); |
| 25 | + numberOfRosettes = nResults; |
| 26 | + row = Table.size(TABLE); |
| 27 | + Table.set("image", row, title, TABLE); |
| 28 | + Table.set("number", row, numberOfRosettes, TABLE); |
| 29 | + close(); |
| 30 | + run("Restore Selection"); |
| 31 | + selectImage(inputImageID); |
| 32 | + close(); |
| 33 | + run("Invert"); |
| 34 | + parts = split(file, "."); |
| 35 | + filename = parts[0]; |
| 36 | + saveAs("tiff", outFolder + filename + ".tif"); |
| 37 | + close(); |
| 38 | +} |
0 commit comments