Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RoboCT H5
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RoboCT (Public)
RoboCT H5
Commits
f1aaf509
Commit
f1aaf509
authored
1 week ago
by
Simon Wittl
Browse files
Options
Downloads
Patches
Plain Diff
added extract projection geometry
parent
5e9350bf
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pyproject.toml
+1
-1
1 addition, 1 deletion
pyproject.toml
src/h5schemas/load_utilities/projection_geometry.py
+37
-0
37 additions, 0 deletions
src/h5schemas/load_utilities/projection_geometry.py
with
38 additions
and
1 deletion
pyproject.toml
+
1
−
1
View file @
f1aaf509
[project]
name
=
"h5schemas"
version
=
"0.1.1
8
"
version
=
"0.1.1
9
"
description
=
"Add your description here"
readme
=
"README.md"
authors
=
[
...
...
This diff is collapsed.
Click to expand it.
src/h5schemas/load_utilities/projection_geometry.py
0 → 100644
+
37
−
0
View file @
f1aaf509
from
h5schemas.load_utilities.vectors
import
CommonVectors
,
extract_vector
from
h5py
import
Group
import
numpy
as
np
from
typing
import
NamedTuple
class
ProjectionGeometry
(
NamedTuple
):
detector_center_position_mm
:
np
.
ndarray
detector_center_orientation_quat
:
np
.
ndarray
focal_spot_position_mm
:
np
.
ndarray
focal_spot_orientation_quat
:
np
.
ndarray
uuid
:
np
.
ndarray
timestamp
:
np
.
ndarray
def
extract_projection_geometry
(
h5_group
:
Group
,
indices
:
slice
)
->
ProjectionGeometry
:
detector_center_position_mm
=
extract_vector
(
h5_group
[
'
detector_center_position_mm
'
],
indices
,
CommonVectors
.
XYZ
)
detector_center_orientation_quat
=
extract_vector
(
h5_group
[
'
detector_center_orientation_quat
'
],
indices
,
CommonVectors
.
QUAT
)
focal_spot_position_mm
=
extract_vector
(
h5_group
[
'
focal_spot_position_mm
'
],
indices
,
CommonVectors
.
XYZ
)
focal_spot_orientation_quat
=
extract_vector
(
h5_group
[
'
focal_spot_orientation_quat
'
],
indices
,
CommonVectors
.
QUAT
)
uuid
=
h5_group
[
'
header
'
][
'
uuid
'
][
indices
]
timestamp
=
h5_group
[
'
header
'
][
'
timestamp
'
][
indices
]
return
ProjectionGeometry
(
detector_center_position_mm
,
detector_center_orientation_quat
,
focal_spot_position_mm
,
focal_spot_orientation_quat
,
uuid
,
timestamp
)
if
__name__
==
'
__main__
'
:
from
h5py
import
File
test_file
=
File
(
"
./examples/projection_geometry.h5
"
,
"
r
"
)
proj_geom
=
extract_projection_geometry
(
test_file
,
slice
(
2
))
print
(
proj_geom
)
\ No newline at end of file
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