The CLI import command allows you to import images to an OMERO.server from the command line, and is ideally suited for anyone wanting to use a shell-scripted or web-based front-end interface for importing. Based upon the same set of libraries as the standard importer, the command line version supports the same files formats and functions in much the same way. Visit Supported Formats for a detailed list of supported formats.
To import a file image.tif, use:
$ bin/omero import image.tif
Some of the options available to the import command are:
Display the help for the import command
Display the help for the Java option of the import command
Java options can be passed after –, e.g.:
bin/omero import image.tif -- --name=test --description=description
Display the advanced help for the import command
Some advanced import options are described in the In-place import section.
Display all the used files for importing then exits:
$ bin/omero import -f image.tif
$ bin/omero import -f images_folder
This will output a list of all the files which would be imported in groups separated by “#” comments. Note that this usage does not require a running server to be available.
Set the number of directories to scan down for files (default: 4):
$ bin/omero import --depth 1 images_folder
Specify optional step to skip during import.
The import of very large datasets like High-Content Screening data or SPIM data can be time and resource consuming both at the client and at the server level. This option allows the disabling of some non-critical steps and thus faster import of such datasets. The caveat associated with its usage is that some elements are no longer generated at import time. Some of these elements, like thumbnails, will be generated at runtime during client access. Available options that can be skipped are currently:
Skip checksum calculation on image files before and after transfer
This option effectively sets the --checksum_algorithm to use a fast algorithm, File-Size-64, that considers only file size, not the actual file contents.
Skip calculation of the minima and maxima pixel values
This option will also skip the calculation of the pixels checksum. Recalculating minima and maxima pixel values post-import is currently not supported. See Calculation of minima and maxima pixel values for more information.
Skip generation of thumbnails
Thumbnails will usually be generated when accessing the images post-import via the OMERO clients.
Example of usage:
$ bin/omero import large_image --skip all
$ bin/omero import large_image --skip minmax
Multiple import steps can be skipped by supplying multiple arguments:
$ bin/omero import large_image --skip checksum --skip minmax
Set the debug level for the command line import output:
$ bin/omero import images_folder --debug WARN
Report emails to the OME team. This flag is mandatory for the --upload and --logs arguments.
Set the contact email to use when reporting errors. This argument should be used in conjunction with the --report and --upload or --logs arguments.
Upload broken files and log file (if any) with report
The following command would import a broken image and upload it together with the import log if available in case of failure:
$ bin/omero import broken_image --report --upload --email my.email@domain.com
Upload log file (if any) with report
The following command would import a broken image and upload only the import log if available in case of failure:
$ bin/omero import broken_image --report --logs --email my.email@domain.com
The CLI import plugin calls the ome.formats.importer.cli.CommandLineImporter Java class. The Linux OMERO.importer also includes and importer-cli shell script allowing to call the importer directly from Java. Using the importer using the shell script might look like this:
./importer-cli -s localhost -u user -w pass image.tif
To use the ome.formats.importer.cli.CommandLineImporter class from java on the command line you will also need to include a classpath to the required support jars. Please look inside of the importer-cli script for an example of how to do this.
The Command Line Importer tool takes a number of mandatory and optional arguments to run. These options will also be displayed on the command line by passing no arguments to the importer:
Usage: importer-cli [OPTION]... [path [path ...]]...
or: importer-cli [OPTION]... -
Import any number of files into an OMERO instance.
If "-" is the only path, a list of files or directories
is read from standard in. Directories will be searched for
all valid imports.
Session arguments:
Mandatory arguments for creating a session are 1- either the OMERO server hostname,
username and password or 2- the OMERO server hostname and a valid session key.
-s SERVER OMERO server hostname
-u USER OMERO username
-w PASSWORD OMERO password
-k KEY OMERO session key (UUID of an active session)
-p PORT OMERO server port (default: 4064)
Naming arguments:
All naming arguments are optional
-n NAME Image or plate name to use
-x DESCRIPTION Image or plate description to use
--name NAME Image or plate name to use
--description DESCRIPTION Image or plate description to use
Optional arguments:
-h Display this help and exit
-f Display the used files and exit
-c Continue importing after errors
-l READER_FILE Use the list of readers rather than the default
-d DATASET_ID OMERO dataset ID to import image into
-r SCREEN_ID OMERO screen ID to import plate into
--report Report errors to the OME team
--upload Upload broken files and log file (if any) with report. Required --report
--logs Upload log file (if any) with report. Required --report
--email EMAIL Email for reported errors. Required --report
--debug LEVEL Turn debug logging on (optional level)
--annotation-ns ANNOTATION_NS Namespace to use for subsequent annotation
--annotation-text ANNOTATION_TEXT Content for a text annotation (requires namespace)
--annotation-link ANNOTATION_LINK Comment annotation ID to link all images to
Examples:
$ importer-cli -s localhost -u user -w password -d 50 foo.tiff
$ importer-cli -s localhost -u user -w password -d Dataset:50 foo.tiff
$ importer-cli -f foo.tiff
$ importer-cli -s localhost -u username -w password -d 50 --debug ALL foo.tiff
For additional information, see:
http://www.openmicroscopy.org/site/support/omero5.1/users/cli/import.html
Report bugs to <ome-users@lists.openmicroscopy.org.uk>
See also