macro "Create Normalized Cells"{ //N. Vischer, 14-feb-2017, for Cooper //to be used in combintion with Coli-Inspector //straightens cell and sqeezes them into a stack of 300*100 pixels nCells = ojNObjects(); close("*NormalizedCells*"); newImage("NormalizedCells.tif", "16-bit black", 300, 100, nCells); destID = getImageID; setBatchMode(true); for(img = 1; img <= ojNImages(); img++){ for(obj = ojFirstObject(img); obj <= ojLastObject(img); obj++){ ojShowObject(obj); getPixelSize(dummy, pxWidth, dummy); dia = ojResult("Dia", obj)/pxWidth; ojItemToRoi(); Stack.setChannel(2); run("Straighten...", "title=Tmp line=&dia"); run("Scale...", "x=- y=- width=300 height=100 interpolation=Bilinear average create"); rename("Tmp2"); run("Select All"); run("Copy"); close("Tmp*");; selectImage(destID); setSlice(obj); run("Paste"); } close("\\Others"); } selectImage(destID); setBatchMode("exit and display"); setSlice(1); run("Enhance Contrast", "saturated=0.35"); run("Z Project...", "projection=[Average Intensity]"); }