Commit 2897b915 authored by kulvait's avatar kulvait

Improvements

parent 870b9e07
......@@ -13,6 +13,15 @@ import numpy as np
import os
import cv2
def timeToSeconds(naivetime):
strtime = str(naivetime).split('.', 1)[0]
secondfraction = float("0.%s" % str(naivetime).split('.', 1)[1])
sec = int(strtime[-2:]) + secondfraction
mins = int(strtime[-4:][:2])
hod = int(strtime[-6:][:2])
totalsec = sec + 60 * mins + 60 * 60 * hod
return(totalsec)
# Get frame from DEN file
# Can get a subframe, where row_from is the first row index
# row_to is not included
......
......@@ -14,16 +14,6 @@ import glob
import os
import pydicom
def timeToSeconds(naivetime):
strtime = str(naivetime).split('.', 1)[0]
secondfraction = float("0.%s" % str(naivetime).split('.', 1)[1])
sec = int(strtime[-2:]) + secondfraction
mins = int(strtime[-4:][:2])
hod = int(strtime[-6:][:2])
totalsec = sec + 60 * mins + 60 * 60 * hod
return(totalsec)
def getDicomFiles(d, suffixes=["IMA"]):
dicomFiles = []
for s in suffixes:
......@@ -52,4 +42,4 @@ def getSeriesDescriptions(dicoms):
def getInstanceUIDs(dicoms):
IDs = list(set([x.SeriesInstanceUID for x in dicoms if "SeriesDescription" in x.dir("SeriesDescription")]))
return IDs
\ No newline at end of file
return IDs
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment