MIJI: launch Macro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

MIJI: launch Macro

Emanuele Martini
Hi to all,
How can I launch a macro using Miji?
I have a macro that works in FIJI that get some parameters as a string;
like that:
runMacro("WH_imagej_AUTO_ema_MEDIAN_macro","image_path="+image_path+" saving_path="+saving_path+" R_median="+R_median+" R_variance="+R_variance)

in ijm language I have to use runMacro, but I don't find an analogue in MIJI.
I try with that:
MIJ.run(macro_path,strcat('image_path=',image_path,' saving_path=',saving_path,' R_median=',R_median,' R_variance=',R_variance));

with:
image_path='/Users/emartini/Documents/emanueleM/WH_exp/Cecilia_Savorani/old/6nov2014/YAP WT CTR/WT CTR s2.tif'
saving_path='/Users/emartini/Documents/emanueleM/WH_exp/Cecilia_Savorani/old/6nov2014/PROCESSED'
R_median='NO'
R_variance='3'
macro_path='/Applications/Fiji.app/plugins/Scripts/WH_imageJ_AUTO_ema_MEDIAN_macro.txt';

But the FIJI instance says to me: "unrecognized command"...

Is there a way to do that?
Have a nice day,
Emanuele Martini
Image Analyst @Ifom-IEO research campus -MI-
Reply | Threaded
Open this post in threaded view
|

Re: MIJI: launch Macro

Emanuele Martini
I found a solution:
after having setting-up Miji,
you can construct an IJ instance in matlab
IJ=ij.IJ();

macro_path=...
'/Users/emartini/Documents/emanueleM/WH_exp/GUI_test/WH_Miji_macro_RoiExtraction.txt';

args=...
strcat('image_path=',image_path,' saving_path=',saving_path,' R_median=',R_median,' R_variance=',R_variance);
you don't have to use the ijm syntax "+variable+"

IJ.runMacroFile(java.lang.String(macro_path),java.lang.String(args));
remember to use java string.
And it works ;)

Have a nice week,
Emauele Martini
Image Analyst @Ifom-IEO research campus -MI-