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
51
52
54 """
55 Convert a list to a Comma Separated Value string.
56 @param list The list to convert.
57 @return See above.
58 """
59 lenList = len(list);
60 cnt = 0;
61 str = "";
62 for item in list:
63 str = str + item;
64 if(cnt < lenList-1):
65 str = str + ",";
66 cnt = cnt +1;
67 return str;
68
70 """
71 Convert a csv string to a list of strings
72 @param csvString The CSV string to convert.
73 @return See above.
74 """
75 list = csvString.split(',');
76 for index in range(len(list)):
77 list[index] = list[index].strip();
78 return list;
79
80
81
82
84
85
86
87
89 self.value = None;
90 self.dirty = False;
91
92
93
94
95
96
98 if(value==None):
99 raise Exception("IObject delegate for DataObject cannot be null.");
100 self.value = value;
101
102
103
104
105
107 if(self.value.getId()==None):
108 return -1;
109 return self.value.getId().getValue();
110
111
112
113
117
118
119
120
121
124
125
126
127
128
130 self.dirty = boolean;
131
132
133
134
135
138
139
140
141
144
145
146
147
150
152
153
154
155
162
163
164
165
166
167
168
175
176
177
178
179
180
182 image = self.asIObject();
183 if(image==None):
184 raise Exception("No Image specified.");
185 name = image.getName();
186 if(name==None):
187 return "";
188 return name.getValue();
189
190
191
192
193
194
195
202
203
204
205
206
207
209 image = self.asIObject();
210 if(image==None):
211 raise Exception("No Image specified.");
212 description = image.getDescription();
213 if(description==None):
214 return "";
215 return description.getValue();
216
217
218
219
221
222
223
224
225
227 self.theZ = z;
228 self.theT = t;
229 self.ZBITSPLIT = 18;
230
231
232
233
235 if(self.theZ == obj.theZ and self.theT == obj.theT):
236 return True;
237 return False;
238
239
240
241
243 if(self.theZ != obj.theZ or self.theT != obj.theT):
244 return True;
245 return False;
246
247
248
249
251 if(self.theT >= obj.theT):
252 return False;
253 if(self.theZ >= obj.theZ):
254 return False;
255 return True;
256
257
258
259
261 if(self.theT < obj.theT):
262 return False;
263 if(self.theZ < obj.theZ):
264 return False;
265 return True;
266
267
268
269
271 if(self.theT <= obj.theT):
272 return False;
273 if(self.theZ <= obj.theZ):
274 return False;
275 return True;
276
277
278
279
281 if(self.theT < obj.theT):
282 return False;
283 if(self.theZ < obj.theZ):
284 return False;
285 return True;
286
287
288
289
291 return self.theZ<<self.ZBITSPLIT+self.theT;
292
293
294
295
296
297
300
301
302
303
304
305
308
309
310
311
312
315
316
317
318
319
322
323
324
325
326
328 """
329 Wrap the serverSide shape as the appropriate OmeroPopos
330 @param serverSideShape The shape object to wrap.
331 @return See above.
332 """
333 print "ServerSideShape"
334 print serverSideShape.__class__.__name__
335 if serverSideShape.__class__.__name__=='EllipseI':
336 return EllipseData(serverSideShape);
337 if serverSideShape.__class__.__name__=='RectI':
338 return RectData(serverSideShape);
339 if serverSideShape.__class__.__name__=='MaskI':
340 return MaskData(serverSideShape);
341 if serverSideShape.__class__.__name__=='PolygonI':
342 return PolygonData(serverSideShape);
343 return None;
344
345
346
347
349
350
351
352
362
363
364
366 self.roiShapes = dict();
367 roi = self.asIObject();
368 shapes = roi.copyShapes();
369 s = None;
370 for shape in shapes:
371 s = shapeWrapper(shape);
372 if(s!=None):
373 coord = ROICoordinate(s.getZ(), s.getT());
374 if(not self.roiShapes.has_key(coord)):
375 self.roiShapes[coord] = list();
376 data = self.roiShapes[coord];
377 data.append(s);
378
379
380
381
382
384 roi = self.asIObject();
385 if(roi==None):
386 raise Exception("No Roi specified.");
387 roi.setImage(image);
388 self.setDirty(True);
389
390
391
392
393
395 roi = self.asIObject();
396 if(roi==None):
397 raise Exception("No Roi specified.");
398 return roi.getImage();
399
400
401
402
403
405 roi = self.asIObject();
406 if(roi==None):
407 raise Exception("No Roi specified.");
408 coord = shape.getROICoordinate();
409 shapeList = None;
410 if(self.roiShapes.has_key(coord) == False):
411 shapeList = list();
412 self.roiShapes[coord] = shapeList;
413 else:
414 shapeList = self.roiShapes[coord];
415 shapeList.append(shape);
416 roi.addShape(shape.asIObject());
417 self.setDirty(True);
418
419
420
421
422
424 roi = self.asIObject();
425 if(roi==None):
426 raise Exception("No Roi specified.");
427 coord = shape.getROICoordinate();
428 shapeList = self.roiShapes[coord];
429 shapeList.remove(shape);
430 roi.removeShape(shape.asIObject());
431 self.setDirty(True);
432
433
434
435
436
438 return len(self.roiShapes)
439
440
441
442
443
450
451
452
453
454
455
456
457
460
461
462
463
464
465
467 return self.roiShapes.iteritems();
468
469
470
471
472
473
474
475
477 coordList = self.roiShapes.keys();
478 coordList.sort();
479 keyList = [];
480 for coord in coordList:
481 if(coord>=start and coord <= end):
482 keyList.append(coord);
483 return self.roiShapes.from_keys(keyList);
484
485
486
487
488
489
501
502
503
504
505
515
516
517
518
519
520
522 roi = self.asIObject();
523 if(roi==None):
524 raise Exception("No Roi specified.");
525 roi.setNamespaces(map.keys);
526 keywords = [];
527 for namespace in map.keys:
528 keywords.append(map[namespace]);
529 roi.setKeywords(keywords);
530 self.setDirty(True);
531
532
533
534
535
544
545
546
547
548
550 roi = self.asIObject();
551 if(roi==None):
552 raise Exception("No Roi specified.");
553 namespaces = self.getNamespaces();
554 namespaceKeywords = roi.getKeywords();
555 if(len(namespaces) != len(namespaceKeywords)):
556 raise Exception("Namespaces length does not match keywords namespace length.");
557 map = {};
558 for i in range(len(namespaces)):
559 map[namespaces[i]] = namespaceKeywords[i];
560 return map;
561
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
700
716
717
718
719
720
723
724
725
726
729
730
731
732
734
735
736
737
748
749
750
751
753 shape = self.asIObject();
754 if(shape==None):
755 raise Exception("No Shape specified.");
756 shape.setCx(rdouble(cx));
757
758
759
760
762 shape = self.asIObject();
763 if(shape==None):
764 raise Exception("No Shape specified.");
765 cx = shape.getCx();
766 if(cx==None):
767 return 0;
768 return cx.getValue();
769
770
771
772
774 shape = self.asIObject();
775 if(shape==None):
776 raise Exception("No Shape specified.");
777 shape.setCy(rdouble(cy));
778
779
780
781
783 shape = self.asIObject();
784 if(shape==None):
785 raise Exception("No Shape specified.");
786 cy = shape.getCy();
787 if(cy==None):
788 return 0;
789 return cy.getValue();
790
791
792
793
795 shape = self.asIObject();
796 if(shape==None):
797 raise Exception("No Shape specified.");
798 shape.setRx(rdouble(rx));
799
800
801
802
804 shape = self.asIObject();
805 if(shape==None):
806 raise Exception("No Shape specified.");
807 rx = shape.getRx();
808 if(rx==None):
809 return 0;
810 return rx.getValue();
811
812
813
814
816 shape = self.asIObject();
817 if(shape==None):
818 raise Exception("No Shape specified.");
819 shape.setRy(rdouble(ry));
820
821
822
823
825 shape = self.asIObject();
826 if(shape==None):
827 raise Exception("No Shape specified.");
828 ry = shape.getRy();
829 if(ry==None):
830 return 0;
831 return ry.getValue();
832
833
834
835
836
837
838
842
843
844
845
846
848 cx = self.getCx();
849 cy = self.getCy();
850 rx = self.getRx();
851 ry = self.getRy();
852 transform = self.transformToMatrix(self.getTransform());
853 point = numpy.matrix((cx, cy, 1)).transpose();
854 centre = transform*point;
855 BL = numpy.matrix((cx-rx, cy+ry, 1)).transpose();
856 BR = numpy.matrix((cx+rx, cy+ry, 1)).transpose();
857 TL = numpy.matrix((cx-rx, cy-ry, 1)).transpose();
858 TR = numpy.matrix((cx+rx, cy-ry, 1)).transpose();
859 MajorAxisLeft = numpy.matrix((cx-rx, cy, 1)).transpose();
860 MajorAxisRight = numpy.matrix((cx+rx, cy, 1)).transpose();
861 MinorAxisTop = numpy.matrix((cx, cy-ry, 1)).transpose();
862 MinorAxisBottom = numpy.matrix((cx, cy+ry, 1)).transpose();
863 lb = transform*BL;
864 rb = transform*BR;
865 lt = transform*TL;
866 rt = transform*TR;
867 majl = transform*MajorAxisLeft;
868 majr = transform*MajorAxisRight;
869 mint = transform*MinorAxisTop;
870 minb = transform*MinorAxisBottom;
871 o = (majr[1]-majl[1]);
872 a = (majr[0]-majl[0]);
873 h = math.sqrt(o*o+a*a);
874 majorAxisAngle = math.asin(o/h);
875 boundingBoxMinX = min(lt[0], rt[0],lb[0], rb[0]);
876 boundingBoxMaxX = max(lt[0], rt[0], lb[0], rb[0]);
877 boundingBoxMinY = min(lt[1], rt[1], lb[1], rb[1]);
878 boundingBoxMaxY = max(lt[1], rt[1], lb[1], rb[1]);
879 boundingBox = ((boundingBoxMinX, boundingBoxMinY), (boundingBoxMaxX, boundingBoxMaxY));
880 centredBoundingBox = ((boundingBox[0][0]-centre[0],boundingBox[0][1]-centre[1]),(boundingBox[1][0]-centre[0],boundingBox[1][1]-centre[1]))
881 points = {};
882 cx = float(centre[0]);
883 cy = float(centre[1]);
884 xrange = range(centredBoundingBox[0][0], centredBoundingBox[1][0])
885 yrange = range(centredBoundingBox[0][1], centredBoundingBox[1][1])
886 for x in xrange:
887 for y in yrange:
888 newX = x*math.cos(majorAxisAngle)+y*math.sin(majorAxisAngle);
889 newY = -x*math.sin(majorAxisAngle)+y*math.cos(majorAxisAngle);
890 val = (newX*newX)/(rx*rx)+ (newY*newY)/(ry*ry);
891 if(val <= 1):
892 points[(int(x+cx), int(y+cy))]=1;
893 return points;
894
895
896
897
899
900
901
902
915
916
917
918
919
923
924
925
926
927
931
932
933
934
935
939
940
941
942
943
947
948
949
950
951
959
960
961
962
963
964
965
967 pts = self.toString(points);
968 pts1 = self.toString(points);
969 pts2 = self.toString(points);
970 mask = self.toString(points);
971 str = "points["+pts+"] ";
972 str = str + "points1["+pts1+"] ";
973 str = str + "points2["+pts2+"] ";
974 str = str + "mask["+mask+"]";
975 self.setPointsString(str);
976
977
978
979
981 shape = self.asIObject();
982 if(shape==None):
983 raise Exception("No Shape specified.");
984 pts = shape.getPoints();
985 if(pts==None):
986 return "";
987 else:
988 return pts.getValue();
989
990
991
992
993
994
997
998
999
1000
1001
1002
1003
1004
1005 - def getContents(self, string, start, end):
1006 lIndex = string.find(start);
1007 if(lIndex == -1):
1008 return "";
1009 strFragment = string[lIndex:];
1010 rIndex = strFragment.find(']');
1011 if(rIndex == -1):
1012 return "";
1013 return string[lIndex+len(start):rIndex];
1014
1015
1016
1017
1018
1020 numberList = pts.split(',');
1021 return numberList;
1022
1023
1024
1025
1026
1028 str = "";
1029 for index in range(len(pointsList)):
1030 str = str + pt;
1031 if(index<len(pointsList)-1):
1032 str = str + ",";
1033 return str;
1034
1035
1036
1037
1043
1044
1045
1046
1047
1049 pts = self.toCoords(self.getPoints());
1050 minx = pts[0][0];
1051 maxx = minx;
1052 miny = pts[0][1];
1053 maxy = miny;
1054
1055 for pt in pts:
1056 minx = min(pt[0],minx);
1057 miny = min(pt[1],miny);
1058 maxx = max(pt[0],maxx);
1059 maxy = max(pt[1],maxy);
1060 return [(minx,miny), (maxx, maxy)];
1061
1062
1063
1064
1065
1067 coords = [];
1068 for index in range(len(ptsList)/2):
1069 coords.append((int(ptsList[index*2]), int(ptsList[index*2+1])));
1070 return coords;
1071
1072
1073
1074
1075
1076
1078 points = {};
1079 boundingRectangle = self.getBoundingRectangle();
1080 xrange = range(boundingRectangle[0][0], boundingRectangle[1][0])
1081 yrange = range(boundingRectangle[0][1], boundingRectangle[1][1])
1082 for xx in xrange:
1083 for yy in yrange:
1084 if(self.inPolygon((xx,yy))):
1085 points[(xx,yy)]=1;
1086 return points;
1087
1088
1089
1090
1091
1092
1094 angle = 0.0
1095 polypoints = self.getPoints();
1096 cnt = 0;
1097 polygon = [];
1098 for index in range(0,len(polypoints)/2):
1099 polygon.append((int(polypoints[index*2]), int(polypoints[index*2+1])));
1100
1101 n = len(polygon)
1102
1103 for i, (h, v) in enumerate(polygon):
1104 p1 = (h - p[0], v - p[1])
1105 h, v = polygon[(i + 1) % n]
1106 p2 = (h - p[0], v - p[1])
1107 angle += self.Angle2D(p1[0], p1[1], p2[0], p2[1]);
1108
1109 if abs(angle) < math.pi:
1110 return False
1111 return True
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121 - def Angle2D(self, x1, y1, x2, y2):
1122 theta1 = math.atan2(y1, x1)
1123 theta2 = math.atan2(y2, x2)
1124 dtheta = theta2 - theta1
1125 while dtheta > math.pi:
1126 dtheta -= 2.0 * math.pi
1127 while dtheta < -math.pi:
1128 dtheta += 2.0 * math.pi
1129 return dtheta
1130
1131
1132
1133
1135
1136
1137
1138
1150
1151
1152
1153
1154 - def setX(self, x):
1155 shape = self.asIObject();
1156 if(shape==None):
1157 raise Exception("No Shape specified.");
1158 shape.setX(rdouble(x));
1159
1160
1161
1162
1164 shape = self.asIObject();
1165 if(shape==None):
1166 raise Exception("No Shape specified.");
1167 x = shape.getX();
1168 if(x==None):
1169 return 0;
1170 return x.getValue();
1171
1172
1173
1174
1175 - def setY(self, y):
1176 shape = self.asIObject();
1177 if(shape==None):
1178 raise Exception("No Shape specified.");
1179 shape.setY(rdouble(y));
1180
1181
1182
1183
1185 shape = self.asIObject();
1186 if(shape==None):
1187 raise Exception("No Shape specified.");
1188 y = shape.getY();
1189 if(y==None):
1190 return 0;
1191 return y.getValue();
1192
1193
1194
1196 shape = self.asIObject();
1197 if(shape==None):
1198 raise Exception("No Shape specified.");
1199 shape.setWidth(rdouble(width));
1200
1201
1202
1203
1205 shape = self.asIObject();
1206 if(shape==None):
1207 raise Exception("No Shape specified.");
1208 width = shape.getWidth();
1209 if(width==None):
1210 return 0;
1211 return width.getValue();
1212
1213
1214
1216 shape = self.asIObject();
1217 if(shape==None):
1218 raise Exception("No Shape specified.");
1219 shape.setHeight(rdouble(height));
1220
1221
1222
1223
1225 shape = self.asIObject();
1226 if(shape==None):
1227 raise Exception("No Shape specified.");
1228 height = shape.getHeight();
1229 if(height==None):
1230 return 0;
1231 return height.getValue();
1232
1233
1234
1236 shape = self.asIObject();
1237 if(shape==None):
1238 raise Exception("No Shape specified.");
1239 shape.setBytes(mask);
1240
1241
1242
1243
1245 shape = self.asIObject();
1246 if(shape==None):
1247 raise Exception("No Shape specified.");
1248 mask = shape.getBytes();
1249 if(x==None):
1250 return 0;
1251 return mask.getValue();
1252
1253
1254
1255
1256
1258
1259
1260
1261
1272
1273
1274
1275
1276 - def setX(self, x):
1277 shape = self.asIObject();
1278 if(shape==None):
1279 raise Exception("No Shape specified.");
1280 shape.setX(rdouble(x));
1281
1282
1283
1284
1286 shape = self.asIObject();
1287 if(shape==None):
1288 raise Exception("No Shape specified.");
1289 x = shape.getX();
1290 if(x==None):
1291 return 0;
1292 return x.getValue();
1293
1294
1295
1296
1297 - def setY(self, y):
1298 shape = self.asIObject();
1299 if(shape==None):
1300 raise Exception("No Shape specified.");
1301 shape.setY(rdouble(y));
1302
1303
1304
1305
1307 shape = self.asIObject();
1308 if(shape==None):
1309 raise Exception("No Shape specified.");
1310 y = shape.getY();
1311 if(y==None):
1312 return 0;
1313 return y.getValue();
1314
1315
1316
1318 shape = self.asIObject();
1319 if(shape==None):
1320 raise Exception("No Shape specified.");
1321 shape.setWidth(rdouble(width));
1322
1323
1324
1325
1327 shape = self.asIObject();
1328 if(shape==None):
1329 raise Exception("No Shape specified.");
1330 width = shape.getWidth();
1331 if(width==None):
1332 return 0;
1333 return width.getValue();
1334
1335
1336
1338 shape = self.asIObject();
1339 if(shape==None):
1340 raise Exception("No Shape specified.");
1341 shape.setHeight(rdouble(height));
1342
1343
1344
1345
1347 shape = self.asIObject();
1348 if(shape==None):
1349 raise Exception("No Shape specified.");
1350 height = shape.getHeight();
1351 if(height==None):
1352 return 0;
1353 return height.getValue();
1354
1355
1356
1357
1358
1359
1360
1364
1365
1366
1367
1368
1370 transform = self.transformToMatrix(self.getTransform());
1371 x = self.getX();
1372 y = self.getY();
1373 w = self.getWidth();
1374 h = self.getHeight();
1375 point = numpy.matrix((x, y, 1)).transpose();
1376 centre = transform*point;
1377 BL = numpy.matrix((x, y+height, 1)).transpose();
1378 BR = numpy.matrix((x+width, y+height, 1)).transpose();
1379 TL = numpy.matrix((x, y, 1)).transpose();
1380 TR = numpy.matrix((x+width, y, 1)).transpose();
1381 lb = transform*BL;
1382 rb = transform*BR;
1383 lt = transform*TL;
1384 rt = transform*TR;
1385 majl = lb
1386 majr = lr
1387 o = (majr[1]-majl[1]);
1388 a = (majr[0]-majl[0]);
1389 h = math.sqrt(o*o+a*a);
1390 angle = math.asin(o/h);
1391 boundingBoxMinX = min(lt[0], rt[0],lb[0], rb[0]);
1392 boundingBoxMaxX = max(lt[0], rt[0], lb[0], rb[0]);
1393 boundingBoxMinY = min(lt[1], rt[1], lb[1], rb[1]);
1394 boundingBoxMaxY = max(lt[1], rt[1], lb[1], rb[1]);
1395 boundingBox = ((boundingBoxMinX, boundingBoxMinY), (boundingBoxMaxX, boundingBoxMaxY));
1396 points = {};
1397 xrange = range(boundingBox[0][0], boundingBox[1][0])
1398 yrange = range(boundingBox[0][1], boundingBox[1][1])
1399 for xx in xrange:
1400 for yy in yrange:
1401 newX = xx*math.cos(angle)+yy*math.sin(angle);
1402 newY = -xx*math.sin(angle)+yy*math.cos(angle);
1403 if( newX-transformedX < width and newY-transformedY < height and newX-transformedX > 0 and newY-transformedY > 0):
1404 points[(int(x+cx), int(y+cy))]=1;
1405 return points;
1406
1407
1408
1409
1419
1420
1421
1422
1424 workflow = self.asIObject();
1425 if(workflow==None):
1426 raise Exception("No workflow specified.");
1427 workflow.setName(rstring(namespace));
1428 self.setDirty(True);
1429
1430
1431
1432
1434 workflow = self.asIObject();
1435 if(workflow==None):
1436 raise Exception("No Workflow specified.");
1437 namespace = workflow.getName();
1438 if(namespace==None):
1439 return "";
1440 return namespace.getValue();
1441
1442
1443
1444
1446 workflow = self.asIObject();
1447 if(workflow==None):
1448 raise Exception("No workflow specified.");
1449 workflow.setKeywords(toList(keywords));
1450 self.setDirty(True);
1451
1452
1453
1454
1456 workflow = self.asIObject();
1457 if(workflow==None):
1458 raise Exception("No Workflow specified.");
1459 keywords = workflow.getKeywords();
1460 if(keywords==None):
1461 return "";
1462 return keywords.getValue();
1463
1464
1465
1466
1473
1474
1475
1476
1480
1481
1482
1483
1490