I am requesting help on an image analysis macro. I am not a programmer and could use any help you can afford.
I would like to batch process hundreds of images in a single directory where the tool would analyze two images in a file name series and if something is different, make a copy in another directory. Ideally I would have a threshold adjustment tool that I could adjust. Example: Img2 = Img1 – YES, do nothing and move to next batch process Img3 = Img2 – NO, Make copy of Img3 in new directory and move to next batch process Img4 = Img3 - YES do nothing and move to next batch process Etc… Do anyone have a tool like this or can point me in the right direction. Thank you, Jeff |
Hi
I think the main function you want are getFileList(). You can also create folders (look up the functions with the help and note you may need to add file separators) and such if you really need to for your work. What I mean is you might be able to do all the transforms etc you want to do in one go. Or rename the NO ones to XXXXNO.tif. Not sure if it helps but I use the following for a similar problem with .dm3 files where I want to make jpg mini versions for people (I've taken out the size change bit): dir = getDirectory("Choose a Directory"); list = getFileList(dir); setBatchMode(true); showStatus("Running..."); for (i=0; i<list.length; i++) { path = dir+list[i]; if(endsWith(path, ".dm3")){// MAYBE if(list[i]==list[i-1]) TYPE LOOP HERE open(path); // OR OTHER IMPORT PLUGGIN run("Enhance Contrast", "saturated=3"); // Change the 0.35 to a higher number if jpgs too gray eg 2 or 5 // OR OTHER TRANSFORMATIONS dotIndex = lastIndexOf(path, "."); if (dotIndex!=-1){ path = substring(path, 0, dotIndex); // remove extension save(path+".jpg"); // may want a different path here } close(); } } showStatus("Done"); On 1 June 2014 19:31, jarboe3142 <[hidden email]> wrote: > I am requesting help on an image analysis macro. I am not a programmer and > could use any help you can afford. > I would like to batch process hundreds of images in a single directory > where > the tool would analyze two images in a file name series and if something is > different, make a copy in another directory. Ideally I would have a > threshold adjustment tool that I could adjust. > > Example: > Img2 = Img1 – YES, do nothing and move to next batch process > Img3 = Img2 – NO, Make copy of Img3 in new directory and move to next batch > process > Img4 = Img3 - YES do nothing and move to next batch process > Etc… > Do anyone have a tool like this or can point me in the right direction. > > Thank you, > Jeff > > > > -- > View this message in context: > http://imagej.1557.x6.nabble.com/Batch-processing-Macro-Help-tp5007975.html > Sent from the ImageJ mailing list archive at Nabble.com. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by jarboe3142
Hello Jeff,
maybe you could provide some images to see what you describe (Dropbox or any other free/public URL maybe). Is it the change (a given threshold) or is it that there are some images which contain something worth further investigation and other not? If last is the case, your selection method would give you lots of unwanted images in that folder of copies as well. Regards, Rainer Am 01.06.2014 20:31, schrieb jarboe3142: > I am requesting help on an image analysis macro. I am not a programmer and > could use any help you can afford. > I would like to batch process hundreds of images in a single directory where > the tool would analyze two images in a file name series and if something is > different, make a copy in another directory. Ideally I would have a > threshold adjustment tool that I could adjust. > > Example: > Img2 = Img1 – YES, do nothing and move to next batch process > Img3 = Img2 – NO, Make copy of Img3 in new directory and move to next batch > process > Img4 = Img3 - YES do nothing and move to next batch process > Etc… > Do anyone have a tool like this or can point me in the right direction. > > Thank you, > Jeff > > > > -- > View this message in context: http://imagej.1557.x6.nabble.com/Batch-processing-Macro-Help-tp5007975.html > Sent from the ImageJ mailing list archive at Nabble.com. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |