Output Images Not Saving

Some binary and seg output images of a macro that uses 3D Object Counter won’t open on my computer, even when I comment out the lines closing them, and when I’m able to click them before they close there’s a dialog box saying the images either aren’t there, I’m missing a reader to open them, or they’re not able to be opened on my computer (it won’t tell me which reader I need or if that even is the issue, it’s really vague). There’s also lines in the macro to save them to my desktop since they close before I can save them manually, but they’re not showing up in Finder.

run("3D Objects Counter", "threshold=1 slice=1 min.=1000 max.=4325376 objects statistics summary");
selectWindow("Objects map of Nucleus of "+img_tit);
open("Objects map of Nucleus of "+img_tit);


If the command is to save the image rather than open it, I get an error saying the image is not found.

Dear @lfrankle,

What exactly does that line say? Could you copy and paste the lines with some context (i.e. how is the image created) in here, so that we can figure your issue out?

A wild guess is, that you are trying to save something as an image that is not an image (maybe something like a results table).

Best,
Stefan

I don’t think it’s trying to save a results table as an image. I run the save command right after

run(“3D Objects Counter”, “threshold=1 slice=1 min.=1000 max.=4325376 objects statistics summary”);

or I’ve also tried right after

selectWindow("Objects map of Nucleus of "+img_tit);.

The command itself is just

saveAs(“Tiff”, “Macintosh HD\Users\lanafrankle\Desktop\objectsmap.tif”);

I only get the error messages when

run(“3D Objects Counter”, “threshold=1 slice=1 min.=1 max.=4325376 objects statistics summary”); has a min of 1000 instead of 1 (but I’ve also tried with 500 and 10 and they also produce error messages).

I can see the images (objects map) pop up and then close really fast, before I can do anything, which is frustrating but I don’t know why it’s doing that.

Does it also happen when you execute the following macro?

run("Mitosis (26MB, 5D stack)");
run("3D Objects Counter", "threshold=1 slice=1 min.=1000 max.=4325376 objects statistics summary");

This opens a new image Objects map of mitosis.tif and keeps it open for me. If that’s also the case for you, something is happening in your macro and it has nothing to do with the 3D OC…

Yeah it stays open. It looks blank though, what’s it supposed to show? Anyway it doesn’t matter. I didn’t necessarily suspect the 3D OC to begin with. I’m just not sure what it is about the images being outputted by my macro that is the problem. They’re clearly there for a second. Something is telling them to close, or they’re not able to stay open for some reason. They’re regular tif image stacks, or at least the input image is. I was able to click and save the nucleoli counter because it stayed open for a little longer and it looks fine, but it’s too cluttered because there are so many nucleoli and I can’t really see what’s going on. Also because the labels have “object_val” before the number and it takes up more space than when I run a 3D object count from the Analyze tab, but that’s another issue and not the one I’m focussing on right now. Also when I do the steps in the macro myself by using the menu toolbar/commands it doesn’t give me an error message but the number of nuclei it finds is different than the macro. Very odd. I’m probably doing something wrong, I’m very new.

I’d guess the answer is in the macro (close() et al). Would you mind posting the macro code? Otherwise, it will be really hard to troubleshoot the issue (you can use https://gist.github.com if you want to be able to delete the macro afterwards).