We're Hiring!

dataset and project creation on the commandline?

General user discussion about using the OMERO platform to its fullest. Please ask 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

There are workflow guides for various OMERO functions on our help site - http://help.openmicroscopy.org

You should find answers to any basic questions about using the clients there.

dataset and project creation on the commandline?

Postby helmerj » Wed Jan 26, 2011 8:24 pm

In order to import more than 100.000 images in one go I am working on a ruby import script.
Is it possible to create datasets and projects on the commandline? I was looking through the bin/omero commands and couldn't find anything. So far I will have to have a dataset before starting an import process. Very inconvenient...

I would also need to chown datasets inside the DB.

can any of this be done?

If not tool is available for this. where can I find documentation on the dataset/projection creation process. Doe I need the creation_id and update_id as well as the entries events or can I scrape by without them?

Cheers
Juergen
User avatar
helmerj
 
Posts: 41
Joined: Mon Sep 20, 2010 9:39 am
Location: Berlin, Germany

Re: dataset and project creation on the commandline?

Postby jmoore » Thu Jan 27, 2011 12:01 pm

Hi Juergen,

there's not (yet) any CLI command to create hierarchies, but here's a small shell script which should get you started:
Code: Select all
#!/bin/bash
#
# An example of how to use the command-line
# to launch an arbitrary python script.
#

#
# Configuration:
# -------------
#
export PATH=$PATH:dist/bin
export PYTHONPATH=$PYTHONPATH:dist/lib/python

omero login
export ICE_CONFIG=`omero sessions file`

cat - >> new_dataset.py << EOF
import sys
import omero
from omero.rtypes import rstring
from omero_ext import argparse

client = omero.client()
session = client.getProperty("omero.sess")
session = client.joinSession(session)

p = argparse.ArgumentParser()
p.add_argument("--name", type=omero.rtypes.rstring, default="Somename")
p.add_argument("--description", type=omero.rtypes.rstring, default="")
ns, other = p.parse_known_args(sys.argv)

updateService = session.getUpdateService()

d = omero.model.DatasetI()
d.setName(ns.name)
d.setDescription(ns.description)
d = updateService.saveAndReturnObject(d)

print d.id.val

EOF

DATASET_ID=`python new_dataset.py --name newdataset-$$`
echo "My Dataset: $DATASET_ID"



Let us know how that goes.

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


Return to User Discussion

Who is online

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

cron