1
14
15import gdcm
16import sys,os
17
19 def ShowProgress(self, sender, event):
20 pe = gdcm.ProgressEvent.Cast(event)
21 print pe.GetProgress()
22 def EndFilter(self):
23 print "Yay ! I am done"
24
25if __name__ == "__main__":
26 directory = sys.argv[1]
27
28
31
32
34 nfiles = d.Load( directory );
35 if(nfiles == 0): sys.exit(1);
36
37
38 filenames = d.GetFilenames()
39
40
42
43
45 s = sp.__ref__()
46 w = ProgressWatcher(s, 'Watcher')
47
48 s.AddTag( t1 );
49 s.AddTag( t2 );
50 b = s.Scan( filenames );
51 if(not b): sys.exit(1);
52
53 print "success" ;
54
55
56 pttv = gdcm.PythonTagToValue( s.GetMapping( filenames[1] ) )
57 pttv.Start()
58
59 while( not pttv.IsAtEnd() ):
60
61
62
63 tag = pttv.GetCurrentTag()
64 value = pttv.GetCurrentValue()
65 print tag,"->",value
66
67 pttv.Next()
68
69 sys.exit(0)
Class for manipulation directories.
Definition gdcmDirectory.h:43
static SmartPointer< Scanner > New()
for wrapped language: instantiate a reference counted object
Definition gdcmScanner.h:157
SimpleSubjectWatcher.
Definition gdcmSimpleSubjectWatcher.h:32
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element).
Definition gdcmTag.h:39