Statistiques
| Révision :

root / bin / image2geometry / ImageJ / flip-vertically-mgx.ijm @ 10

Historique | Voir | Annoter | Télécharger (1,32 ko)

1
//////////////////////////////////////////////////////////////////////////////////
2

    
3
//The script will process all your .inr.gz files in the chosen folder.
4
//The stacks will be saved in subfolders named as the treated lif files.
5

    
6
print ("===========================");
7
print ("==== Macro flip-vertically-mgx.ijm ====");
8

    
9

    
10
//Choose the directory containing your .inr.gz files//
11
dir = getDirectory("Choose a directory")
12
setBatchMode(true);
13
list = getFileList(dir);
14

    
15
print(dir);
16
ShortNameDir=substring(dir,0,lastIndexOf(dir,"/"));
17
print (ShortNameDir);
18
dirout=ShortNameDir+"-flipped/";
19
print("Creating output directory ",dirout);
20
File.makeDirectory(dirout);
21

    
22
for (FileInd=0; FileInd<list.length; FileInd++){
23
	FileName = list[FileInd];
24
	if(endsWith (FileName, ".tif")){
25
		print ("### Processing ",FileName," ###");
26
		path = dir+FileName;
27
		pathout = dirout+FileName;
28
		print("avant open", FileName,"!");
29
		//run("Bio-Formats Importer", "open=["+path+"] color_mode=Default view=Hyperstack stack_order=XYCZT use_virtual_stack open_all_series ");
30
		open(path);
31
		print("apres open", FileName,"!");
32
		run("Flip Vertically", "stack");
33
		saveAs("Tiff", pathout);
34
		print("avant close", FileName,"!");
35
		run("Close All");
36
		print("Done with", FileName,"!");
37
	} else {
38
	print("### ",FileName," Not a .tif file ###");
39
	};
40
};	
41
print("Done with this folder!!!");
42

    
43

    
44

    
45