// start from m files //this one uses all m files in texture practice m run("Set Measurements...", "area mean standard perimeter fit shape median skewness kurtosis display add redirect=None decimal=3"); sCount = 0; // count of sperm images iCount = 0; // source image count/indexer gImg = ""; bImg = ""; wImg = ""; // store image names // Ask for directory, set up a /cells subdirectory under it for the sperm cell images, // and get a list of all source image files. dir = getDirectory("Select Source Directory:"); cellsDir = dir+"/cells/"; File.makeDirectory(cellsDir); files = getFileList(dir); //test batch mode activated setBatchMode(true); for (i=0; i=1) { run("GLCM Texture", "enter="+step+ " select=[0 degrees] angular contrast correlation inverse entropy"); close(); asm = getResult("Angular Second Moment",0); contrast = getResult("Contrast",0); correlation = getResult("Correlation",0); idm = getResult("Inverse Difference Moment ",0); //Extra spaces needed due to source code error entropy = getResult("Entropy",0); print(list[i],",",asm,",",contrast,",",correlation,",",idm,",",entropy); } } //step = getNumber("Enter the size of the step in pixels: ", 1); //setBatchMode(true); step=1; for (i=0; i=1) { run("GLCM Texture", "enter="+step+ " select=[90 degrees] angular contrast correlation inverse entropy"); close(); asm = getResult("Angular Second Moment",0); contrast = getResult("Contrast",0); correlation = getResult("Correlation",0); idm = getResult("Inverse Difference Moment ",0); //Extra spaces needed due to source code error entropy = getResult("Entropy",0); print(list[i],",",asm,",",contrast,",",correlation,",",idm,",",entropy); } } //step = getNumber("Enter the size of the step in pixels: ", 1); //setBatchMode(true); step=1; for (i=0; i=1) { run("GLCM Texture", "enter="+step+ " select=[180 degrees] angular contrast correlation inverse entropy"); close(); asm = getResult("Angular Second Moment",0); contrast = getResult("Contrast",0); correlation = getResult("Correlation",0); idm = getResult("Inverse Difference Moment ",0); //Extra spaces needed due to source code error entropy = getResult("Entropy",0); print(list[i],",",asm,",",contrast,",",correlation,",",idm,",",entropy); } } //step = getNumber("Enter the size of the step in pixels: ", 1); //setBatchMode(true); step=1; for (i=0; i=1) { run("GLCM Texture", "enter="+step+ " select=[270 degrees] angular contrast correlation inverse entropy"); close(); asm = getResult("Angular Second Moment",0); contrast = getResult("Contrast",0); correlation = getResult("Correlation",0); idm = getResult("Inverse Difference Moment ",0); //Extra spaces needed due to source code error entropy = getResult("Entropy",0); print(list[i],",",asm,",",contrast,",",correlation,",",idm,",",entropy); } } selectWindow("Log"); saveAs("Text", dir+"1step.txt");