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
c5cb4ed3
Commit
c5cb4ed3
authored
2 years ago
by
Tamino Huxohl
Browse files
Options
Downloads
Patches
Plain Diff
update projection script (header and util function usage)
parent
62f59e49
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/recon/project.py
+21
-29
21 additions, 29 deletions
mu_map/recon/project.py
with
21 additions
and
29 deletions
mu_map/recon/project.py
+
21
−
29
View file @
c5cb4ed3
...
@@ -18,37 +18,35 @@ from mu_map.file.interfile import (
...
@@ -18,37 +18,35 @@ from mu_map.file.interfile import (
A template for a header of a projection in INTERFILE format.
A template for a header of a projection in INTERFILE format.
"""
"""
TEMPLATE_HEADER_PROJ
=
"""
TEMPLATE_HEADER_PROJ
=
"""
!
INTERFILE :=
INTERFILE :=
!
imaging modality := nucmed
imaging modality := nucmed
!
version of keys := 3.3
version of keys := 3.3
name of data file := {DATA_FILE}
name of data file := {DATA_FILE}
;data offset in bytes := 0
!
GENERAL IMAGE DATA :=
GENERAL IMAGE DATA :=
!
type of data := Tomographic
type of data := Tomographic
imagedata byte order := LITTLEENDIAN
imagedata byte order := LITTLEENDIAN
!
number format := float
number format := float
!
number of bytes per pixel := 4
number of bytes per pixel := 4
!SPECT STUDY (General) :=
SPECT STUDY (General) :=
;number of dimensions := 2
;matrix axis label [2] := axial coordinate
;matrix axis label [2] := axial coordinate
!
matrix size [2] := {SLICES}
matrix size [2] := {SLICES}
!
scaling factor (mm/pixel) [2] := {SPACING_SLICES}
scaling factor (mm/pixel) [2] := {SPACING_SLICES}
;matrix axis label [1] := bin coordinate
;matrix axis label [1] := bin coordinate
!
matrix size [1] := {BINS}
matrix size [1] := {BINS}
!
scaling factor (mm/pixel) [1] := {SPACING_BINS}
scaling factor (mm/pixel) [1] := {SPACING_BINS}
!
number of projections := {N_PROJECTIONS}
number of projections := {N_PROJECTIONS}
!
extent of rotation := {ROTATION}
extent of rotation := {ROTATION}
!
process status := acquired
process status := acquired
!
SPECT STUDY (acquired data) :=
SPECT STUDY (acquired data) :=
!
direction of rotation := CW
direction of rotation := CW
start angle := {START_ANGLE}
start angle := {START_ANGLE}
orbit := circular
orbit := circular
radius := {RADIUS}
radius := {RADIUS}
!
END OF INTERFILE :=
END OF INTERFILE :=
"""
"""
...
@@ -133,8 +131,7 @@ def forward_project(
...
@@ -133,8 +131,7 @@ def forward_project(
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
import
argparse
import
argparse
from
mu_map.file.dicom
import
load_dcm
from
mu_map.file
import
load_as_interfile
from
mu_map.file.dicom_to_interfile
import
to_interfile
parser
=
argparse
.
ArgumentParser
(
parser
=
argparse
.
ArgumentParser
(
description
=
"
Forward project a reconstruction with STIR
"
,
description
=
"
Forward project a reconstruction with STIR
"
,
...
@@ -179,11 +176,6 @@ if __name__ == "__main__":
...
@@ -179,11 +176,6 @@ if __name__ == "__main__":
stir
.
Verbosity_set
(
args
.
verbosity
)
stir
.
Verbosity_set
(
args
.
verbosity
)
_
,
ext
=
os
.
path
.
splitext
(
args
.
recon
)
header
,
image
=
load_as_interfile
(
args
.
recon
)
if
ext
==
"
.dcm
"
:
header
,
image
=
to_interfile
(
*
load_dcm
(
args
.
recon
))
else
:
header
,
image
=
load_interfile
(
args
.
recon
)
header
,
image
=
forward_project
(
header
,
image
,
**
vars
(
args
))
header
,
image
=
forward_project
(
header
,
image
,
**
vars
(
args
))
write_interfile
(
args
.
out
,
header
,
image
)
write_interfile
(
args
.
out
,
header
,
image
)
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