OPS>SOFTWARE>DOWNLOADS>OTHER MICRO-MANAGER PLUGINS>MACRO PROCESSING

Fork Macro Processing compatible with Micro-Manager 1.4.15 on GitHub

Macro Processing Plugin for Micro-Manager/ImageJ

Macro Processing allows ImageJ's macro language to be applied to Micro-Manager's image processing pipeline, an acquired dataset or ImageJ windows. This plugin was developed keeping ease of use in mind for those familiar with ImageJ's macro language and also to those non-programmers who leverage ImageJ's macro recorder. Macro's are not optimized for speed and if it is your processing criteria a pure Java based processing plugin is recommended. How intensive is the computation requirement and time available to perform that task during acquisition needs to be carefully assessed before using this plugin. In the OpenPolScope framework this is utilized under the Re-Processing (Pol-Analyzer) mode where time is not a constraint.

    Features:
  • Use as an ImageJ or Micro-Manager plugin for Macro Editing and Application
  • Syntax highlighting (optional - read below)
  • Undo Manager
  • Line number support for easy debugging
  • Access Micro-Manager's metadata using custom functions (Ext) library (optional - read below)
Plugin (for 1.4.18 nightly): (Coming Soon). Recommended Micro-Manager version 1.4.18 May-14-2014
- Recent Micro-Manager (API) Changes

Macro Processing Result
The Macro Processing Plugin can apply an ImageJ process (filter, plugin, macro etc.) and can also be used to extract Micro-Manager image metadata using the library (MacroProcessingIjStub_.jar).

    Using the Plugin

  1. Install the following two libraries if required:
    1. If Ext functions are required download the library 'MacroProcessingIjStub_.jar' file to ImageJ's plugin folder
    2. If Syntax highlighting is required download the library 'jsyntaxpane-0.9.5-b29.jar' or later (http://code.google.com/p/jsyntaxpane/) to ImageJ's plugin folder
  2. Start from Micro-Manager's plugin menu
  3. After writing the macro in the text editor the macro is required to be tested against an image window even if image operation are not performed.
  4. Click the 'Snap' button on Micro-Manager to show the Snap/Live Window
  5. Click on the 'Test' button, if no errors are found the button will be highlighted green and the time it took for the macro will be displayed along with a suggested Time out.
  6. Time out should be based on time interval between acquisitions and how long is the processing time
  7. Any changes applied to the text of a tested macro also needs to be tested and validated.
  8. When the macro content is changed and is untested the 'Test' button is highlighted Orange.
  9. A macro containing errors (highlighted as Red) cannot be enabled or applied.
  10. Currently the scope of processing for this plugin is limited to the image being acquired only. For creating computed images and processing between channels please refer to the OpenPolScope plugin which also utilizes similar techniques described here.

When used as a Micro-Manager plugin, all functions are available.
Macro Processing Interface


When used as an ImageJ plugin, only ImageJ related functioning is available.
Macro Processing Interface (ImageJ only mode)


The ImageJ macro that produces the above Results table.

// PostProcessor Macro for Pol-Acquistion / Pol-Analyzer // requires("1.48h"); MetadataKeyTime = "ElapsedTime-ms"; // Time key (key tag from Micro-Manager metadata panel) MetadataKeyChName = "Channel"; // Channel key chNum = 0; // 0 based Ext.getChMetadata(chNum, MetadataKeyTime, time); // (from channel 'chNum', get 'ElapsedTime-ms' value) Ext.getChMetadata(chNum, MetadataKeyChName, chName); // (from channel 'chNum', get 'Channel' value) title = getTitle(); // (gets title of the dataset from ImageJ window, alternate method is from metadata) len1=lengthOf(title); len2=lengthOf("_Processing"); if (len1 > len2) { title = substring(title, 0, len1-len2); // (the ImageJMacro method adds '_Processing' when applying the macro and we replace it here) } else if (title=="") { title = "Macro_Processing"; } roiStr = "Not used"; s = selectionType(); if( s == -1 ) { // no selection } else if( s == 10 ) { // point selection } else { getSelectionBounds(x, y, w, h); roiStr = "x="+x+",y="+y+",width="+w+",height="+h; //(gets the ROI selection) } //(custom method using Extensions (Ext)) Ext.getChMetadata(0, "Frame", frame); // (from channel 0, get Frame Index) Ext.getChMetadata(0, "Slice", slice); // (from channel 0, get Slice Index) Ext.getChMetadata(0, "PositionIndex", pos); // (from channel 0, get Position Index) dim = "T="+frame+", S="+slice+" ,P="+pos; //(ImageJ Results table creation - common for all channels) row = nResults(); setResult("Dataset", row, title); setResult("Location", row, dim); setResult("ROI", row, roiStr); getRawStatistics(area, mean, min, max, stdev, histogram); CreateTable(title, chNum, chName, time, mean); function CreateTable(title, ch, chN, time, mean) { row = nResults()-1; setResult("Channel Idx (0 based)", row, ch); setResult("Channel Name", row, chN); setResult("Time (ms)", row, time); setResult("Mean", row, mean); updateResults(); }

 

© OpenPolScope | All Rights Reserved | Contact
Last Page Update on June 05 2014 19:26