We're Hiring!

Using array-like objects in omero 4.2 models

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please 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

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Using array-like objects in omero 4.2 models

Postby luca.lianas » Wed Jul 14, 2010 3:31 pm

Hi everyone,
I'm trying to use the new multi-dimensional items inside omero 4.2 models, I'm writing my own models in order to use Omero's data layer and libraries for I\O operations into the database, i wrote a this test model

<types>
<type id="ome.model.test.SimpleTest">
<properties>
<required name="label" type="string"/>
<required name="items" type="int[]"/>
</properties>
</type>
</types>


I compiled the server and I have the Python SimpleTestI object related to my model, I'm trying to write some data inside the "items" field but I cannot find which object type I have to use for this operation. I created a python list containing int values and I used the new wrap function from omero.rtypes and it turned the python list into an omero.rtypes.RList object which contains several RInt object inside but when I put this list inside the SimpleTest object I created and try yo save it an error (ValueError: invalid value for ::omero::model::LucaTest member `_items') occurs.
Please can you give me some examples or advices for this new feature?
luca.lianas
 
Posts: 2
Joined: Wed Jul 14, 2010 3:21 pm

Re: Using array-like objects in omero 4.2 models

Postby jmoore » Thu Jul 15, 2010 8:57 am

Hi Luca,

unfortunately the array-types tested in 4.2 are only "String[]" and "byte[]". Looking into it briefly, I think that int[] is being mapping to bytea incorrectly.

As we move towards full n-dimensional support, the array-types like "float[]" and "int[]" will also come on line. If you would like to work on it yourself, both components/dsl (especially src/ome/dsl/Property.java) and components/blitz/resources/templates/combined.vm will likely need to be modified.

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


Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 1 guest