We're Hiring!

Uploading from MATLAB

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Re: Uploading from MATLAB

Postby jmoore » Fri Oct 26, 2012 8:16 pm

Would you mind enabling debugging and repeat the failure? Something like:
Code: Select all
loci.common.DebugTools.enableLogging('DEBUG');


Cheers,
~J.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Uploading from MATLAB

Postby dballvt » Fri Oct 26, 2012 8:44 pm

I get the exact same messages when I add that line (see below). Would there be any information inside any of the variables that are created during this code:
Code: Select all
handler = ErrorHandler(config);
library.addObserver(LoggingImportMonitor());
candidates = ImportCandidates(reader, paths, handler);


[INFO] ImportConfig - OMERO Version: 4.4.4-ice33-b3099
[INFO] ImportConfig - Bioformats version: 4.4.4 revision: 96c615b date: 25 September 2012
[INFO] OMEROMetadataStoreClient - Attempting initial SSL connection to gladden.vbi.vt.edu:4064
[INFO] OMEROMetadataStoreClient - Call context: {omero.group:3}
[INFO] OMEROMetadataStoreClient - Server: 4.4.4
[INFO] OMEROMetadataStoreClient - Client: 4.4.4-ice33-b3099
[INFO] OMEROMetadataStoreClient - Java Version: 1.6.0_35
[INFO] OMEROMetadataStoreClient - OS Name: Mac OS X
[INFO] OMEROMetadataStoreClient - OS Arch: x86_64
[INFO] OMEROMetadataStoreClient - OS Version: 10.8.2
[INFO] ImportCandidates - Depth: 4 Metadata Level: MINIMUM
[INFO] ImportCandidates - 1 file(s) parsed into 1 group(s) with 1 call(s) to setId in 37ms. (38ms total) [0 unknowns]
[INFO] OMEROMetadataStoreClient - Call context: {omero.group:3}
[INFO] OMEROMetadataStoreClient - Call context: {omero.group:3}
[INFO] ImportLibrary - Exiting on error
dballvt
 
Posts: 24
Joined: Wed Jul 14, 2010 1:45 pm

Re: Uploading from MATLAB

Postby jmoore » Mon Oct 29, 2012 7:39 pm

Just a heads up: we're looking into what magic it will take to make Matlab print debugging statements for other Java classes. Bear with us.

~J.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Uploading from MATLAB

Postby sbesson » Mon Nov 05, 2012 10:59 am

Hi.

Sorry for the delay. Can you try the followig piece of code to set the level of the import library logger:
Code: Select all
log = org.apache.commons.logging.LogFactory.getLog('ome.formats.importer.ImportLibrary');
log.setLevel(0)
success = library.importCandidates(config, candidates);

and let us know if you get a more informative error message?

Cheers,
Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: Uploading from MATLAB

Postby dballvt » Mon Nov 05, 2012 1:48 pm

OK, now I do get a couple of extra lines (below). I notice the maximum height & width, but the image I'm trying to upload is just a single plane that is 1392 x 1040, and it's a tiff file.

[INFO] ImportConfig - OMERO Version: 4.4.4-ice33-b3099
[INFO] ImportConfig - Bioformats version: 4.4.4 revision: 96c615b date: 25 September 2012
[INFO] OMEROMetadataStoreClient - Attempting initial SSL connection to gladden.vbi.vt.edu:4064
[INFO] OMEROMetadataStoreClient - Call context: {omero.group:3}
[INFO] OMEROMetadataStoreClient - Server: 4.4.4
[INFO] OMEROMetadataStoreClient - Client: 4.4.4-ice33-b3099
[INFO] OMEROMetadataStoreClient - Java Version: 1.6.0_37
[INFO] OMEROMetadataStoreClient - OS Name: Mac OS X
[INFO] OMEROMetadataStoreClient - OS Arch: x86_64
[INFO] OMEROMetadataStoreClient - OS Version: 10.8.2
[DEBUG] ImportLibrary - FS lite enabled readers: [loci.formats.in.TiffDelegateReader, loci.formats.in.APNGReader, loci.formats.in.SVSReader, loci.formats.in.LeicaSCNReader, loci.formats.in.JPEGReader, loci.formats.in.JPEG2000Reader]
[DEBUG] ImportLibrary - Maximum plane width: 3192
[DEBUG] ImportLibrary - Maximum plane height: 3192
[INFO] ImportCandidates - Depth: 4 Metadata Level: MINIMUM
[INFO] ImportCandidates - 1 file(s) parsed into 1 group(s) with 1 call(s) to setId in 36ms. (36ms total) [0 unknowns]
[INFO] OMEROMetadataStoreClient - Call context: {omero.group:3}
[INFO] OMEROMetadataStoreClient - Call context: {omero.group:3}
[INFO] ImportLibrary - Exiting on error
dballvt
 
Posts: 24
Joined: Wed Jul 14, 2010 1:45 pm

Re: Uploading from MATLAB

Postby jmoore » Tue Nov 06, 2012 10:00 am

Unfortunately, it's still not clear what's going wrong. Likely what's happening is an exception is being eaten. I've added a ticket: https://trac.openmicroscopy.org.uk/ome/ticket/9852. We'll have a fix for this shortly, if you'd like to compile your own client jar. Otherwise, the 4.4.5 release will be out soon.

Could you possibly send us the file and the var/log/Blitz-o.log file from the server?

Sorry for the hassle.
Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Uploading from MATLAB

Postby dballvt » Mon Nov 26, 2012 3:04 pm

I'm not sure what I did differently, but now the image gets imported to the server. However, it doesn't get placed into any dataset. Below is the code I used. I'm trying to add the image to dataset 163, which is part of project 2, which is owned by user 2 (the user that I am logging in), who is part of group 3. The image shows up in the Images tab on the right-hand side of the Insight window, but not under Projects.

Code: Select all
java.lang.System.setProperty('java.util.prefs.PreferencesFactory','java.util.prefs.MacOSXPreferencesFactory');
import loci.formats.in.DefaultMetadataOptions;
import loci.formats.in.MetadataLevel;
import loci.common.*;
import ome.formats.OMEROMetadataStoreClient;
import ome.formats.importer.*
import ome.formats.importer.ImportConfig;
import ome.formats.importer.cli.ErrorHandler;
import ome.formats.importer.cli.LoggingImportMonitor;
import omero.model.Dataset;
loadOmero;


loci.common.DebugTools.enableLogging('debug');

config = ImportConfig();
config.email.set('');
config.email.get;
config.sendFiles.set(true);
config.sendReport.set(false);
config.contOnError.set(false);
config.debug.set(true);
config.hostname.set(host);

port = javaObject('java.lang.Integer',4064);
config.port.set(port);
config.username.set(uname);
config.password.set(pword);
config.targetClass.set('omero.model.Dataset');

dataID = javaObject('java.lang.Long',163);

config.targetId.set(dataID);

groupID = javaObject('java.lang.Long',3);
config.group.set(groupID);

projectID = javaObject('java.lang.Long',2);
config.savedProject.set(projectID);

paths = '/Users/dball07/Documents/Projects/Cell-Cycle/FISH/2012.05.09-FISH_Net1-GFP_GFP-Cy3_20/Region01/Cy3/Cy3_t001.tif';

store = config.createStore();

store.logVersionInfo(config.getIniVersionNumber());
reader = OMEROWrapper(config);

library = ImportLibrary(store, reader);
handler = ErrorHandler(config);
library.addObserver(LoggingImportMonitor());
candidates = ImportCandidates(reader, paths, handler);

reader.setMetadataOptions(DefaultMetadataOptions(MetadataLevel.ALL));
log = org.apache.commons.logging.LogFactory.getLog('ome.formats.importer.ImportLibrary');
log.setLevel(0)
success = library.importCandidates(config, candidates);
store.logout();


This is the printout in MATLAB:
[INFO] ImportConfig - OMERO Version: 4.4.4-ice33-b3099
[INFO] ImportConfig - Bioformats version: 4.4.4 revision: 96c615b date: 25 September 2012
[INFO] OMEROMetadataStoreClient - Attempting initial SSL connection to gladden.vbi.vt.edu:4064
[INFO] OMEROMetadataStoreClient - Call context: {omero.group:3}
[INFO] OMEROMetadataStoreClient - Server: 4.4.4
[INFO] OMEROMetadataStoreClient - Client: 4.4.4-ice33-b3099
[INFO] OMEROMetadataStoreClient - Java Version: 1.6.0_37
[INFO] OMEROMetadataStoreClient - OS Name: Mac OS X
[INFO] OMEROMetadataStoreClient - OS Arch: x86_64
[INFO] OMEROMetadataStoreClient - OS Version: 10.8.2
[DEBUG] ImportLibrary - FS lite enabled readers: [loci.formats.in.TiffDelegateReader, loci.formats.in.APNGReader, loci.formats.in.SVSReader, loci.formats.in.LeicaSCNReader, loci.formats.in.JPEGReader, loci.formats.in.JPEG2000Reader]
[DEBUG] ImportLibrary - Maximum plane width: 3192
[DEBUG] ImportLibrary - Maximum plane height: 3192
[INFO] ImportCandidates - Depth: 4 Metadata Level: MINIMUM
[INFO] ImportCandidates - 1 file(s) parsed into 1 group(s) with 1 call(s) to setId in 41ms. (41ms total) [0 unknowns]
[INFO] OMEROMetadataStoreClient - Call context: {omero.group:3}
[INFO] OMEROMetadataStoreClient - Call context: {omero.group:3}
[DEBUG] ImportLibrary - Image Count: 1
[DEBUG] ImportLibrary - Using TIFF/PNG/JPEG reader FS lite handling.
[DEBUG] ImportLibrary - Image does not meet big image size criteria.
[INFO] ImportLibrary - File format: Tagged Image File Format
[INFO] ImportLibrary - Base reader: loci.formats.in.TiffDelegateReader
[INFO] ImportLibrary - Metadata only import? false
[INFO] ImportLibrary - Archiving enabled? false
[INFO] ImportLibrary - Container metadata only import? false
[INFO] ImportLibrary - Reader is not of HCS domain, use metafile: true
[DEBUG] ImportLibrary - Server tile size: [1392, 376]
[DEBUG] ImportLibrary - Plane:0 X:0 Y:0 TileWidth:1392 TileHeight:376 arrayBuf.length:1046784
[DEBUG] ImportLibrary - Plane:0 X:0 Y:376 TileWidth:1392 TileHeight:376 arrayBuf.length:1046784
[DEBUG] ImportLibrary - Plane:0 X:0 Y:752 TileWidth:1392 TileHeight:288 arrayBuf.length:801792
[INFO] LoggingImportMonitor - IMPORT_DONE
Imported pixels:
15955
dballvt
 
Posts: 24
Joined: Wed Jul 14, 2010 1:45 pm

Re: Uploading from MATLAB

Postby jburel » Tue Nov 27, 2012 7:03 pm

Hi

We are looking into the problem.
I tried similar code in Java and it works.
We will come back to you with more information in the next few days.

Thanks for your patience.
Jmarie
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee

Re: Uploading from MATLAB

Postby sbesson » Thu Nov 29, 2012 9:47 am

Hi,

thanks for reporting this issue. We opened a Pull Request in the source code to fix this bug for OMERO 4.4.x.

If you want to test this fix by yourself, you can download the latest build of OMERO.matlab and use it in your import script. Please be aware this is a development build and may contain other bugs.

Best,
Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Previous

Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest