Commit 291b78c316e9a756607b35b874d844c061136ebc
1 parent
7d25dcfb
Exists in
master
and in
68 other branches
ENH: Date time formated. If tag is seconds
Showing
2 changed files
with
6 additions
and
2 deletions
Show diff stats
invesalius/reader/dicom.py
... | ... | @@ -1416,7 +1416,10 @@ class Parser(): |
1416 | 1416 | return "" |
1417 | 1417 | |
1418 | 1418 | def __format_time(self,value): |
1419 | - if (len(value.split(".")) > 1): | |
1419 | + | |
1420 | + if (len(value.split(".")) == 1): | |
1421 | + data = time.gmtime(float(value)) | |
1422 | + elif (len(value.split(".")) > 1): | |
1420 | 1423 | data = time.strptime(value, "%H.%M.%S") |
1421 | 1424 | elif(len(value.split(":")) > 1): |
1422 | 1425 | data = time.strptime(value, "%H:%M:%S") |
... | ... | @@ -1674,6 +1677,7 @@ if __name__ == "__main__": |
1674 | 1677 | |
1675 | 1678 | for i in xrange(1,total+1): |
1676 | 1679 | filename = "..//data//"+str(i)+".dcm" |
1680 | + | |
1677 | 1681 | parser = Parser() |
1678 | 1682 | if parser.SetFileName(filename): |
1679 | 1683 | print "p:", parser.GetPatientName() | ... | ... |
invesalius/reader/dicom_grouper.py
... | ... | @@ -287,7 +287,7 @@ class DicomGroups: |
287 | 287 | |
288 | 288 | key = tmp1.keys()[m] |
289 | 289 | information = tmp1[key] |
290 | - new_key = (information.patient.name, None, x, information.image.orientation_label) | |
290 | + new_key = (information.patient.name, None, x, information.image.orientation_label, information.acquisition.time) | |
291 | 291 | |
292 | 292 | |
293 | 293 | list = [information] | ... | ... |