Skip to content
Snippets Groups Projects
Commit df4cde3d authored by Tamino Huxohl's avatar Tamino Huxohl
Browse files

refactor __init__ of file package

parent e167679d
No related branches found
No related tags found
No related merge requests found
import os
from mu_map.file.dicom import load_dcm
from mu_map.file.dicom import load_dcm, load_dcm_img
from mu_map.file.dicom_to_interfile import to_interfile
from mu_map.file.interfile import load_interfile, Interfile
from mu_map.file.interfile import load_interfile, load_interfile_img, Interfile
def load_as_interfile(filename: str) -> Interfile:
def is_dicom(filename: str):
_, ext = os.path.splitext(filename)
if ext == ".dcm":
return to_interfile(*load_dcm(filename))
return ext == ".ext"
return load_interfile(filename)
def load_as_interfile(filename: str) -> Interfile:
if is_dicom(filename):
return to_interfile(*load_dcm(filename))
else:
return load_interfile(filename)
def load_img(filename: str) -> Interfile:
if is_dicom(filename):
return load_dcm_img(filename)
else:
return load_interfile_img(filename)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment