from __future__ import division import os, os.path, math, copy from ij import ImagePlus, IJ, WindowManager from collections import Counter #from java.awt.event import KeyEvent #@ Integer (label="Select the threshold value, distnace in pixel, below which points should be ignored", style="slider", min=5, max=100, stepSize=1, value=10, persist = true) threshold #@ File (label="Select a directory to process images", style="directory", value = "", persist = false) selected_dir ################################################################# IJ.run("Set Measurements...", "centroid redirect=None decimal=2") if IJ.isResultsWindow(): IJ.selectWindow("Results") IJ.run("Close") ################################################ # Obtained from https://thispointer.com/python-how-to-get-list-of-files-in-directory-and-sub-directories/ #non-recursive version def listDir(dirName, file_type, recursive = False): # create a list of file and sub directories # names in the given directory listOfFile = os.listdir(dirName) allFiles = list() # Iterate over all the entries for entry in listOfFile: # Create full path