File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change 44import logging
55import datetime
66import re
7+ from subprocess import Popen , PIPE , STDOUT
78
89from . import dcm
910from . import scu
1011from . import reaper
11- from subprocess import Popen , PIPE , STDOUT
1212
1313log = logging .getLogger ('reaper.dicom' )
1414
@@ -86,28 +86,22 @@ def _custom_acq_uid(self, metadata_map):
8686 if self .uid_ext_command is None :
8787 return
8888 for filepath , metadata in metadata_map .iteritems ():
89- print (filepath )
90- print (metadata )
9189 dcm_dir = re .sub (r'\.zip$' , '' , filepath )
9290
9391 unzipped_file = [os .path .join (dcm_dir , filename ) for filename in os .listdir (dcm_dir )][0 ]
9492
9593 formatted_string = self .uid_ext_command .format (unzipped_file )
96- print (formatted_string )
97-
9894 arg_list = formatted_string .split ()
9995
100- p = Popen (arg_list ,
101- stdout = PIPE ,
102- stderr = STDOUT )
103- out , _ = p .communicate ()
96+ proc = Popen (arg_list ,
97+ stdout = PIPE ,
98+ stderr = STDOUT )
99+ out , _ = proc .communicate ()
104100
105- if p .returncode and p .returncode != 0 :
106- log .error ('Error with command. Return code = %d' , p .returncode )
101+ if proc .returncode and proc .returncode != 0 :
102+ log .error ('Error with command. Return code = %d' , proc .returncode )
107103 raise RuntimeError (out )
108- print (out .rstrip ())
109104 metadata ['acquisition' ]['uid' ] = out .rstrip ()
110- print (metadata )
111105
112106
113107def update_arg_parser (ap ):
You can’t perform that action at this time.
0 commit comments