Setting ROI through core object

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

Setting ROI through core object

cfoy3
Hello,
        I would like to set the ROI(region of interest) of my camera through the micromanager core object and use that ROI for every subsequent image that is acquired so that I can reduce my readout time. Looking at the properties of the micromanager core object there doesn't seem to be a way to predefine the desired width and height of acquired images.  

         Also I have looked for documentation for handling the core object and while the forums online discuss how to handle problems using the software there doesn't seem to be as extensive literature on dealing with the core object. If you could point me in the direction of more extensive literature on dealing with the core object I would be very grateful. Any information would be appreciated. 

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
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: Setting ROI through core object

Chris Weisiger
Hi Christopher,

On Tue, Mar 24, 2015 at 8:16 AM, Christopher Foy <[hidden email]> wrote:
Hello,
        I would like to set the ROI(region of interest) of my camera through the micromanager core object and use that ROI for every subsequent image that is acquired so that I can reduce my readout time. Looking at the properties of the micromanager core object there doesn't seem to be a way to predefine the desired width and height of acquired images.  

You want the setROI() method, which takes an x and y offset, and a width and height. E.g. if you had a 512x512 camera and you wanted to only take the center 256x256 pixels, you would do:

mmc.setROI(128, 128, 256, 256);
 

         Also I have looked for documentation for handling the core object and while the forums online discuss how to handle problems using the software there doesn't seem to be as extensive literature on dealing with the core object. If you could point me in the direction of more extensive literature on dealing with the core object I would be very grateful. Any information would be appreciated. 

It's not as easy to find as it should be, but documentation on the C++ Core object can be found here:

https://valelab.ucsf.edu/~MM/doc/MMCore/html/class_c_m_m_core.html

If you're accessing the Core through the Java layer (e.g. as a Micro-Manager plugin, or from Matlab) then the calling conventions for some methods are different; use this documentation instead:

https://valelab.ucsf.edu/~MM/doc/mmcorej/mmcorej/CMMCore.html

I hope this helps.

-Chris

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
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: Setting ROI through core object

cfoy3
Hello, sorry to bother you again. But I have two questions. The first is how do I go about setting my camera through my core object in matlab to start taking images when exposed to external edge triggers?

I currently have a photometric camera and am using the command (in matlab):

                             startExposureSequence(core.getCameraDevice())

Where core.getCameraDevice is my Camera label. I have also tried:

                        startSequenceAcquisition(core.getCameraDevice(),averages*2,expTime,0)

where core.getCameraDevice is again the camera label, averages*2 is the number of images, expTime is the exposure time and 0 is a boolean that ( I believe) tells the camera to not overflow. 

I get the following error:

Undefined function 'startSequenceAcquisition' for input arguments of type 'java.lang.String'. and Undefined function 'startExposureSequence' for input arguments of type 'java.lang.String'.

My second question is: Is this the correct way to post to the forum? I think me emailing is not the correct way. Is this right?





On Tue, Mar 24, 2015 at 11:40 AM, Chris Weisiger <[hidden email]> wrote:
Hi Christopher,

On Tue, Mar 24, 2015 at 8:16 AM, Christopher Foy <[hidden email]> wrote:
Hello,
        I would like to set the ROI(region of interest) of my camera through the micromanager core object and use that ROI for every subsequent image that is acquired so that I can reduce my readout time. Looking at the properties of the micromanager core object there doesn't seem to be a way to predefine the desired width and height of acquired images.  

You want the setROI() method, which takes an x and y offset, and a width and height. E.g. if you had a 512x512 camera and you wanted to only take the center 256x256 pixels, you would do:

mmc.setROI(128, 128, 256, 256);
 

         Also I have looked for documentation for handling the core object and while the forums online discuss how to handle problems using the software there doesn't seem to be as extensive literature on dealing with the core object. If you could point me in the direction of more extensive literature on dealing with the core object I would be very grateful. Any information would be appreciated. 

It's not as easy to find as it should be, but documentation on the C++ Core object can be found here:

https://valelab.ucsf.edu/~MM/doc/MMCore/html/class_c_m_m_core.html

If you're accessing the Core through the Java layer (e.g. as a Micro-Manager plugin, or from Matlab) then the calling conventions for some methods are different; use this documentation instead:

https://valelab.ucsf.edu/~MM/doc/mmcorej/mmcorej/CMMCore.html

I hope this helps.

-Chris

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
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: Setting ROI through core object

Chris Weisiger
Hi Christopher,

On Wed, Mar 25, 2015 at 12:55 PM, Christopher Foy <[hidden email]> wrote:
Hello, sorry to bother you again. But I have two questions. The first is how do I go about setting my camera through my core object in matlab to start taking images when exposed to external edge triggers?

I currently have a photometric camera and am using the command (in matlab):

                             startExposureSequence(core.getCameraDevice())

Where core.getCameraDevice is my Camera label. I have also tried:

                        startSequenceAcquisition(core.getCameraDevice(),averages*2,expTime,0)

where core.getCameraDevice is again the camera label, averages*2 is the number of images, expTime is the exposure time and 0 is a boolean that ( I believe) tells the camera to not overflow. 

I get the following error:

Undefined function 'startSequenceAcquisition' for input arguments of type 'java.lang.String'. and Undefined function 'startExposureSequence' for input arguments of type 'java.lang.String'.

You should be using "core.startExposureSequence" or "core.startSequenceAcquisition". These methods are part of the core object, so you must preface calls to them with the core object. Otherwise, Matlab is trying to find a general function (in the "global namespace", the same place you'd find methods like prod, abs, sum, etc.) named startExposureSequence, and it can't find it.
 

My second question is: Is this the correct way to post to the forum? I think me emailing is not the correct way. Is this right?

Email is exactly the correct way. Properly speaking, this is a mailing list, not a forum; Nabble archives the list for us. But whatever way works for you is fine. :)

-Chris


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
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: Setting ROI through core object

vanpaul
Hi,Chris Weisiger

  I have the similar question. I want to  control my camera for 3 pictures
per external-triggering.
 
  If I use 'mmc.startSequenceAcquisition(3,500,true)' , how can I  response
the external trigger. If I use 'mmc.startExposureSequence', how can I
control the interval time for 500ms?

Thanks!




--
Sent from: http://micro-manager.3463995.n2.nabble.com/

------------------------------------------------------------------------------
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: Setting ROI through core object

JonD
Administrator
vanpaul wrote
>   I have the similar question. I want to  control my camera for 3 pictures
> per external-triggering.
>  
>   If I use 'mmc.startSequenceAcquisition(3,500,true)' , how can I
> response
> the external trigger. If I use 'mmc.startExposureSequence', how can I
> control the interval time for 500ms?

I would expect your trigger signal to control the interval between images.

There is (unfortunately) no API call to set the camera trigger mode to
external.  Find the appropriate property and make sure to set it.  Make sure
you set the exposure time appropriately.  Then call
mmc.startSequenceAcquisition() with the first parameter set to be the number
of images you are after.  Then send your trigger pulses.

PS: Per documentation of Core's startSequenceAcquisition() at
https://valelab4.ucsf.edu/~MM/doc/MMCore/html/class_c_m_m_core.html#a2eea979db6e3244d017524bb57471d11
it appears that the specified interval may not do anything.  I'm not sure if
other cameras now support the interval.  I can see from the Core code that
the interval value is simply passed to the camera device adapter which has
an API method with the same name and parameters, by inspecting the code of
the camera device adapter you could see how the parameter is used.

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



--
Sent from: http://micro-manager.3463995.n2.nabble.com/

------------------------------------------------------------------------------
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