Re: [micro-manager-general] Access live image from Matlab
Status: Beta
Brought to you by:
nicost
|
From: Vanessa K. <van...@gm...> - 2018-06-18 18:52:50
|
Thanks for the help Kyle, I'm not sure how I didn't realize that that was
Java! I ended using a solution based on your alternative suggestion.
However, I am now running into issues while trying to use the save the
datastore. Following the example from the version 2.0 How Do I... page, I
am using store.save(Datastore.SaveMode.MULTIPAGE_TIFF, savePath);
But this throws the error:
Undefined function or variable 'SaveMode'.
Error in Focus>pushbutton4_Callback (line 302)
store.save(Datastore.SaveMode.MULTIPAGE_TIFF, savePath);
I'm assuming this isn't an error involved with importing the Datastore
class since I can create and store things inside a Datastore-type variable.
It also seems to me that this wouldn't be an issue caused by syntax errors,
but please correct me if I'm wrong here. Any advice would be much
appreciated.
Thanks,
Vanessa
On Fri, Jun 15, 2018 at 2:45 AM, Kyle Douglass <kyl...@gm...>
wrote:
> Hi Vanessa,
>
> On Wed, Jun 6, 2018 at 10:31 PM, Vanessa King <van...@ma...
> > wrote:
>
>>
>>
>>
>> %Get the datastore of current open window
>>
>> Datastore store = mm.displays().getCurrentWindow().getDatastore();
>>
>>
>>
> I'm surprised that this line even runs at all in MATLAB because it's
> actually Java :) You may need to create a new instance of your Datastore
> using MATLAB's javaObject() method. For example, here is a snippet from our
> lab's own MATLAB code of how I create a Datastore from a DataManager in
> Micro-Manager 2.0beta:
>
> DataManager = javaObject('org.micromanager.data.internal.DefaultDataManage
> r');
> Datastore = DataManager.loadData(dataDirectory, OPEN_AS_VIRTUAL);
>
> Alternatively, if this doesn't work, try the following (I have not tested
> it). Note that StartMMStudio.m is located inside the Micro-Manager
> installation directory and should be your primary interface between MATLAB
> and Micro-Manager:
>
> gui = StartMMStudio('C:\Program Files\Micro-Manager-2.0beta\');
> mmc = gui.getCore;
> acq = gui.getAcquisitionEngine;
>
> datastore = gui.displays().getCurrentWindow().getDatastore();
>
> Cheers,
> Kyle
>
> ------------------------------------------------------------
> ------------------
> 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
> mic...@li...
> https://lists.sourceforge.net/lists/listinfo/micro-manager-general
>
>
|