Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mu-map
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tamino Huxohl
mu-map
Commits
df4cde3d
Commit
df4cde3d
authored
2 years ago
by
Tamino Huxohl
Browse files
Options
Downloads
Patches
Plain Diff
refactor __init__ of file package
parent
e167679d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mu_map/file/__init__.py
+14
-6
14 additions, 6 deletions
mu_map/file/__init__.py
with
14 additions
and
6 deletions
mu_map/file/__init__.py
+
14
−
6
View file @
df4cde3d
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment