| 
					
	
	
	
	
				 | 
				
					
	
	 
		Hello,
  I have a question concerning the threshold image (black/white).
 If I do it by hand (Image>Adjust>Threshold) I prefer the Black&White look.
 (This means that areas with high intensities are black.) So I recorded a
 macro in this way.
  What does the macro do?
 Input images are z-stacks.
  1) Z-projection of Channel 1
 2) Threshold this projection and convert to mask
 3) Z-projection of Channel 2
 4) Threshold this projection and convert to mask
 5) Multiply ouput image of  2) and 4)
 6) Measure output image of 5)
  This works fine I guess. But there is something irritating.
  I want the output images of 2) and 4) to be like this: High intensities
 black.
 But sometimes the output is inverted. Even of the same input image (this
 means Channel 1 is inverted Channel 2 not). The ouput image of 5) always
 looks okay. So it seems to be okay (but I am not sure).
  Do I have to bother?
  Thanks
 Johannes
 
 
 
  macro "Open Cocu" {
 DIR=getDirectory("Choose Folder");
 NAMES=getFileList(DIR);
 for (i=0; i<NAMES.length; i++) {
 open(DIR+NAMES[i]);
 Aid = getImageID();
 //make first projection
 run("Z Project...", "start=1 stop=6 projection=[Max Intensity]");
 setAutoThreshold();
 //run("Threshold...");
 run("Convert to Mask");
 A_zproject_name = getTitle();
 //This is the image of channel 1
  //restore selection to the first image
 selectImage(Aid);
  //make second projection
 run("Z Project...", "start=7 stop=12 projection=[Max Intensity]");
 run("Subtract...", "value=500");
 setAutoThreshold();
 //run("Threshold...");
 run("Convert to Mask");
 B_zproject_name = getTitle();
 //This is the image of channel 2
  imageCalculator("Multiply create 32-bit", A_zproject_name,B_zproject_name);
 //run("Image Calculator...", "image1=A_zproject_name operation=Multiply
 image2=B_zproject_name create 32-bit");
 
  run("Measure");
 }
 }
 
	
	
	
	 
				 |