//Check if the ilastik plugin is installed
List.setCommands;
if (List.get("Import HDF5")=="" && List.get("Add Borders")=="") {
options=newArray("Yes, update", "No, exit");
Dialog.create("Update");
Dialog.addRadioButtonGroup("In order to run this macro you will need to install the \"ilastik\" and \"Morphology\" plugins.\nDo you want to install the \"ilastik\" and \"Morphology\" plugins now?", options, 1, 2, options[0]);
html = ""
+"Follow the next steps at the ImageJ updater:
"
+"
The updater will be automaically opened once you select \"Yes, update\"
"
+"1. Click on \"Manage update sites\"
"
+"2. Check the \"ilastik\" site
"
+"3. Check the \"Morphology\" site
"
+"4. Click on \"Close\" (DO NOT click on \"Add update site\")
"
+"5. Click on \"Apply changes\"
"
+"6. Restart ImageJ";
Dialog.addHelp(html);
Dialog.show();
answer=Dialog.getRadioButton();
if (answer==options[0]) {
run("Update...");
exit()
} else {
exit()
}
} else if (List.get("Import HDF5")=="") {
options=newArray("Yes, update", "No, exit");
Dialog.create("Update");
Dialog.addRadioButtonGroup("In order to run this macro you will need to install the \"ilastik\" plugin.\nDo you want to install the \"ilastik\" plugin now?", options, 1, 2, options[0]);
html = ""
+"Follow the next steps at the ImageJ updater:
"
+"The updater will be automaically opened once you select \"Yes, update\"
"
+"1. Click on \"Manage update sites\"
"
+"2. Check the \"ilastik\" site
"
+"3. Click on \"Close\" (DO NOT click on \"Add update site\")
"
+"4. Click on \"Apply changes\"
"
+"5. Restart ImageJ";
Dialog.addHelp(html);
Dialog.show();
answer=Dialog.getRadioButton();
if (answer==options[0]) {
run("Update...");
exit()
} else {
exit()
}
} else if (List.get("Add Borders")=="") {
options=newArray("Yes, update", "No, exit");
Dialog.create("Update");
Dialog.addRadioButtonGroup("In order to run this macro you will need to install the \"Morphology\" plugin.\nDo you want to install the \"Morphology\" plugin now?", options, 1, 2, options[0]);
html = ""
+"Follow the next steps at the ImageJ updater:
"
+"The updater will be automaically opened once you select \"Yes, update\"
"
+"1. Click on \"Manage update sites\"
"
+"2. Check the \"Morphology\" site
"
+"3. Click on \"Close\" (DO NOT click on \"Add update site\")
"
+"4. Click on \"Apply changes\"
"
+"5. Restart ImageJ";
Dialog.addHelp(html);
Dialog.show();
answer=Dialog.getRadioButton();
if (answer==options[0]) {
run("Update...");
exit()
} else {
exit()
}
}
if (isOpen("ROI Manager")) {
selectWindow("ROI Manager");
run("Close");
}
run("Close All");
setOption("ExpandableArrays", true);
objectTag="_Object Predictions.tiff";
probabilitiesTag="_Probabilities.h5";
dir=getDirectory("Choose a Directory");
list=getFileList(dir);
images=newArray;
count=0;
for (i=0; i