ImageJ base code to get access to all the classes and their methods to test new Plugins. https://imagejdocu.tudor.lu/howto/plugins/the_imagej_eclipse_howto
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
484 B

3 years ago
  1. // Converts a stack to binary using locally calculated thresholds
  2. setBatchMode(true);
  3. run("Select None");
  4. run("8-bit");
  5. id = getImageID;
  6. for (i=1; i<=nSlices; i++) {
  7. setSlice(i);
  8. run("Duplicate...", "title=temp");
  9. run("Convert to Mask");
  10. invertingLUT = is("Inverting LUT");
  11. run("Copy");
  12. close;
  13. selectImage(id);
  14. run("Paste");
  15. if (i==1 && invertingLUT != is("Inverting LUT"))
  16. run("Invert LUT");
  17. }
  18. run("Select None");