Quantcast

How to access MM's snap/live window

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to access MM's snap/live window

tontondave617
Hi,

In progress of my plugin, I was able to import an image file to ImageJ. I want to implement the same thing but in Micro-manager window. Can someone help me how I can open the file in the micro-manager snap/live window and access metadata instead of imageJ? or create an image window where I can transfer my file? I've looked in MM's site in accessing an image and metadata but it looks like the coding is for MM's beanshell script instead of Java.

Note: Im using Eclipse kepler  in creating my plugin.

Below Ive attached an image of the file ive imported, and displayed using imageJ.



Thank you,
Anton.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to access MM's snap/live window

JonD
tontondave617 wrote
In progress of my plugin, I was able to import an image file to ImageJ. I want to implement the same thing but in Micro-manager window. Can someone help me how I can open the file in the micro-manager snap/live window and access metadata instead of imageJ? or create an image window where I can transfer my file? I've looked in MM's site in accessing an image and metadata but it looks like the coding is for MM's beanshell script instead of Java.
Here is a code snippet that the ASIdiSPIM plugin uses to access the top-most open window and its metadata.  Note that generally this is not the snap/live window but a previously-acquired dataset that has been opened in MM.

final String windowTitle;
final ImagePlus ip = IJ.getImage();
final MMWindow mmW = new MMWindow(ip);
if (mmW.isMMWindow()) {  // have Micro-Manager dataset
  final JSONObject metadata = mmW.getSummaryMetaData();
  if (metadata.has("AcquisitionName")) {
    windowTitle = metadata.getString("AcqusitionName");
  } else {
    windowTitle = ip.getTitle();
  }
}

Most image processing operations are invoked using methods of the ImagePlus object, using methods of the ImageProcessor object (variable 'ip' in the example) available via the ImagePlus object ('ip.getProcessor()'), or else using the IJ.run("") command to run ImageJ commands.  You can see such examples in the DataAnalysisPanel.java from the ASIdiSPIM plugin; this snippet was also copied from there.

You can programmatically open datasets via calls to methods like openAcquisitionData() in the ScriptInterface-type object that your plugin gets when it's invoked (equivalently the gui object in Beanshell scripts).

Jon

-------------------------------------------
Jon Daniels
Applied Scientific Instrumentation
29391 West Enid Rd, Eugene, OR 97402
Phone: (541) 461-8181 x118
-------------------------------------------
Loading...