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