marking pixels on live view window

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

marking pixels on live view window

Scott Luro
Hello,

I am using patterned light to irradiate certain cells within a field of view. Does anyone know how to draw or designate regions of the micromanager live view window for such applications? This would essentially entail applying a custom, fixed, "mask" (e.g., rectangular box) to the live view of micromanager so that positions could be manually, yet reproducibly, taken based on specimen orientations within the sample.

Thank you for your time and consideration!

Best,
Scott

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: marking pixels on live view window

centswu
Hi scott,

You can try "inspector window" -> "Overlays"

Cents

2017年9月15日 上午8:35,"Scott Luro" <[hidden email]>寫道:
Hello,

I am using patterned light to irradiate certain cells within a field of view. Does anyone know how to draw or designate regions of the micromanager live view window for such applications? This would essentially entail applying a custom, fixed, "mask" (e.g., rectangular box) to the live view of micromanager so that positions could be manually, yet reproducibly, taken based on specimen orientations within the sample.

Thank you for your time and consideration!

Best,
Scott

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: marking pixels on live view window

Justin Hanselman-2
In reply to this post by Scott Luro
Hey Scott,

   I'm unclear if you're writing a plugin or just looking for standard tools in ImageJ/Micro-manager.  If you're designing a plugin, I recently had a similar issue where I needed to have a user select fiducial markers in a fluorescence sample.  

   If anyone is wondering how to do this as a micro-manager plugin.  If you explicitly want to use the Live Window Only, the ScriptInterface object has a getSnapLiveWindow() method and an enableLiveMode() method that will toggle the live windows and return the Window Instance.  From there, since the snapLiveWindow is technically an acquisition, any call to getImagePlus() will return the current frame stored in the snapWindow.  The ImageWindow itself can take an Overlay object.

      Semantic Code for setting a Overlay:

         Overlay updatedOv;
          if( newOverlay ) {
               updatedOv = new Overlay();  //just make a new Overlay
          } else {
               updatedOv = ImageWindowObj.getImagePlus().getOverlay();  //Retrieve the old Overlay
          {
           //Get a List of the Rois either from the RoiManager or your own listeners
           updatedOv.add( particularRoi );

           ImageWindowObj.getImagePlus.setOverlay( newOv );  //Overwrites Previous Overlay
           ImageWindowObj.getImagePlus().setHideOverlay(true); /ensure the window is rewritten to display


   Additionally, if you attach listeners to the Window for screen position and mouse clicks, with a little filtering of Roi types, you can ensure that an Roi is rectangular by producing one based off of the start and finish clicks.  I chose this method over the RoiManager because the Roi manager can handle multiple window Rois at once and I wrote a standalone prompt for the user.

    Of course, for the Rois to be meaningful, they should be stored and used by your plugin in a meaningful way to analyze the data later.  To apply an Roi to constrain the ImagePlus is tricky because the ImageJ 1.x source has a lot of pitfalls due to poor encapsulation.  
    
      A good rule of thumb for applying an Roi to the ImagePlus you're concerned with is: 

                    //Applies the Roi to the ImagePlus, False means the Window doesn't change its size to match 
                    ImagePlusObj.setRoi(  particularRoi, false ); 
                   //Get the ImageProcessor with the new Roi, which holds the Pixels
                   ImageProcessor ip = ImagePlusObj.getProcessor();
                   //Do analysis on ip.getPixels() more than likely

   If you're not looking for a plugin of this specific nature, I'm sure CentsWu's answer may help.  But to anyone curious about writing overlays to the SnapLiveWindow, this was the solution I found that worked.  Additionally, there is another solution involving ImageCache Listeners for more Asynchronous Analysis, but I have not proven it with the LiveWindow, only with Acquisitions and certain assumptions about their properties.

Justin

On Thu, Sep 14, 2017 at 7:33 PM, Scott Luro <[hidden email]> wrote:
Hello,

I am using patterned light to irradiate certain cells within a field of view. Does anyone know how to draw or designate regions of the micromanager live view window for such applications? This would essentially entail applying a custom, fixed, "mask" (e.g., rectangular box) to the live view of micromanager so that positions could be manually, yet reproducibly, taken based on specimen orientations within the sample.

Thank you for your time and consideration!

Best,
Scott

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: marking pixels on live view window

Nico Stuurman-2
In reply to this post by Scott Luro
Hi Scott,

> I am using patterned light to irradiate certain cells within a field
> of view. Does anyone know how to draw or designate regions of the
> micromanager live view window for such applications? This would
> essentially entail applying a custom, fixed, "mask" (e.g., rectangular
> box) to the live view of micromanager so that positions could be
> manually, yet reproducibly, taken based on specimen orientations
> within the sample.

I am also a bit unclear on what exactly you try to do.  However, the
Projector plugin is used to control both DMDs and galvo systems.  It
maps those projection devices to the camera and allows one to draw ROIs
using the ImagJ tools that then result in the corresponding pattern to
be projected in the image plane.  Is that what you try to do?  If so,
how do you create your patterned light?

Best,

Nico


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general