-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbatch_select_ROI_kymo.ijm
29 lines (22 loc) · 1.01 KB
/
batch_select_ROI_kymo.ijm
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
// This script crops all open images to the user-selected ROI and saves them as TIFF files in a specified folder.
// Define the folder where cropped images will be saved
output_folder_path = "/Users/domchom/Documents/Bement_lab/Meeting:conferences/!Lab_Meetings/240219_Present_lab-meeting/movies/200v1000ng-Ect2_RhoGTP_F-actin/";
while (nImages > 0) {
// Get the name of the current image
fileName = getTitle();
//saves image name for future use
dotIndex = indexOf(fileName, ".");
//this and the following line get the file name without the extension
fileNameWithoutExtension = substring(fileName, 0, dotIndex);
newFileName = fileNameWithoutExtension + "_kymo.tif" ;
// start the animation of the movie
run("Animation Options...", "speed=20");
doCommand("Start Animation [\\]");
waitForUser("Select the ROI for " + fileName);
selectWindow(fileName);
//crop the image to the ROI
run("Reslice [/]...", "output=1.000 slice_count=1 avoid");;
saveAs("Tiff", output_folder_path + newFileName);
close();
close();
}