UserData not updating when acquiring images through matlab

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

UserData not updating when acquiring images through matlab

xandr
Hello all, was just hoping for a bit of help troubleshooting.

I'm using MM2.0 through Matlab R2018b to run a Olympus IX81 scope w/ a
Hammamatsu camera. Right now I'm having an issue when I try to snap images
after loading the gui through Matlab. Once I load the gui and my
configuration file, choosing default user, I can snap one image either
programmatically or through the gui but upon snapping the next image I get
the following micro-manager error:
*
Error: Failed to determine changing metadata. JSONObject["userData"] not a
string.*

Looking at the metadata window in µM there is indeed none of the usual
metadata that appears when snapping an image when I load µM through ImageJ.
This error also happens when I try live acquisition.

I think I may not be importing all of the correct classes into Matlab and so
the metadata builder (not sure if this is the correct thing I'm looking for)
may be absent causing me to not properly create the metadata for each image.

I've posted my code below. One additional question, is the best way to load
a configuration file through the core or is there a better way w/ 2.0?

cd 'C:\Program Files\Micro-Manager-2.0beta\'
import mmcorej.*;
import java.util.List;
import org.micromanager.internal.MMStudio;
import org.micromanager.SnapLiveManager;
import org.micromanager.Studio;
gui = MMStudio(false);
mmc = gui.getCore;
acq = gui.getAcquisitionEngine;

mmc.loadSystemConfiguration('C:\Program
Files\Micro-Manager-2.0beta\Olympus.cfg');
mmc.setXYStageDevice('XYStage');
mmc.setOriginXY();
mmc.setProperty('XYStage','Acceleration',100);
mmc.setSerialPortCommand("COM3",char([83 77 83 44 uint16(int2str(100*5000))
44 105 13]),'');

image = gui.live().snap(true).get(0)





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


_______________________________________________
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: UserData not updating when acquiring images through matlab

Stuurman, Nico
On 7/11/19 10:19 AM, xandr wrote:

> Hello all, was just hoping for a bit of help troubleshooting.
>
> I'm using MM2.0 through Matlab R2018b to run a Olympus IX81 scope w/ a
> Hammamatsu camera. Right now I'm having an issue when I try to snap images
> after loading the gui through Matlab. Once I load the gui and my
> configuration file, choosing default user, I can snap one image either
> programmatically or through the gui but upon snapping the next image I get
> the following micro-manager error:
> *
> Error: Failed to determine changing metadata. JSONObject["userData"] not a
> string.*
>
> Looking at the metadata window in µM there is indeed none of the usual
> metadata that appears when snapping an image when I load µM through ImageJ.
> This error also happens when I try live acquisition.

Micro-Manager (MMJ_.jar) carries its own copy of JSON (org.json), rather
than using one of the "official"
(https://mvnrepository.com/artifact/org.json/json) versions.  This
happened because Micro-Manager predates the packaged org.json versions.

My interpretation is that Matlab started including org.json at one point
in time, and that this versions clashes with the Micro-Manager org.json.

I am planning on taking out org.json from the source code (2.0-gamma
only), and including a org.json jar instead.

It would be quite helpful if someone can figure out which org.json
versions Matlab uses (preferable the various Matlab versions).


Best,


Nico



_______________________________________________
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: UserData not updating when acquiring images through matlab

xandr
Nico,

Thank you for the help. I've switched to gamma from beta and found a
workaround for now. I did a bit of searching and couldn't find a specific
reference to org.JSON in my matlab directory nor did a quick google search
show anything but I'll keep looking.

Another possible point of interference, if I'm interpreting this correctly,
w/ at least Matlab 2018 and gamma is SLF4J. Running the save protocol in my
code produces the following error:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in
[jar:file:/C:/Program%20Files/MATLAB/R2018b/java/jarext/slf4j/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in
[jar:file:/C:/Program%20Files/Micro-Manager-2.0gamma/plugins/Micro-Manager/logback-classic-1.1.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
explanation.
log4j:WARN No appenders could be found for logger
(loci.common.services.ServiceFactory).
log4j:WARN Please initialize the log4j system properly.

Best,
Alex



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


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general