I’ve tried recording a macro to run the Register Virtual Stack Slices plugin http://imagej.net/Register_Virtual_Stack_Slices but still have trouble setting all the inputs in a non-interactive fashion. Since I need to save the estimated transformations using the “Save transformations” option, the plugin always pops up a dialog asking which folder to use for saving the transformations. Also, a dialog asking for the reference image comes up when I run the recorded macro. It seems that interaction with these two dialogs does not get recorded into the macro in any way and so far I have found no way of specifying the transformations folder and the reference image without interacting with the GUI. The input image folder, the output folder for the aligned images and the settings used for the algorithm seem to get recorded into the macro correctly and I don’t have to interact with the corresponding menus when calling the macro. Is it even possible to run the plugin completely without user interaction via a macro?
I might add that my actual goal is to be able to call the plugin from within MATLAB using the ImageJ-Matlab interface http://imagej.net/MATLAB_Scripting. The reason for this is that I’d like to perform some analysis steps in MATLAB, run the plugin with certain parameters, run some other steps in MATLAB and then call the plugin again with different parameters (all without any interaction). The MATLAB interface itself seems to be working fine and I’m able to call the recorded macro from within MATLAB using the command:
MIJ.run('Register Virtual Stack Slices', macroParameters);
where macroParameters is a string containing the parameters which got correctly recorded into the macro, such as the one specifying the input folder as
Based on the scripting example at the end of the page in http://imagej.net/Register_Virtual_Stack_Slices, it is possible to set the transforms folder and reference image without using the GUI via a jython script but I would prefer to use the MATLAB interface. If I’ve understood correctly, the MATLAB interface is only able to call the plugin via a macro and calling the Java methods directly like in the Jython example is not possible. Please correct me if I’m wrong.