[ome-users] Loading Images into OMERO from Matlab

Will Moore will at lifesci.dundee.ac.uk
Wed Jul 27 10:22:51 BST 2011


Hi Alex,

  Here is some Python code that does what you want (also see comments  
in the code)

import omero
from omero.rtypes import rstring

project = omero.model.ProjectI()
project.setName(rstring("New Project Name"))
project = updateService.saveAndReturnObject(project)

dataset = omero.model.DatasetI()
dataset.setName(rstring("New Dataset Name"))
dataset = updateService.saveAndReturnObject(dataset)

# link Project to Dataset
link = omero.model.ProjectDatasetLinkI()
link.parent = project   									# using 'loaded' object
link.child = omero.model.DatasetI(dataset.id.val, False)  	# using  
'unloaded' object (safer)
updateService.saveObject(link)

# link Dataset to Image
link = omero.model.DatasetImageLinkI()
link.parent = omero.model.DatasetI(dataset.id.val, False)
link.child = omero.model.ImageI(image.id.val, False)
updateService.saveObject(link)


On 27 Jul 2011, at 09:56, Alexander Tournier wrote:

> Hi Will,
> thanks for all that,
> I've found the API page:
> http://trac.openmicroscopy.org.uk/ome/wiki/OmeroApi
> which seems to answer a lot of my questions,
>
> I have a quick one for you:
> I can now see how I can load images back into OMERO, however there  
> doesn't seem to be any concept of Project or Dataset associated with  
> it. Could you point me in the right direction.
>
> Thanks,
>
> Best,
> Alex
>
>
> On 26/07/11 21:19, Will Moore wrote:
>> Hi Alex,
>>
>>   So you managed to get up and running?
>>
>> Documentation is one of the many things we'd like to improve - it's
>> just finding the time.
>> At the moment, the priority is to organise the docs we do have so  
>> that
>> at least you can find what there is.
>>
>> The docs on Matlab are definitely lacking, but did you at least  
>> manage
>> to find your way through this trail of links?
>>
>> http://trac.openmicroscopy.org.uk/ome
>> http://trac.openmicroscopy.org.uk/ome/wiki/OmeroHome
>> http://trac.openmicroscopy.org.uk/ome/wiki/OmeroMatlab
>> maybe http://trac.openmicroscopy.org.uk/ome/wiki/WorkingWithOmero
>>
>>
>>   Will.
>>
>> On 26 Jul 2011, at 18:11, Alexander Tournier wrote:
>>
>>> Thanks Will,
>>> it seems the 'gateway' and 'factory' object have a lot of overlap
>>> but I don't know how to create a factory instance.
>>> Could you let me know how to do that!?
>>> Also I'm finding quite hard to find documentation about all this, is
>>> there somewhere I should be looking?
>>> Thanks,
>>> Alex
>>>
>>>
>>>
>>>
>>> On 26/07/11 15:33, Will Moore wrote:
>>>> Hi Alex,
>>>>
>>>>   I think this forum discussion should have most of your answers,
>>>> including some matlab code that does what you want?
>>>>
>>>> http://www.openmicroscopy.org.uk/community/viewtopic.php?f=6&t=694
>>>>
>>>>   Will.
>>>>
>>>>
>>>> On 26 Jul 2011, at 15:18, Alexander Tournier wrote:
>>>>
>>>>> Hi there,
>>>>>
>>>>> I'm using matlab to do some image analysis.
>>>>> I'm able to get the data from the OMERO database to put through  
>>>>> the
>>>>> analysis from within matlab.
>>>>> However, I then want the results (images) to be uploaded back into
>>>>> OMERO.
>>>>>
>>>>> How can I do this from matlab?
>>>>> I've checked the OMERO-matlab documentation I could find but
>>>>> couldn't find anything on this topic.
>>>>>
>>>>> Thanks,
>>>>> Alex
>>>>>
>>>>>
>>>>> NOTICE AND DISCLAIMER
>>>>> This e-mail (including any attachments) is intended for the above-
>>>>> named person(s). If you are not the intended recipient, notify the
>>>>> sender immediately, delete this email from your system and do not
>>>>> disclose or use for any purpose.
>>>>> We may monitor all incoming and outgoing emails in line with  
>>>>> current
>>>>> legislation. We have taken steps to ensure that this email and
>>>>> attachments are free from any virus, but it remains your
>>>>> responsibility to ensure that viruses do not adversely affect you.
>>>>> Cancer Research UK
>>>>> Registered in England and Wales
>>>>> Company Registered Number: 4325234.
>>>>> Registered Charity Number: 1089464 and Scotland SC041666
>>>>> Registered Office Address: Angel Building, 407 St John Street,
>>>>> London EC1V 4AD.
>>>>> _______________________________________________
>>>>> ome-users mailing list
>>>>> ome-users at lists.openmicroscopy.org.uk
>>>>> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
>>>> William Moore
>>>> Wellcome Trust Centre for Gene Regulation&   Expression
>>>> College of Life Sciences
>>>> MSI/WTB/JBC Complex
>>>> University of Dundee
>>>> Dow Street
>>>> Dundee  DD1 5EH
>>>> United Kingdom
>>>>
>>>> Phone 01382 386364
>>>> http://openmicroscopy.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> NOTICE AND DISCLAIMER
>>> This e-mail (including any attachments) is intended for the above-
>>> named person(s). If you are not the intended recipient, notify the
>>> sender immediately, delete this email from your system and do not
>>> disclose or use for any purpose.
>>> We may monitor all incoming and outgoing emails in line with current
>>> legislation. We have taken steps to ensure that this email and
>>> attachments are free from any virus, but it remains your
>>> responsibility to ensure that viruses do not adversely affect you.
>>> Cancer Research UK
>>> Registered in England and Wales
>>> Company Registered Number: 4325234.
>>> Registered Charity Number: 1089464 and Scotland SC041666
>>> Registered Office Address: Angel Building, 407 St John Street,
>>> London EC1V 4AD.
>> William Moore
>> Wellcome Trust Centre for Gene Regulation&  Expression
>> College of Life Sciences
>> MSI/WTB/JBC Complex
>> University of Dundee
>> Dow Street
>> Dundee  DD1 5EH
>> United Kingdom
>>
>> Phone 01382 386364
>> http://openmicroscopy.org
>>
>>
>>
>>
>>
>
>
> NOTICE AND DISCLAIMER
> This e-mail (including any attachments) is intended for the above- 
> named person(s). If you are not the intended recipient, notify the  
> sender immediately, delete this email from your system and do not  
> disclose or use for any purpose.
> We may monitor all incoming and outgoing emails in line with current  
> legislation. We have taken steps to ensure that this email and  
> attachments are free from any virus, but it remains your  
> responsibility to ensure that viruses do not adversely affect you.  
> Cancer Research UK
> Registered in England and Wales
> Company Registered Number: 4325234.
> Registered Charity Number: 1089464 and Scotland SC041666
> Registered Office Address: Angel Building, 407 St John Street,  
> London EC1V 4AD.

William Moore
Wellcome Trust Centre for Gene Regulation & Expression
College of Life Sciences
MSI/WTB/JBC Complex
University of Dundee
Dow Street
Dundee  DD1 5EH
United Kingdom

Phone 01382 386364
http://openmicroscopy.org








More information about the ome-users mailing list