File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -528,16 +528,16 @@ def get_datetime_from_dcm(dcm_data: dcm.FileDataset) -> Optional[datetime.dateti
528
528
"""
529
529
acq_date = dcm_data .get ("AcquisitionDate" , "" ).strip ()
530
530
acq_time = dcm_data .get ("AcquisitionTime" , "" ).strip ()
531
- if len ( acq_date ) > 0 and len ( acq_time ) > 0 :
531
+ if acq_date and acq_time :
532
532
return strptime_micr (acq_date + acq_time , "%Y%m%d%H%M%S[.%f]" )
533
533
534
534
acq_dt = dcm_data .get ("AcquisitionDateTime" , "" ).strip ()
535
- if len ( acq_dt ) > 0 :
535
+ if acq_dt :
536
536
return strptime_micr (acq_dt , "%Y%m%d%H%M%S[.%f]" )
537
537
538
538
series_date = dcm_data .get ("SeriesDate" , "" ).strip ()
539
539
series_time = dcm_data .get ("SeriesTime" , "" ).strip ()
540
- if len ( series_date ) > 0 and len ( series_time ) > 0 :
540
+ if series_date and series_time :
541
541
return strptime_micr (series_date + series_time , "%Y%m%d%H%M%S[.%f]" )
542
542
return None
543
543
You can’t perform that action at this time.
0 commit comments