root / bin / ImageJ / lsm2tif.ijm @ 18
Historique | Voir | Annoter | Télécharger (1,23 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 inr2tif.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+"-tif/"; |
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, ".lsm")){ |
25 |
print ("### Processing ",FileName," ###"); |
26 |
path = dir+FileName; |
27 |
ShortName=substring(FileName,0,indexOf(FileName,".lsm")); |
28 |
//run("Bio-Formats Importer", "open=["+path+"] color_mode=Default view=Hyperstack stack_order=XYCZT use_virtual_stack open_all_series "); |
29 |
TiffName=ShortName+".tif"; |
30 |
open(path); |
31 |
saveAs("Tiff", dirout+TiffName); |
32 |
run("Close All"); |
33 |
print("Done with", FileName,"!"); |
34 |
} else { |
35 |
print("### ",FileName," Not an .lsm file ###"); |
36 |
}; |
37 |
}; |
38 |
print("Done with this folder!!!"); |
39 |
|
40 |
|
41 |
|
42 |
|