Sie sind auf Seite 1von 2

//Michael Lawrence G.

Castanares, Sync-biooptics group, IPL //Created: 2013 //function: used to determine the total cell area photoinhibition //experiment //note: The user must take note the sampling interval of the images. //output: a summary table of the containing the 'total area' //of the detected cells. //User must save the table as 'Summary.xls' file and calculate //for the CAI = Area[t]/Area[0] using excel. //required inputs: // A - directory file path // input - path of the folder containing the images (e.g 0.jpg, 1.jpg,...) // and the background image "BG.jpg" // output // A+"/rmBG/" - folder where all the "cleaned" images (8-bit) // will be stored A="/home/michael/Desktop/Dropbox/1.0 IPL/c. Data/photodamage/ Nomoredrift/091613" input =A+"/1730 (8.5hrs) Yellow1.04mW(1)/" output = A+ "/A_Yellow1.04mW(1)/" setBatchMode(true); list = getFileList(input); for (i =0; i <=120; i++) { filename =i; open(input+filename+".jpg"); run("Smooth"); run("Duplicate...", "title=im.jpg"); open(input+"BG.jpg"); run("Smooth"); imageCalculator("Subtract create 32-bit", "im.jpg","BG.jpg"); run("Duplicate...", "title=temp.jpg"); run("Smooth"); run("8-bit"); run("Enhance Contrast", "saturated=0.4 normalize"); run("Deriche...", "alpha=1"); selectWindow("Canny-Deriche suppr 1.0"); run("8-bit"); run("Smooth"); run("Duplicate...", "title=result.jpg"); setThreshold(20,255);//bright run("Convert to Mask"); run("Dilate"); run("Dilate"); run("Close-");

run("Fill Holes"); run("Erode"); run("Erode"); run("Watershed"); //makeRectangle(42, 31, 565, 428); //run("Crop"); //select ROI, use makePolygon() to define a region of interest makePolygon(4,15,616,14,621,285,344,350,193,455,34,452); run("Add Selection..."); run("To ROI Manager"); run("Analyze Particles...", "size=300-100000 circularity=0.00-1.00 show=Masks display include summarize"); selectWindow("result.jpg"); imageCalculator("Subtract create 32-bit","im.jpg", "Mask of result.jpg");

saveAs("JPEG", output+"A_"+filename); while(nImages>0){ selectImage(nImages); close();} }

Das könnte Ihnen auch gefallen