Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aRTist API
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)
aRTist API
Commits
f4d9dd7a
Commit
f4d9dd7a
authored
2 weeks ago
by
Simon Wittl
Browse files
Options
Downloads
Patches
Plain Diff
added fly by example
parent
eae0f83f
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+2
-1
2 additions, 1 deletion
.gitignore
examples/06_linear_fly_by_h5.py
+53
-0
53 additions, 0 deletions
examples/06_linear_fly_by_h5.py
pyproject.toml
+1
-0
1 addition, 0 deletions
pyproject.toml
uv.lock
+30
-7
30 additions, 7 deletions
uv.lock
with
86 additions
and
8 deletions
.gitignore
+
2
−
1
View file @
f4d9dd7a
...
...
@@ -11,4 +11,5 @@ dist
*.aRTist
*.ply
/build/
/examples/
\ No newline at end of file
/examples/
/temp/
\ No newline at end of file
This diff is collapsed.
Click to expand it.
examples/06_linear_fly_by_h5.py
0 → 100644
+
53
−
0
View file @
f4d9dd7a
import
h5py
import
numpy
as
np
from
artist_pythonlib
import
API
from
tqdm
import
tqdm
from
h5schemas.projection_geometry.overwrite_projection_geometry
import
overwrite_projection_geometry_at_index
FOD
=
1000.
FDD
=
2000.
DISTANCE
=
20
DELTA
=
0.01
def
set_source_detector
(
api
:
API
,
z
:
float
):
api
.
translate
(
'
S
'
,
0.
,
FOD
,
z
)
api
.
translate
(
'
D
'
,
0.
,
FOD
-
FDD
,
z
)
api
.
rotate
(
'
D
'
,
90
,
0
,
0
)
def
add_error
(
api
:
API
,
error_source
,
error_detector
):
error_source
+=
(
np
.
random
.
random
(
3
)
-
0.5
)
*
2
*
0.01
error_detector
+=
(
np
.
random
.
random
(
3
)
-
0.5
)
*
2
*
0.01
source
=
api
.
get_position
(
'
S
'
)
api
.
translate
(
'
S
'
,
*
(
source
+
error_source
))
detector
=
api
.
get_position
(
'
D
'
)
api
.
translate
(
'
D
'
,
*
(
detector
+
error_detector
))
return
error_source
,
error_detector
def
main
():
file
=
h5py
.
File
(
'
./temp/fly_by_linear.h5
'
,
'
a
'
)
api
=
API
()
error_source
,
error_detector
=
np
.
zeros
((
3
,)),
np
.
ones
((
3
,))
z_steps
=
np
.
linspace
(
-
DISTANCE
/
2
,
DISTANCE
/
2
,
int
(
DISTANCE
/
DELTA
))
for
i
in
tqdm
(
range
(
z_steps
.
shape
[
0
])):
z
=
z_steps
[
i
]
set_source_detector
(
api
,
z
)
error_source
,
error_detector
=
add_error
(
api
,
error_source
,
error_detector
)
api
.
save_hdf5
(
file
)
overwrite_projection_geometry_at_index
(
file
[
'
projection_geometry_nominal
'
],
i
,
[
0.
,
FOD
-
FDD
,
z
],
api
.
get_orientation
(
'
D
'
),
[
0.
,
FOD
,
z
],
api
.
get_orientation
(
'
S
'
))
if
__name__
==
'
__main__
'
:
main
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pyproject.toml
+
1
−
0
View file @
f4d9dd7a
...
...
@@ -14,6 +14,7 @@ dependencies = [
"pillow>
=
10.0
",
"scipy>
=
1.10
",
"thd-json>
=
0.1
.
11
",
"tqdm>
=
4.67
.
1
",
"xraydb>
=
4.5
.
4
",
]
...
...
This diff is collapsed.
Click to expand it.
uv.lock
+
30
−
7
View file @
f4d9dd7a
...
...
@@ -12,6 +12,7 @@ dependencies = [
{ name = "pillow" },
{ name = "scipy" },
{ name = "thd-json" },
{ name = "tqdm" },
{ name = "xraydb" },
]
...
...
@@ -29,6 +30,7 @@ requires-dist = [
{ name = "scipy", specifier = ">=1.10" },
{ name = "thd-json", git = "https://mygit.th-deg.de/roboct-public/roboct-schemas" },
{ name = "thd-json", marker = "extra == 'thd'", git = "https://mygit.th-deg.de/roboct-public/roboct-schemas" },
{ name = "tqdm", specifier = ">=4.67.1" },
{ name = "xraydb", specifier = ">=4.5.4" },
]
...
...
@@ -41,6 +43,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/77/06/bb80f5f86020c4551da315d78b3ab75e8228f89f0162f2c3a819e407941a/attrs-25.3.0-py3-none-any.whl", hash = "sha256:427318ce031701fea540783410126f03899a97ffc6f61596ad581ac2e40e3bc3", size = 63815 },
]
[[package]]
name = "colorama"
version = "0.4.6"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 },
]
[[package]]
name = "contourpy"
version = "1.3.1"
...
...
@@ -248,8 +259,8 @@ wheels = [
[[package]]
name = "h5schemas"
version = "0.1.
0
"
source = { git = "https://mygit.th-deg.de/roboct-public/roboct-h5#
3624c61163e3230bd2ac42884aa7b39d2cfcd
eb8" }
version = "0.1.
17
"
source = { git = "https://mygit.th-deg.de/roboct-public/roboct-h5#
4dda0165c77752ea0fdeb38b61c8c9abbd8
eb8
57
" }
dependencies = [
{ name = "h5py" },
{ name = "jsonref" },
...
...
@@ -274,16 +285,16 @@ wheels = [
[[package]]
name = "hypothesis"
version = "6.1
29.4
"
version = "6.1
30.0
"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "attrs" },
{ name = "exceptiongroup", marker = "python_full_version < '3.11'" },
{ name = "sortedcontainers" },
]
sdist = { url = "https://files.pythonhosted.org/packages/
bb/98/0051e770d36f7e0a55bcfa3590790448d57ed2f355da9adbb957b1f545d9
/hypothesis-6.1
29.4
.tar.gz", hash = "sha256:
e9fd66c25b8f0aa6395ce6728360892c3af22529cc16cae7512a4672776d4781
", size = 425
235
}
sdist = { url = "https://files.pythonhosted.org/packages/
25/01/3cca6316aaa0474e109f93c8fda2a31c23de92d86f4826f79ea0c0e6d011
/hypothesis-6.1
30.0
.tar.gz", hash = "sha256:
274050b4518611500a55f7a5d0247a5359dce0107cb20f10323d6b587cc522d2
", size = 425
943
}
wheels = [
{ url = "https://files.pythonhosted.org/packages/
8d/7c/7266143385cbd19c839f9b61cc660d74c5ce2626fea41d8b215ccc5cfba3
/hypothesis-6.1
29.4
-py3-none-any.whl", hash = "sha256:
45a31fe2b936688b2954f375c7f87e9dfefa4f2cddfa31cdeba15
d7
7
60
0e1286
", size = 4
89542
},
{ url = "https://files.pythonhosted.org/packages/
46/2b/638b52450e44d83230a12b1dd366c1c5c315b171432d4b1e8213e0cb5e04
/hypothesis-6.1
30.0
-py3-none-any.whl", hash = "sha256:
b75e6fc4738d2e2a1b75d151432cb06e1303de3142905c
d7
0
60
ba293c18376ce
", size = 4
90230
},
]
[[package]]
...
...
@@ -871,8 +882,8 @@ wheels = [
[[package]]
name = "thd-json"
version = "0.1.1
1
"
source = { git = "https://mygit.th-deg.de/roboct-public/roboct-schemas#
549627970741441756a671333ac8e5f949241eb3
" }
version = "0.1.1
3
"
source = { git = "https://mygit.th-deg.de/roboct-public/roboct-schemas#
0f378205d14a78c744808eba8b5523e9ed2d075f
" }
dependencies = [
{ name = "hatchling" },
{ name = "hypothesis" },
...
...
@@ -923,6 +934,18 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/6e/c2/61d3e0f47e2b74ef40a68b9e6ad5984f6241a942f7cd3bbfbdbd03861ea9/tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc", size = 14257 },
]
[[package]]
name = "tqdm"
version = "4.67.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "colorama", marker = "platform_system == 'Windows'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/a8/4b/29b4ef32e036bb34e4ab51796dd745cdba7ed47ad142a9f4a1eb8e0c744d/tqdm-4.67.1.tar.gz", hash = "sha256:f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2", size = 169737 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/d0/30/dc54f88dd4a2b5dc8a0279bdd7270e735851848b762aeb1c1184ed1f6b14/tqdm-4.67.1-py3-none-any.whl", hash = "sha256:26445eca388f82e72884e0d580d5464cd801a3ea01e63e5601bdff9ba6a48de2", size = 78540 },
]
[[package]]
name = "trove-classifiers"
version = "2025.3.19.19"
...
...
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