1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
| run("Close All");
dir1 = getDirectory("Choose Root Image Folder");
dirSaveMovies = dir1 + "Movies" + File.separator;
if (File.exists(dirSaveMovies)){} else {File.makeDirectory(dirSaveMovies);}
dir2 = dir1 + "RawData" + File.separator;
list2 = getFileList(dir2);
for (i=0; i<(list2.length); i++) {
dir3 = dir2 + list2[i];
list3 = getFileList(dir3);
file = dir3 + list3[i];
if (endsWith(file, ".tif")) {
run("Image Sequence...", "open=file");
run("Set Scale...", "distance=0 known=0 pixel=1 unit=pixel");
id1=getImageID();
Dialog.create("Need to rotate?");
s0="Do you want to do a rotation?";
Dialog.addMessage(s0);
Dialog.addCheckbox("Rotation", 1);
Dialog.show();
rotate = Dialog.getCheckbox();
if (rotate == 1) {
setTool("angle");
waitForUser("Measure the rotation angle");
Dialog.create("Measure the rotation angle");
Dialog.addNumber("Angle value", 15);
Dialog.show();
angle = Dialog.getNumber();
run("Rotate... ", "angle=&angle grid=1 interpolation=Bilinear stack");
}
Dialog.create("Parameters");
s2="Fill in the fields";
Dialog.addMessage(s2);
Dialog.addString("Acquisition date (without space)", "");
Dialog.addString("Strain name", "");
Dialog.addString("Microscopy", "");
Dialog.addString("Complementary data (without space)", "");
Dialog.addChoice("Bin value", newArray("1", "2"));
Dialog.addNumber("Acquisition Step in seconds", 0.5);
Dialog.addChoice("Movie's format (Warning: Quicktime format is not supported by Fiji)", newArray("Avi", "Quicktime"));
Dialog.show();
bin = Dialog.getChoice();
date = Dialog.getString();
souche = Dialog.getString();
micro = Dialog.getString();
info = Dialog.getString();
time = Dialog.getNumber();
format = Dialog.getChoice();
if (bin == 1) { makeRectangle(188, 114, 1050, 700);
} else { makeRectangle(188, 114, 525, 350); }
waitForUser("Place properly the rectangle around the embryo");
run("Crop");
slice=nSlices;
//run("Time Stamper", "starting=0 interval=" + time + "x=20 y=20 font=20 '00 decimal=2 anti-aliased or=sec");
run("Label...", "format=0 starting=0.0 interval=0.5 x=20 y=20 font=20 text=sec range=slice");
if (format == "Avi") {
saveAs("Avi", dirSaveMovies + date + "_" + souche + "_" + micro + "_" + info + "_" + i + 1 + ".avi");
} else {
saveAs("QuickTime Movie...", "compression=MPEG-4 quality=High frame=10 save=" + dirSaveMovies + date + "_" + souche + "_" + micro + "_" + info + "_" + i + 1 + ".mov");
}
run("Close All");
}
} |
Partager