Failure to load MM datasets in MATLAB with DefaultDataManager

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Failure to load MM datasets in MATLAB with DefaultDataManager

Kyle Douglass

​Hi everyone,

I would like to load a stack of images that I acquired in MM 2.0 into a Datastore using MATLAB. To do this, I first create an instance of a DefaultDataManager object using MATLAB's javaObject command and then call its loadData() method. Unfortunately, for some image stacks it returns a Java Null Pointer exception:

>> dm = javaObject('');
>> dm.loadData('z_stack_test_3', false);
Java exception occurred:

However, the equivalent steps in Beanshell work without raising any exceptions:

bsh % file = "L:\\Z-Stacks\\z_stack_test_3";
bsh % ds =, false);

Would anyone happen to know what the problem is? My guess is that the MATLAB approach is failing on image stacks that are somehow missing their SummaryMetadata, but that doesn't explain why it works in Beanshell.

I see this behavior in stacks generated from the 64-bit Windows MM 2.0 nightly builds from both January 30, 2017 and April 25, 2017. The problematic stacks are generated with a custom script whose main parts are:

while (curr_slice < number_slices) {
    tmp = mmc.getTaggedImage();

    // Convert to Image and update z-coordinate
    image =;
    coords = image.getCoords().copy().z(curr_slice).build();
    image = image.copyAtCoords(coords);


     // Move to the next z-position

     // Update slice and sleep until next iteration

store.freeze();, savePath);


Dr. Kyle M. Douglass
Post-doctoral Researcher
EPFL - The Laboratory of Experimental Biophysics

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
micro-manager-general mailing list
[hidden email]