1 """
2 components/tools/OmeroPy/src/omero/util/OmeroPopo.py
3
4 -----------------------------------------------------------------------------
5 Copyright (C) 2006-2010 University of Dundee. All rights reserved.
6
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21 ------------------------------------------------------------------------------
22
23 @author Donald MacDonald
24 <a href="mailto:donald@lifesci.dundee.ac.uk">donald@lifesci.dundee.ac.uk</a>
25 @version 3.0
26 <small>
27 (<b>Internal version:</b> $Revision: $Date: $)
28 </small>
29 @since 3.0-Beta4.2
30
31 """
32 import math;
33 import numpy;
34 import omero.clients
35 from omero.model import RoiI
36 from omero.model import EllipseI
37 from omero.model import LineI
38 from omero.model import RectI
39 from omero.model import PointI
40 from omero.model import LabelI
41 from omero.model import PolylineI
42 from omero.model import PolygonI
43 from omero.model import PathI
44 from omero.model import MaskI
45 from omero.model import NamespaceI
46 from omero.rtypes import rdouble
47 from omero.rtypes import rstring
48 from omero.rtypes import rint
49 from omero.rtypes import rfloat
50 from omero.rtypes import rlist
51
52
53
55 """
56 Convert a list to a Comma Separated Value string.
57 @param list The list to convert.
58 @return See above.
59 """
60 lenList = len(list);
61 cnt = 0;
62 str = "";
63 for item in list:
64 str = str + item;
65 if(cnt < lenList-1):
66 str = str + ",";
67 cnt = cnt +1;
68 return str;
69
71 """
72 Convert a csv string to a list of strings
73 @param csvString The CSV string to convert.
74 @return See above.
75 """
76 list = csvString.split(',');
77 for index in range(len(list)):
78 list[index] = list[index].strip();
79 return list;
80
81
82
83
85
86
87
88
90 self.value = None;
91 self.dirty = False;
92
93
94
95
96
97
99 if(value==None):
100 raise Exception("IObject delegate for DataObject cannot be null.");
101 self.value = value;
102
103
104
105
106
108 if(self.value.getId()==None):
109 return -1;
110 return self.value.getId().getValue();
111
112
113
114
118
119
120
121
122
125
126
127
128
129
131 self.dirty = boolean;
132
133
134
135
136
139
140
141
142
145
146
147
148
151
153
154
155
156
163
164
165
166
167
168
169
176
177
178
179
180
181
190
191
192
193
194
195
196
203
204
205
206
207
208
217
218
219
220
222
223
224
225
226
228 self.theZ = z;
229 self.theT = t;
230 self.ZBITSPLIT = 18;
231
232
233
234
236 if(self.theZ == obj.theZ and self.theT == obj.theT):
237 return True;
238 return False;
239
240
241
242
244 if(self.theZ != obj.theZ or self.theT != obj.theT):
245 return True;
246 return False;
247
248
249
250
252 if(self.theT >= obj.theT):
253 return False;
254 if(self.theZ >= obj.theZ):
255 return False;
256 return True;
257
258
259
260
262 if(self.theT < obj.theT):
263 return False;
264 if(self.theZ < obj.theZ):
265 return False;
266 return True;
267
268
269
270
272 if(self.theT <= obj.theT):
273 return False;
274 if(self.theZ <= obj.theZ):
275 return False;
276 return True;
277
278
279
280
282 if(self.theT < obj.theT):
283 return False;
284 if(self.theZ < obj.theZ):
285 return False;
286 return True;
287
288
289
290
292 return self.theZ<<self.ZBITSPLIT+self.theT;
293
294
295
296
297
298
301
302
303
304
305
306
309
310
311
312
313
316
317
318
319
320
323
324
325
326
327
329 """
330 Wrap the serverSide shape as the appropriate OmeroPopos
331 @param serverSideShape The shape object to wrap.
332 @return See above.
333 """
334 print "ServerSideShape"
335 print serverSideShape.__class__.__name__
336 if serverSideShape.__class__.__name__=='EllipseI':
337 return EllipseData(serverSideShape);
338 if serverSideShape.__class__.__name__=='RectI':
339 return RectData(serverSideShape);
340 if serverSideShape.__class__.__name__=='MaskI':
341 return MaskData(serverSideShape);
342 if serverSideShape.__class__.__name__=='PolygonI':
343 return PolygonData(serverSideShape);
344 return None;
345
346
347
348
350
351
352
353
363
364
365
367 self.roiShapes = dict();
368 roi = self.asIObject();
369 shapes = roi.copyShapes();
370 s = None;
371 for shape in shapes:
372 s = shapeWrapper(shape);
373 if(s!=None):
374 coord = ROICoordinate(s.getZ(), s.getT());
375 if(not self.roiShapes.has_key(coord)):
376 self.roiShapes[coord] = list();
377 data = self.roiShapes[coord];
378 data.append(s);
379
380
381
382
383
390
391
392
393
394
396 roi = self.asIObject();
397 if(roi==None):
398 raise Exception("No Roi specified.");
399 return roi.getImage();
400
401
402
403
404
406 roi = self.asIObject();
407 if(roi==None):
408 raise Exception("No Roi specified.");
409 coord = shape.getROICoordinate();
410 shapeList = None;
411 if(self.roiShapes.has_key(coord) == False):
412 shapeList = list();
413 self.roiShapes[coord] = shapeList;
414 else:
415 shapeList = self.roiShapes[coord];
416 shapeList.append(shape);
417 roi.addShape(shape.asIObject());
418 self.setDirty(True);
419
420
421
422
423
425 roi = self.asIObject();
426 if(roi==None):
427 raise Exception("No Roi specified.");
428 coord = shape.getROICoordinate();
429 shapeList = self.roiShapes[coord];
430 shapeList.remove(shape);
431 roi.removeShape(shape.asIObject());
432 self.setDirty(True);
433
434
435
436
437
439 return len(self.roiShapes)
440
441
442
443
444
451
452
453
454
455
456
457
458
461
462
463
464
465
466
468 return self.roiShapes.iteritems();
469
470
471
472
473
474
475
476
478 coordList = self.roiShapes.keys();
479 coordList.sort();
480 keyList = [];
481 for coord in coordList:
482 if(coord>=start and coord <= end):
483 keyList.append(coord);
484 return self.roiShapes.from_keys(keyList);
485
486
487
488
489
490
502
503
504
505
506
516
517
518
519
520
521
523 roi = self.asIObject();
524 if(roi==None):
525 raise Exception("No Roi specified.");
526 roi.setNamespaces(map.keys);
527 keywords = [];
528 for namespace in map.keys:
529 keywords.append(map[namespace]);
530 roi.setKeywords(keywords);
531 self.setDirty(True);
532
533
534
535
536
545
546
547
548
549
551 roi = self.asIObject();
552 if (roi == None):
553 raise Exception("No Roi specified.");
554 namespaces = self.getNamespaces();
555 namespaceKeywords = roi.getKeywords();
556 if(len(namespaces) != len(namespaceKeywords)):
557 raise Exception("Namespaces length does not match keywords namespace length.");
558 map = {};
559 for i in range(len(namespaces)):
560 map[namespaces[i]] = namespaceKeywords[i];
561 return map;
562
564
569
570
571
572
573
574
576 shape = self.asIObject();
577 if(shape==None):
578 raise Exception("No Shape specified.");
579 z = shape.getTheZ();
580 if(z==None):
581 return 0;
582 else:
583 return z.getValue();
584
585
586
587
588
589 - def setZ(self, theZ):
590 shape = self.asIObject();
591 if(shape==None):
592 raise Exception("No Shape specified.");
593 shape.setTheZ(rint(theZ));
594 self.coord.setZSection(theZ);
595 self.setDirty(True);
596
597
598
599
600
601
603 shape = self.asIObject();
604 if(shape==None):
605 raise Exception("No Shape specified.");
606 t = shape.getTheT();
607 if(t==None):
608 return 0;
609 else:
610 return t.getValue();
611
612
613
614
615
616 - def setT(self, theT):
617 shape = self.asIObject();
618 if(shape==None):
619 raise Exception("No Shape specified.");
620 shape.setTheT(rint(theT));
621 self.coord.setTimePoint(theT);
622 self.setDirty(True);
623
624
625
626
627
629 shape = self.asIObject();
630 if(shape==None):
631 raise Exception("No Shape specified.");
632 self.setZ(coord.getZSection());
633 self.setT(coord.getTimePoint());
634 self.coord.setZSection(coord.getZSection());
635 self.coord.setTimePoint(coord.getTimePoint());
636 self.setDirty(True);
637
638
639
640
641
643 shape = self.asIObject();
644 if(shape==None):
645 raise Exception("No Shape specified.");
646 return self.coord;
647
648
649
650
652 shape = self.asIObject();
653 if(shape==None):
654 raise Exception("No Shape specified.");
655 text = shape.getTextValue();
656 if(text==None):
657 return "";
658 else:
659 return text.getValue();
660
661
662
663
664 - def setText(self, text):
665 shape = self.asIObject();
666 if(shape==None):
667 raise Exception("No Shape specified.");
668 shape.setTextValue(rstring(text));
669 self.setDirty(true);
670
671
672
673
674
675
688
695
696
697
698
699
715
716
717
718
719
722
723
724
725
728
729
730
731
733
734
735
736
747
748
749
750
752 shape = self.asIObject();
753 if(shape==None):
754 raise Exception("No Shape specified.");
755 shape.setCx(rdouble(cx));
756
757
758
759
761 shape = self.asIObject();
762 if(shape==None):
763 raise Exception("No Shape specified.");
764 cx = shape.getCx();
765 if(cx==None):
766 return 0;
767 return cx.getValue();
768
769
770
771
773 shape = self.asIObject();
774 if(shape==None):
775 raise Exception("No Shape specified.");
776 shape.setCy(rdouble(cy));
777
778
779
780
782 shape = self.asIObject();
783 if(shape==None):
784 raise Exception("No Shape specified.");
785 cy = shape.getCy();
786 if(cy==None):
787 return 0;
788 return cy.getValue();
789
790
791
792
794 shape = self.asIObject();
795 if(shape==None):
796 raise Exception("No Shape specified.");
797 shape.setRx(rdouble(rx));
798
799
800
801
803 shape = self.asIObject();
804 if(shape==None):
805 raise Exception("No Shape specified.");
806 rx = shape.getRx();
807 if(rx==None):
808 return 0;
809 return rx.getValue();
810
811
812
813
815 shape = self.asIObject();
816 if(shape==None):
817 raise Exception("No Shape specified.");
818 shape.setRy(rdouble(ry));
819
820
821
822
824 shape = self.asIObject();
825 if(shape==None):
826 raise Exception("No Shape specified.");
827 ry = shape.getRy();
828 if(ry==None):
829 return 0;
830 return ry.getValue();
831
832
833
834
835
836
837
841
842
843
844
845
847 cx = self.getCx();
848 cy = self.getCy();
849 rx = self.getRx();
850 ry = self.getRy();
851 transform = self.transformToMatrix(self.getTransform());
852 point = numpy.matrix((cx, cy, 1)).transpose();
853 centre = transform*point;
854 BL = numpy.matrix((cx-rx, cy+ry, 1)).transpose();
855 BR = numpy.matrix((cx+rx, cy+ry, 1)).transpose();
856 TL = numpy.matrix((cx-rx, cy-ry, 1)).transpose();
857 TR = numpy.matrix((cx+rx, cy-ry, 1)).transpose();
858 MajorAxisLeft = numpy.matrix((cx-rx, cy, 1)).transpose();
859 MajorAxisRight = numpy.matrix((cx+rx, cy, 1)).transpose();
860 MinorAxisTop = numpy.matrix((cx, cy-ry, 1)).transpose();
861 MinorAxisBottom = numpy.matrix((cx, cy+ry, 1)).transpose();
862 lb = transform*BL;
863 rb = transform*BR;
864 lt = transform*TL;
865 rt = transform*TR;
866 majl = transform*MajorAxisLeft;
867 majr = transform*MajorAxisRight;
868 mint = transform*MinorAxisTop;
869 minb = transform*MinorAxisBottom;
870 o = (majr[1]-majl[1]);
871 a = (majr[0]-majl[0]);
872 h = math.sqrt(o*o+a*a);
873 majorAxisAngle = math.asin(o/h);
874 boundingBoxMinX = min(lt[0], rt[0],lb[0], rb[0]);
875 boundingBoxMaxX = max(lt[0], rt[0], lb[0], rb[0]);
876 boundingBoxMinY = min(lt[1], rt[1], lb[1], rb[1]);
877 boundingBoxMaxY = max(lt[1], rt[1], lb[1], rb[1]);
878 boundingBox = ((boundingBoxMinX, boundingBoxMinY), (boundingBoxMaxX, boundingBoxMaxY));
879 centredBoundingBox = ((boundingBox[0][0]-centre[0],boundingBox[0][1]-centre[1]),(boundingBox[1][0]-centre[0],boundingBox[1][1]-centre[1]))
880 points = {};
881 cx = float(centre[0]);
882 cy = float(centre[1]);
883 xrange = range(centredBoundingBox[0][0], centredBoundingBox[1][0])
884 yrange = range(centredBoundingBox[0][1], centredBoundingBox[1][1])
885 for x in xrange:
886 for y in yrange:
887 newX = x*math.cos(majorAxisAngle)+y*math.sin(majorAxisAngle);
888 newY = -x*math.sin(majorAxisAngle)+y*math.cos(majorAxisAngle);
889 val = (newX*newX)/(rx*rx)+ (newY*newY)/(ry*ry);
890 if(val <= 1):
891 points[(int(x+cx), int(y+cy))]=1;
892 return points;
893
894
895
896
898
899
900
901
914
915
916
917
918
922
923
924
925
926
930
931
932
933
934
938
939
940
941
942
946
947
948
949
950
958
959
960
961
962
963
964
966 pts = self.toString(points);
967 pts1 = self.toString(points);
968 pts2 = self.toString(points);
969 mask = self.toString(points);
970 str = "points["+pts+"] ";
971 str = str + "points1["+pts1+"] ";
972 str = str + "points2["+pts2+"] ";
973 str = str + "mask["+mask+"]";
974 self.setPointsString(str);
975
976
977
978
980 shape = self.asIObject();
981 if(shape==None):
982 raise Exception("No Shape specified.");
983 pts = shape.getPoints();
984 if(pts==None):
985 return "";
986 else:
987 return pts.getValue();
988
989
990
991
992
993
996
997
998
999
1000
1001
1002
1003
1004 - def getContents(self, string, start, end):
1005 lIndex = string.find(start);
1006 if(lIndex == -1):
1007 return "";
1008 strFragment = string[lIndex:];
1009 rIndex = strFragment.find(']');
1010 if(rIndex == -1):
1011 return "";
1012 return string[lIndex+len(start):rIndex];
1013
1014
1015
1016
1017
1019 numberList = pts.split(',');
1020 return numberList;
1021
1022
1023
1024
1025
1027 str = "";
1028 for index in range(len(pointsList)):
1029 str = str + pt;
1030 if(index<len(pointsList)-1):
1031 str = str + ",";
1032 return str;
1033
1034
1035
1036
1042
1043
1044
1045
1046
1048 pts = self.toCoords(self.getPoints());
1049 minx = pts[0][0];
1050 maxx = minx;
1051 miny = pts[0][1];
1052 maxy = miny;
1053
1054 for pt in pts:
1055 minx = min(pt[0],minx);
1056 miny = min(pt[1],miny);
1057 maxx = max(pt[0],maxx);
1058 maxy = max(pt[1],maxy);
1059 return [(minx,miny), (maxx, maxy)];
1060
1061
1062
1063
1064
1066 coords = [];
1067 for index in range(len(ptsList)/2):
1068 coords.append((int(ptsList[index*2]), int(ptsList[index*2+1])));
1069 return coords;
1070
1071
1072
1073
1074
1075
1077 points = {};
1078 boundingRectangle = self.getBoundingRectangle();
1079 xrange = range(boundingRectangle[0][0], boundingRectangle[1][0])
1080 yrange = range(boundingRectangle[0][1], boundingRectangle[1][1])
1081 for xx in xrange:
1082 for yy in yrange:
1083 if(self.inPolygon((xx,yy))):
1084 points[(xx,yy)]=1;
1085 return points;
1086
1087
1088
1089
1090
1091
1093 angle = 0.0
1094 polypoints = self.getPoints();
1095 cnt = 0;
1096 polygon = [];
1097 for index in range(0,len(polypoints)/2):
1098 polygon.append((int(polypoints[index*2]), int(polypoints[index*2+1])));
1099
1100 n = len(polygon)
1101
1102 for i, (h, v) in enumerate(polygon):
1103 p1 = (h - p[0], v - p[1])
1104 h, v = polygon[(i + 1) % n]
1105 p2 = (h - p[0], v - p[1])
1106 angle += self.Angle2D(p1[0], p1[1], p2[0], p2[1]);
1107
1108 if abs(angle) < math.pi:
1109 return False
1110 return True
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120 - def Angle2D(self, x1, y1, x2, y2):
1121 theta1 = math.atan2(y1, x1)
1122 theta2 = math.atan2(y2, x2)
1123 dtheta = theta2 - theta1
1124 while dtheta > math.pi:
1125 dtheta -= 2.0 * math.pi
1126 while dtheta < -math.pi:
1127 dtheta += 2.0 * math.pi
1128 return dtheta
1129
1130
1131
1132
1134
1135
1136
1137
1149
1150
1151
1152
1153 - def setX(self, x):
1154 shape = self.asIObject();
1155 if(shape==None):
1156 raise Exception("No Shape specified.");
1157 shape.setX(rdouble(x));
1158
1159
1160
1161
1163 shape = self.asIObject();
1164 if(shape==None):
1165 raise Exception("No Shape specified.");
1166 x = shape.getX();
1167 if(x==None):
1168 return 0;
1169 return x.getValue();
1170
1171
1172
1173
1174 - def setY(self, y):
1175 shape = self.asIObject();
1176 if(shape==None):
1177 raise Exception("No Shape specified.");
1178 shape.setY(rdouble(y));
1179
1180
1181
1182
1184 shape = self.asIObject();
1185 if(shape==None):
1186 raise Exception("No Shape specified.");
1187 y = shape.getY();
1188 if(y==None):
1189 return 0;
1190 return y.getValue();
1191
1192
1193
1195 shape = self.asIObject();
1196 if(shape==None):
1197 raise Exception("No Shape specified.");
1198 shape.setWidth(rdouble(width));
1199
1200
1201
1202
1204 shape = self.asIObject();
1205 if(shape==None):
1206 raise Exception("No Shape specified.");
1207 width = shape.getWidth();
1208 if(width==None):
1209 return 0;
1210 return width.getValue();
1211
1212
1213
1215 shape = self.asIObject();
1216 if(shape==None):
1217 raise Exception("No Shape specified.");
1218 shape.setHeight(rdouble(height));
1219
1220
1221
1222
1224 shape = self.asIObject();
1225 if(shape==None):
1226 raise Exception("No Shape specified.");
1227 height = shape.getHeight();
1228 if(height==None):
1229 return 0;
1230 return height.getValue();
1231
1232
1233
1235 shape = self.asIObject();
1236 if(shape==None):
1237 raise Exception("No Shape specified.");
1238 shape.setBytes(mask);
1239
1240
1241
1242
1244 shape = self.asIObject();
1245 if(shape==None):
1246 raise Exception("No Shape specified.");
1247 mask = shape.getBytes();
1248 if(x==None):
1249 return 0;
1250 return mask.getValue();
1251
1252
1253
1254
1255
1257
1258
1259
1260
1271
1272
1273
1274
1275 - def setX(self, x):
1276 shape = self.asIObject();
1277 if (shape == None):
1278 raise Exception("No Shape specified.");
1279 shape.setX(rdouble(x));
1280
1281
1282
1283
1285 shape = self.asIObject();
1286 if (shape == None):
1287 raise Exception("No Shape specified.");
1288 x = shape.getX();
1289 if (x == None):
1290 return 0;
1291 return x.getValue();
1292
1293
1294
1295
1296 - def setY(self, y):
1297 shape = self.asIObject();
1298 if(shape==None):
1299 raise Exception("No Shape specified.");
1300 shape.setY(rdouble(y));
1301
1302
1303
1304
1306 shape = self.asIObject();
1307 if(shape==None):
1308 raise Exception("No Shape specified.");
1309 y = shape.getY();
1310 if(y==None):
1311 return 0;
1312 return y.getValue();
1313
1314
1315
1317 shape = self.asIObject();
1318 if(shape==None):
1319 raise Exception("No Shape specified.");
1320 shape.setWidth(rdouble(width));
1321
1322
1323
1324
1326 shape = self.asIObject();
1327 if(shape==None):
1328 raise Exception("No Shape specified.");
1329 width = shape.getWidth();
1330 if(width==None):
1331 return 0;
1332 return width.getValue();
1333
1334
1335
1337 shape = self.asIObject();
1338 if(shape==None):
1339 raise Exception("No Shape specified.");
1340 shape.setHeight(rdouble(height));
1341
1342
1343
1344
1346 shape = self.asIObject();
1347 if(shape==None):
1348 raise Exception("No Shape specified.");
1349 height = shape.getHeight();
1350 if(height==None):
1351 return 0;
1352 return height.getValue();
1353
1354
1355
1356
1357
1358
1359
1363
1364
1365
1366
1367
1369 transform = self.transformToMatrix(self.getTransform());
1370 x = self.getX();
1371 y = self.getY();
1372 width = self.getWidth();
1373 height = self.getHeight();
1374 point = numpy.matrix((x, y, 1)).transpose();
1375 centre = transform*point;
1376 BL = numpy.matrix((x, y+height, 1)).transpose();
1377 BR = numpy.matrix((x+width, y+height, 1)).transpose();
1378 TL = numpy.matrix((x, y, 1)).transpose();
1379 TR = numpy.matrix((x+width, y, 1)).transpose();
1380 lb = transform*BL;
1381 rb = transform*BR;
1382 lt = transform*TL;
1383 rt = transform*TR;
1384 majl = lb
1385 majr = rb
1386 o = (majr[1]-majl[1]);
1387 a = (majr[0]-majl[0]);
1388 h = math.sqrt(o*o+a*a);
1389 angle = math.asin(o/h);
1390 boundingBoxMinX = min(lt[0], rt[0], lb[0], rb[0]);
1391 boundingBoxMaxX = max(lt[0], rt[0], lb[0], rb[0]);
1392 boundingBoxMinY = min(lt[1], rt[1], lb[1], rb[1]);
1393 boundingBoxMaxY = max(lt[1], rt[1], lb[1], rb[1]);
1394 boundingBox = ((boundingBoxMinX, boundingBoxMinY), (boundingBoxMaxX, boundingBoxMaxY));
1395 points = {};
1396 xrange = range(boundingBox[0][0], boundingBox[1][0])
1397 yrange = range(boundingBox[0][1], boundingBox[1][1])
1398 transformedX = float(centre[0]);
1399 transformedY = float(centre[1]);
1400 cx = float(centre[0]);
1401 cy = float(centre[1]);
1402 for xx in xrange:
1403 for yy in yrange:
1404 newX = xx*math.cos(angle)+yy*math.sin(angle);
1405 newY = -xx*math.sin(angle)+yy*math.cos(angle);
1406
1407 if (newX-transformedX < width and newY-transformedY < height and newX-transformedX > 0 and newY-transformedY > 0):
1408 points[(int(x+cx), int(y+cy))]=1;
1409 return points;
1410
1411
1412
1413
1424
1425
1426
1427
1429 workflow = self.asIObject();
1430 if(workflow==None):
1431 raise Exception("No workflow specified.");
1432 workflow.setName(rstring(namespace));
1433 self.setDirty(True);
1434
1435
1436
1437
1439 workflow = self.asIObject();
1440 if(workflow==None):
1441 raise Exception("No Workflow specified.");
1442 namespace = workflow.getName();
1443 if(namespace==None):
1444 return "";
1445 return namespace.getValue();
1446
1447
1448
1449
1451 workflow = self.asIObject();
1452 if(workflow==None):
1453 raise Exception("No workflow specified.");
1454 workflow.setKeywords(keywords);
1455 self.setDirty(True);
1456
1457
1458
1459
1461 workflow = self.asIObject();
1462 if(workflow==None):
1463 raise Exception("No workflow specified.");
1464 workflow.setKeywords(toList(keywords));
1465 self.setDirty(True);
1466
1467
1468
1469
1471 workflow = self.asIObject();
1472 if(workflow==None):
1473 raise Exception("No Workflow specified.");
1474 keywords = workflow.getKeywords();
1475 if(keywords==None):
1476 return [];
1477 return keywords;
1478
1479
1480
1481
1488
1489
1490
1491
1493 keywords = self.getKeywords();
1494 return (keyword in keywords);
1495
1496
1497
1498
1505