[ome-users] Loading Images into OMERO from Matlab

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


Hi Alex,

  Here's all the entries in the pixelsType table in OMERO:

omero=# select * from pixelsType
omero-# ;
  id | bitsize | permissions |     value      | external_id
----+---------+-------------+----------------+-------------
   1 |       1 |         -35 | bit            |
   2 |       8 |         -35 | int8           |
   5 |       8 |         -35 | uint8          |
   3 |      16 |         -35 | int16          |
   4 |      32 |         -35 | int32          |
   6 |      32 |         -35 | uint16         |
   7 |      32 |         -35 | uint32         |
   8 |      32 |         -35 | float          |
   9 |      64 |         -35 | double         |
  10 |      64 |         -35 | complex        |
  11 |     128 |         -35 | double-complex |
(11 rows)

Does that help?
You could also try and view the DB entry for a particular image, to  
see what the "real" value is

E.g. using psql:

omero=# select * from pixelsType where id = (select pixelsType from  
pixels where image = 12753);
  id | bitsize | permissions | value | external_id
----+---------+-------------+-------+-------------
   5 |       8 |         -35 | uint8 |
(1 row)

  Hope that helps,

   Will.



On 27 Jul 2011, at 10:26, Alexander Tournier wrote:

> hi Will
>
> Great thanks, I can see how that works.
>
> second unrelated question:
>
> if I do:
> p = omero.sys.ParametersI();
> p.add('type',rstring('double'));
> q=['from PixelsType as p where p.value= :type'];
> pixelsType = queryService.findByQuery(q,p);
>
> that gives me a 64bit pixelType
>
> if I do:
> pixels.getPixelsType().getBitSize().getValue()
> from an image I took down from OMERO I get 32 bits
>
> Now the images are actually marked as 16bit (2 bytes) in OMERO.insight
>
> So question is;
> - how do I create a 16bit pixelType (uint16)?
> - any reason for the discrepancy between the 16bit in OMERO.insight  
> and the 32bit I get when querying the database from matlab?
>
>
> Many thanks for taking the time to answer my newbie questions!
> Best,
> Alex
>
>
>
> On 27/07/11 10:22, Will Moore wrote:
>>
>> 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
>>
>>
>>
>>
>>
>
>
> 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





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20110727/8e09fde4/attachment.html>


More information about the ome-users mailing list