-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_channels.ijm
43 lines (33 loc) · 920 Bytes
/
get_channels.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* Get channels from each file in a dataset
* 1 August 2018
*
* INPUT DATASET:
* > any image file
*
*
* SCRIPT FUNCTIONALITY:
* > Choose input directory with a set of images
* > Print number of channels
*
*/
setBatchMode(true);
// Load files
indir = getDirectory("~/Desktop/test_batch");
list = getFileList(indir);
print("Get Dimensions");
// Set up loop to read all files in a directory
for (i=0; i<list.length; i++) {
showProgress(i+1, list.length);
print("processing ... "+i+1+"/"+list.length+"\n "+list[i]);
path=indir+list[i];
// Start macro
// Open file
run("Bio-Formats", "open=path color_mode=Default rois_import=[ROI manager] view=Hyperstack stack_order=XYCZT");
image = getTitle();
// Measure screen
getDimensions(w, h, channels, slices, frames);
Stack.getPosition(channel, slice, frame);
print(" Channels: "+channels);
close();
}
setBatchMode(false);