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
e1ba5dc6
Commit
e1ba5dc6
authored
2 years ago
by
Tamino Huxohl
Browse files
Options
Downloads
Patches
Plain Diff
discarding mu_map slices can now be used to discard same kind of slices from reconstructions
parent
672fd2b9
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/data/review_mu_map.py
+11
-1
11 additions, 1 deletion
mu_map/data/review_mu_map.py
with
11 additions
and
1 deletion
mu_map/data/review_mu_map.py
+
11
−
1
View file @
e1ba5dc6
from
typing
import
Optional
import
numpy
as
np
import
pandas
as
pd
...
...
@@ -6,22 +8,30 @@ HEADER_DISC_FIRST = "discard_first"
HEADER_DISC_LAST
=
"
discard_last
"
def
discard_slices
(
row
:
pd
.
Series
,
μ_map
:
np
.
ndarray
)
->
np
.
ndarray
:
def
discard_slices
(
row
:
pd
.
Series
,
μ_map
:
np
.
ndarray
,
recon
:
Optional
[
np
.
ndarray
]
=
None
)
->
np
.
ndarray
:
"""
Discard slices based on the flags in the row of th according table.
The row is expected to contain the flags
'
discard_first
'
and
'
discard_last
'
.
:param row: the row of meta configuration file of a dataset
:param μ_map: the μ_map
:param recon: optional reconstruction of which the same slice is discarded so that the alignment stays the same
:return: the μ_map with according slices removed
"""
_res
=
μ_map
if
row
[
HEADER_DISC_FIRST
]:
_res
=
_res
[
1
:]
if
recon
is
not
None
:
recon
=
recon
[
1
:]
if
row
[
HEADER_DISC_LAST
]:
_res
=
_res
[:
-
1
]
if
recon
is
not
None
:
recon
=
recon
[:
-
1
]
if
recon
is
not
None
:
return
_res
,
recon
return
_res
...
...
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