This post was updated on .
Hi all!
I have spent ages Googling to no avail, I appreciate any input! Summary: Is there a way to Macro read text fields present on a plugin GUI? Longer version: I am using the plugin OpenMIMS (not mine!), a microscope image editor for ImageJ. It's specifically designed to work with the files output from the microscope. The plugin (please do try it out) reads in header information about the sample and settings, and displays them on a seperate image. The Macro Recorder seems to have no access to this window, nor any of the functions on it, and I've been trying my hardest to access the information on it by macro. What I really need is to read off the raster size of the image (50 um), which varies from image to image. Does anyone have any advice? I've tried looking through the java source, but it's a bit too much for me, and I seem to have trouble recompiling it. (and I'd rather not take that route anyway) Cheers, Tom |
Very good question.
I have a similar problem: is there a way to store any user input come from a dialog box of a plugin, and in a dialog box with the preview checkbox? I've already post this similar question here (http://imagej.1557.x6.nabble.com/set-default-parameters-in-dialog-Plugin-and-get-used-parameters-td5008470.html#a5008484) but I didn't solve my problem. Or the only way is to switch to another software like matlab and then come back to imagej/fiji, maybe with Miji? Thank you, Emanuele
Image Analyst @Ifom-IEO research campus -MI-
|
Dear Emanuelle,
You can do what you are asking for by using the Ext (Macro Extension) Functions: http://rsb.info.nih.gov/ij/developer/macro/functions.html#E I had first implemented this feature in the Radial Profile Extended plugin: http://rsb.info.nih.gov/ij/plugins/radial-profile-ext.html after somebody from the list asked for some special use of the data coming out of the plugin. And now I implement such Ext. features on almost all plugins I develop and/or use. Nevertheless you need to have access to the source code of the plugin you want to have these features in the case the macro extension feature is not already included. I hope I answered your question and wish you a nice day. My best regards, Philippe Philippe CARL Laboratoire de Biophotonique et Pharmacologie UMR 7213 CNRS - Université de Strasbourg Faculté de Pharmacie 74 route du Rhin 67401 ILLKIRCH Tel : +33(0)3 68 85 41 84 -----Message d'origine----- De : ImageJ Interest Group [mailto:[hidden email]] De la part de Emanuele Martini Envoyé : mercredi 30 juillet 2014 09:32 À : [hidden email] Objet : Re: Macro use within Plugin GUI Very good question. I have a similar problem: is there a way to store any user input come from a dialog box of a plugin, and in a dialog box with the preview checkbox? I've already post this similar question here (http://imagej.1557.x6.nabble.com/set-default-parameters-in-dialog-Plugin-an d-get-used-parameters-td5008470.html#a5008484) but I didn't solve my problem. Or the only way is to switch to another software like matlab and then come back to imagej/fiji, maybe with Miji? Thank you, Emanuele -- View this message in context: http://imagej.1557.x6.nabble.com/Macro-use-within-Plugin-GUI-tp5008933p50089 49.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 Tom A
Hello,
i looked into the API of the reader. The reader has several methods to extract the (hopefully) required data. For the access i wrote a small example class which can be accessed with an example macro: Compile this class and put it in the plugins directory (i used Eclipse and added the plugins libs and ImageJ jar to the classpath for compilation): ********************************************* import java.io.File; import java.io.IOException; import com.nrims.data.Mims_Reader; public class Read_Mims_Meta { private static Mims_Reader mim; private static String path; public static String getData(){ File fi = new File(path); try { mim = new Mims_Reader(fi); } catch (IOException e) { //log the exception } return (mim.getName()+" "+ mim.getRaster()); } public static void setPath(String pathMimsFile){ path = pathMimsFile; } } *********************************************** Macro which calls the class (with image example from the website): ************************************************************** run("Read Mims Meta") call("Read_Mims_Meta.setPath","C:/Users/Data/SampleData1.im"); result=call("Read_Mims_Meta.getData"); print(result); You can extract several informations from the class. Have a look at the API for the class Mims_Reader. The macro can easily extended to automize the file read if you hava a bunch of images (thats why i added a macro as an example). Maybee it is possible to access the class with the "call" method without an extra plugin. But this worked for me. I hope this info helps. |
Free forum by Nabble | Edit this page |