Bonjour, je suis un étudiant en biologie et je ne connais pas grand chose en informatique. Dans le cadre de mon stage j'utilise image j. J'ai réaliser une macro mais elle ne se lance pas le logiciel m'affiche " no dialog created with Dialog.create() in line 2. Dialog.<addChoice>("Files extension", newArray("all",.png","tif,".jpg"));
voici ma macro:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
Dialog.addChoice("Files extension", newArray("all", ".png", ".tif", ".jpg"));
 
inputDir = getDirectory("Choose the input directory ");
outputDir = getDirectory("Choose the output directory ");
imageType = Dialog.getChoice;
 
inputFilesList = getFileList(inputDir);
for (i=0; i < inputFilesList.length; i++){
	if( imageType == "all"){
		if( !endsWith(inputFilesList[i], "/") ){
			maxProject(inputDir, outputDir, inputFilesList[i]);
		}
	}
	else{
		if( endsWith(inputFilesList[i], imageType)){
			maxProject(inputDir, outputDir, inputFilesList[i]);
		}
	}
}
 
function maxProject(inputDir, outputDir, imageName){
	open(inputDir + imageName);
	run("Split Channels");
       selectWindow("Image j.png (blue)");
       close();
       selectWindow("Image j.png (red)");
       close();
       selectWindow("Image j.png (green)");
       setAutoThreshold("Default dark");
       //run("Threshold...");
       //setThreshold(180, 255);
       setOption("BlackBackground", false);
       run("Convert to Mask");
 
	saveAs("Tiff", outputDir + "MAX_" + imageName);
} 
 
 
 
close();
Merci pour votre aide