/////////////////////////////////////////////////////////////////////////////// // PLEASE NOTE: this macro is intended as a pseudo-library and thus has no // // underscore in its filename, so ImageJ doesn't put it somewhere in its // // menu automatically where it doesn't make sense as it is required being // // called with a parameter to trigger the desired function. It is meant to // // be used in conjunction with an ActionBar toolbar instead. // /////////////////////////////////////////////////////////////////////////////// function logger(level, msg) { // verbosity logging, print "msg" only if "level" is equal or // higher than the value of the global variable "loglevel" // levels: 0:quiet, 3:warn, 4:info, 5:debug if (loglevel - level >= 0) print(msg); } function window_exists(title) { // walk through the list of open (non-image) windows and // check if a window with the given title exists windows = getList("window.titles"); for (i=0; i