Hi, I have a macro that I am trying to run in headless mode. I’m very new to setting this up and on Friday managed to get it to run I now think through some X11 setting I played with in trying to set (java.awt.headless=true). I am thinking this because in getting it to work… I have the graphical screen to navigate to the directories of choice.
Is there a way to write code such that you can provide path information for directories as you run the code?
My Macro takes files from one directory- processes them and defines an ROI… saves this ROI and applies it to an image in second directory with the same base string name , takes some measurements, then saves the data in a third directory.
I can see the “Start directory loop” in terminal so I know the code starts… My macro currently starts like this…
// Macro code for batch processing a folder // of .tif files, includes saving .tifs back into the // ORIGINAL folder with a modified version // of the original image name print("start directory loop"); dir = getDirectory("Choose input segment Directory "); // prompts the user to select the folder to be processed, // stores the folder as the destination for saving list = getFileList(dir); // gives ImageJ a list of all files in the folder to work through print("number of files in dir1 Segments",list.length); // optional prints the number of files in the folder dir2 = getDirectory("Choose input Image Directory "); // promts user to select folder to be saved in list2 = getFileList(dir2); // gives ImageJ a list of all files in the folder to work through for directory2 extension2 = ".tif"; //defines file type variable print("number of files in dir2 Image",list2.length); // optional prints the number of files in the folder dir3= getDirectory("Choose output Directory"); //promts user to select folder on Images for Results setBatchMode(true); // runs up to 6 times faster, without showing images onscreen. Turn off during troubleshooting steps??
Thanks for any help!