Dear all,
I write a macro with a dialog box but some user close the box during the macro and the macro stop.
Could I check if the dialog is open then get the number and continue the macro ?
The goals is to extract a selected region of the .ndpi in big tiff with NDPItools
run("Preview NDPI...", "ndpitools=[inputPath]");
//draw a box to convert a part of the real area
Dialog.create("how many times do you want to cut?");
Dialog.addNumber("cut", 1);
Dialog.show();
run("Tile");
dialog_open = isOpen("how many times do you want to cut?");
if (dialog_open == true) {
cut = Dialog.getNumber();
close("*");
}
else {
cut = 1;
close("*");
}
if (cut > 0){
for (v = 1; v <= cut; v++) {
run("Preview NDPI...", "ndpitools=[inputPath]");
waitForUser("draw a box and then hit ok");
//run the pluggin NDPItools extract 10x in big.tiff with LZW compression
run("Custom extract to TIFF / Mosaic...", "label=["+v+"] format_of_split_images=[TIFF with LZW compression] store_split_images_in_bigtiff_files_rather_than_tiff make_mosaic=never mosaic_pieces_format=[TIFF with JPEG compression] requested_jpeg_compression=75 mosaic_pieces_overlap=0.000000 mosaic_pieces_overlap_unit=pixels size_limit_on_each_mosaic_piece=0 width_of_each_mosaic_piece_in_pixels=0 height_of_each_mosaic_piece_in_pixels=0 save_these_choices_in_imagej's_preferences_file extract_images_at_magnification_10x extract_images_with_z-offset_0");
close("*");
}
}