To save the answers of the dialog


I create a dialog to know information about the ROI when I draw this. Can I save the answers to this?

Dialog.create(“enter some roi”);
Dialog.addNumber(“roi1”, 2);;
roi1 = Dialog.getNumber();
n = newArray(roi1);
Dialog.create(“Head, body tail”);
Dialog.addNumber(“roi1”, 2);;
roi1 = Dialog.getNumber();
n = newArray(place);

Is it possible or do I need another function?

Hi @Yasmine_student ,

Apologies if this is not helpful, but it’s not exactly clear what you’re trying to do. I suspect you’re aware of this but if you know how many ROIs you are working with you can use newArray to initialise an Array (one per item) in which to store them.

Another option that might be useful if you don’t know how many you’re working with is to write out the information to a simple text file (eg. see the print function and contained Save Text File Demo). This can always be read back in and parsed if you need to do something with the info afterwards.

Hope that helps!

I am going to manually draw my ROI in ImageJ. I want to know on which slide I draw it and where (head, body or end). That’s why I want to create a dialog box to save the answers.