All Downloads are FREE. Search and download functionalities are using the official Maven repository.

macros.ConvertStackToBinary.txt Maven / Gradle / Ivy

Go to download

ImageJ is an open source Java image processing program inspired by NIH Image for the Macintosh.

There is a newer version: 1.54m
Show newest version
// Converts a stack to binary using locally calculated thresholds

  setBatchMode(true);
  run("Select None");
  run("8-bit");
  id = getImageID;
  for (i=1; i<=nSlices; i++) {
     setSlice(i);
     run("Duplicate...", "title=temp");
     run("Convert to Mask");
     invertingLUT = is("Inverting LUT");
     run("Copy");
     close;
     selectImage(id);
     run("Paste");
     if (i==1 && invertingLUT != is("Inverting LUT"))
         run("Invert LUT");
  }
  run("Select None");




© 2015 - 2024 Weber Informatics LLC | Privacy Policy