|
@@ -312,15 +312,18 @@ def isDicom(file):
|
|
|
|
|
|
|
|
|
def dicomValue(file,tag,seqTag=None):
|
|
|
+ debug=False
|
|
|
dcmdump=os.path.join(os.environ['SLICER_HOME'],"bin","dcmdump")
|
|
|
try:
|
|
|
out=subprocess.check_output([dcmdump,'+p','+P',tag,file],shell=True)
|
|
|
- print("Tag {} Line '{}'").format(tag,out)
|
|
|
+ if debug:
|
|
|
+ print("Tag {} Line '{}'").format(tag,out)
|
|
|
if len(out)==0:
|
|
|
return out
|
|
|
tag1="^\({}\)".format(tag)
|
|
|
if not seqTag==None:
|
|
|
- print("Tag:{} seqTag:{}").format(tag,seqTag)
|
|
|
+ if debug:
|
|
|
+ print("Tag:{} seqTag:{}").format(tag,seqTag)
|
|
|
tag1="^\({}\).\({}\)".format(seqTag,tag)
|
|
|
lst=out.split('\n')
|
|
|
rpl=[re.sub(r'^.*\[(.*)\].*$',r'\1',f) for f in lst]
|
|
@@ -329,7 +332,8 @@ def dicomValue(file,tag,seqTag=None):
|
|
|
out=out[0]
|
|
|
#out=re.sub(r'^.*\[(.*)\].*\n$',r'\1',out)
|
|
|
#separate out series
|
|
|
- print("Tag {} Parsed value {}").format(tag,out)
|
|
|
+ if debug:
|
|
|
+ print("Tag {} Parsed value {}").format(tag,out)
|
|
|
if out.find('\\')>-1:
|
|
|
out=out.split('\\')
|
|
|
|