Posted by
otills on
URL: http://imagej.273.s1.nabble.com/Including-folder-name-in-image-naming-by-a-macro-tp3689365p3689368.html
Hi,
Thankyou Ben and John for your advice. I think I should be able to use these functions to achieve what I want, however I've had no luck incorporating them into my macro.
It is designed to open an image stack, identify two regions of interest which are then duplicated from the stack and saved as separate stacks. I'm going to be doing this for a large number of files so, although I've managed to label the slices with their number I'd like the date taken to be included on this label too. Can you suggest how I might incorporate this into the macro below?
run("Image Sequence...", "open=[C:\\Documents and Settings\\otills\\My Documents\\Allied Camera Trial\\421 Test 1 well\\421_Test100000.BMP] number=50 starting=1 increment=1 scale=100 file=[] or=[] sort");
makeRectangle(752, 694, 326, 296);
run("Duplicate...", "title=[421 Test 1 well-1] duplicate range=1-50");
run("Label...", "starting=0 interval=1 x=5 y=20 font=30 text=C");
run("Image Sequence... ", "format=TIFF name=170210 start=0 digits=4 save=[C:\\Documents and Settings\\otills\\My Documents\\Allied Camera Trial\\New Folder\\1702100000.tif] save=[C:\\Documents and Settings\\otills\\My Documents\\Allied Camera Trial\\New Folder\\1702100000.tif]");
selectWindow("421 Test 1 well-1");
close();
selectWindow("421 Test 1 well");
makeRectangle(752, 694, 326, 296);
run("Duplicate...", "title=[421 Test 1 well-1] duplicate range=1-50");
run("Label...", "starting=0 interval=1 x=5 y=20 font=30 text=A");
run("Image Sequence... ", "format=TIFF name=170210 start=0 digits=4 save=[C:\\Documents and Settings\\otills\\My Documents\\Allied Camera Trial\\New Folder1\\1702100000.tif] save=[C:\\Documents and Settings\\otills\\My Documents\\Allied Camera Trial\\New Folder1\\1702100000.tif]");
selectWindow("421 Test 1 well-1");
close();
selectWindow("421 Test 1 well");
close();
Also, how can I modify this macro to run on images in all subfolders?
Many thanks,
Oli Tills
[hidden email]