-
Notifications
You must be signed in to change notification settings - Fork 102
/
Tables.ice
326 lines (262 loc) · 8.71 KB
/
Tables.ice
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
/*
* $Id$
*
* Copyright 2009 Glencoe Software, Inc. All rights reserved.
* Use is subject to license terms supplied in LICENSE.txt
*
*/
#ifndef OMERO_TABLES_ICE
#define OMERO_TABLES_ICE
#include <omero/ModelF.ice>
#include <omero/RTypes.ice>
#include <omero/System.ice>
#include <omero/Collections.ice>
#include <omero/Repositories.ice>
#include <omero/ServerErrors.ice>
/*
* The Tables API is intended to provide a storage mechanism
* for tabular data.
*
* See http://www.openmicroscopy.org/site/support/omero5.2/developers/Tables.html
*/
module omero {
/*
* Forward declaration
*/
module api {
interface ServiceFactory;
};
module grid {
//
// User-consumable types dealing with
// measurements/results ("tables").
// ========================================================================
//
/**
* Base type for dealing working with tabular data. For efficiency,
* data is grouped by type, i.e. column. These value objects are passed
* through the {@link Table} interface.
**/
class Column {
string name;
string description;
};
class FileColumn extends Column {
omero::api::LongArray values;
};
class ImageColumn extends Column {
omero::api::LongArray values;
};
class RoiColumn extends Column {
omero::api::LongArray values;
};
class WellColumn extends Column {
omero::api::LongArray values;
};
class PlateColumn extends Column {
omero::api::LongArray values;
};
class BoolColumn extends Column {
omero::api::BoolArray values;
};
class DoubleColumn extends Column {
omero::api::DoubleArray values;
};
class LongColumn extends Column {
omero::api::LongArray values;
};
class StringColumn extends Column {
long size;
omero::api::StringArray values;
};
class FloatArrayColumn extends Column {
long size;
omero::api::FloatArrayArray values;
};
class DoubleArrayColumn extends Column {
long size;
omero::api::DoubleArrayArray values;
};
class LongArrayColumn extends Column {
long size;
omero::api::LongArrayArray values;
};
//
// Inline ROIs.
//
/**
* Column requiring special handling.
**/
class MaskColumn extends Column {
omero::api::LongArray imageId;
omero::api::IntegerArray theZ;
omero::api::IntegerArray theT;
omero::api::DoubleArray x;
omero::api::DoubleArray y;
omero::api::DoubleArray w;
omero::api::DoubleArray h;
omero::api::ByteArrayArray bytes;
};
sequence<Column> ColumnArray;
class Data {
long lastModification;
omero::api::LongArray rowNumbers;
ColumnArray columns;
};
["ami"] interface Table {
//
// Reading ======================================================
//
idempotent
omero::model::OriginalFile
getOriginalFile()
throws omero::ServerError;
/**
* Returns empty columns.
**/
idempotent
ColumnArray
getHeaders()
throws omero::ServerError;
idempotent
long
getNumberOfRows()
throws omero::ServerError;
/**
* http://www.pytables.org/docs/manual/apb.html
*
* Leave all three of start, stop, step to 0 to disable.
*
* TODO:Test effect of returning a billion rows matching getWhereList()
*
**/
idempotent
omero::api::LongArray
getWhereList(string condition, omero::RTypeDict variables, long start, long stop, long step)
throws omero::ServerError;
/**
* Read the given rows of data.
*
* {@param rowNumbers} must contain at least one element or an
* {@link omero.ApiUsageException} will be thrown.
**/
idempotent
Data
readCoordinates(omero::api::LongArray rowNumbers)
throws omero::ServerError;
/**
* http://www.pytables.org/docs/manual/ch04.html#Table.read
**/
idempotent
Data
read(omero::api::LongArray colNumbers, long start, long stop)
throws omero::ServerError;
/**
* Simple slice method which will return only the given columns
* and rows in the order supplied.
*
* If colNumbers or rowNumbers is empty (or None), then all values
* will be returned.
*
* <h4>Python examples:</h4>
* <pre>
* data = table.slice(None, None)
* assert len(data.rowNumbers) == table.getNumberOfRows()
*
* data = table.slice(None, \[3,2,1])
* assert data.rowNumbers == \[3,2,1]
* </pre>
**/
idempotent
Data
slice(omero::api::LongArray colNumbers, omero::api::LongArray rowNumbers)
throws omero::ServerError;
//
// Writing ========================================================
//
void
addData(ColumnArray cols)
throws omero::ServerError;
/**
* Allows the user to modify a Data instance passed back
* from a query method and have the values modified. It
* is critical that the {@link Data#lastModification} and the
* {@link Data#rowNumbers} fields are properly set. An exception
* will be thrown if the data has since been modified.
**/
void update(Data modifiedData)
throws omero::ServerError;
//
// Metadata =======================================================
//
idempotent
omero::RTypeDict
getAllMetadata()
throws omero::ServerError;
idempotent
omero::RType
getMetadata(string key)
throws omero::ServerError;
idempotent
void
setAllMetadata(omero::RTypeDict dict)
throws omero::ServerError;
idempotent
void
setMetadata(string key, omero::RType value)
throws omero::ServerError;
//
// Life-cycle =====================================================
//
/**
* Initializes the structure based on
**/
void
initialize(ColumnArray cols)
throws omero::ServerError;
/**
* Adds a column and returns the position index of the new column.
**/
int
addColumn(Column col)
throws omero::ServerError;
/**
**/
void
delete()
throws omero::ServerError;
/**
**/
void
close()
throws omero::ServerError;
};
//
// Interfaces and types running the backend.
// Used by OMERO.blitz to manage the public
// omero.api types.
// ========================================================================
//
["ami"] interface Tables {
/**
* Returns the Repository which this Tables service is watching.
**/
idempotent
omero::grid::Repository*
getRepository()
throws omero::ServerError;
/**
* Returns the Table service for the given "OMERO.tables" file.
* This service will open the file locally to access the data.
* After any modification, the file will be saved locally and
* the server asked to update the database record. This is done
* via services in the {@link omero.api.ServiceFactory}.
*/
idempotent
Table*
getTable(omero::model::OriginalFile file, omero::api::ServiceFactory* sf)
throws omero::ServerError;
};
};
};
#endif