scripts
directory of the imagej-omero repository all work as intended. I won't have time for a while to work on this project further.
Hi,
I’m uploading an image on our OMERO server via a groovy script in ImageJ , and I would like to get the image ID of the uploaded file.
I’m using the code example (see below)
store = config.createStore()
def reader = new OMEROWrapper(config)
def library = new ImportLibrary(store,reader)
def errorHandler = new ErrorHandler(config)
library.addObserver(new LoggingImportMonitor())
def candidates = new ImportCandidates (reader, paths, errorHandler)
//println ( candidates )
reader.setMetadataOptions(new DefaultMetadataOptions( MetadataLevel.ALL ) )
def success = library.importCandidates(config, candidates)
And I saw that it prints many info in the console (see below), but I didn’t find a way (yet ) to have access to it.
OMERO Version: 5.4.9-ice36-b101
Bioformats version: 6.3.1 revision: e355a853c5768721711cb9b29c3a27561539c4e4 date: 13 December 2019
Attempting initial SSL connection to omero.epfl.ch:4064
Depth: 4 Metadata Level: MINIMUM
ZeissLSMReader initializing N:\0-PTS-OMERO\images\20200115_IN1_63x1.4_ccd_Image1_RG.lsm
Reading LSM metadata for series #0
1 file(s) parsed into 1 group(s) with 1 call(s) to setId in 17ms. (18ms total) [0 unknowns]
FILESET_UPLOAD_PREPARATION
FILESET_UPLOAD_START
Transferring N:\0-PTS-OMERO\images\20200115_IN1_63x1.4_ccd_Image1_RG.lsm...
FILE_UPLOAD_STARTED: N:\0-PTS-OMERO\images\20200115_IN1_63x1.4_ccd_Image1_RG.lsm
FILE_UPLOAD_COMPLETE: N:\0-PTS-OMERO\images\20200115_IN1_63x1.4_ccd_Image1_RG.lsm
FILESET_UPLOAD_END
IMPORT_STARTED Logfile: 17014
METADATA_IMPORTED Step: 1 of 5 Logfile: 17014
PIXELDATA_PROCESSED Step: 2 of 5 Logfile: 17014
THUMBNAILS_GENERATED Step: 3 of 5 Logfile: 17014
METADATA_PROCESSED Step: 4 of 5 Logfile: 17014
OBJECTS_RETURNED Step: 5 of 5 Logfile: 17014
IMPORT_DONE Imported file: N:\0-PTS-OMERO\images\20200115_IN1_63x1.4_ccd_Image1_RG.lsm
Image:1095
Thank you for your help,
Romain
Hi Romain
you could replace
library.importCandidates(config, candidates)
by
containers = candidates.getContainers()
index = 0
containers.each() { c ->
pixels = library.importImage(c, index, 0, 0)
index++
// pixels is a list from there you can then access the Image ID
}
I will update the example https://github.com/ome/training-scripts/blob/master/practical/groovy/crop_rectangle_from_image.groovy
I hope it helps
Jmarie