Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pyronn-torch
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
Model registry
Operate
Environments
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephan Seitz
pyronn-torch
Commits
d19a094f
Commit
d19a094f
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Add parallel beam projectors
parent
fc396cfd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
codegen/generate_wrappers.py
+50
-4
50 additions, 4 deletions
codegen/generate_wrappers.py
with
50 additions
and
4 deletions
codegen/generate_wrappers.py
+
50
−
4
View file @
d19a094f
...
@@ -26,10 +26,13 @@ from pystencils_autodiff.framework_integration.printer import \
...
@@ -26,10 +26,13 @@ from pystencils_autodiff.framework_integration.printer import \
FrameworkIntegrationPrinter
FrameworkIntegrationPrinter
volume
=
pystencils
.
fields
(
'
volume: float32[3d]
'
)
volume
=
pystencils
.
fields
(
'
volume: float32[3d]
'
)
projection
=
pystencils
.
fields
(
'
projection: float32[
2
d]
'
)
projection
=
pystencils
.
fields
(
'
projection: float32[
3
d]
'
)
projection_matrices
=
pystencils
.
fields
(
'
matrices: float32[3d]
'
)
projection_matrices
=
pystencils
.
fields
(
'
matrices: float32[3d]
'
)
inv_matrices
=
pystencils
.
fields
(
'
inv_matrices: float32[3d]
'
)
inv_matrices
=
pystencils
.
fields
(
'
inv_matrices: float32[3d]
'
)
source_points
=
pystencils
.
fields
(
'
source_points: float32[1d]
'
)
source_points
=
pystencils
.
fields
(
'
source_points: float32[1d]
'
)
volume_slice
=
pystencils
.
fields
(
'
volume_slice: float32[2d]
'
)
projections_1d
=
pystencils
.
fields
(
'
projections_1d: float32[2d]
'
)
ray_vectors
=
pystencils
.
fields
(
'
ray_vectors: float32[2d]
'
)
FUNCTIONS
=
{
FUNCTIONS
=
{
'
Cone_Backprojection3D_Kernel_Launcher
'
:
CustomFunctionCall
(
'
Cone_Backprojection3D_Kernel_Launcher
'
,
'
Cone_Backprojection3D_Kernel_Launcher
'
:
CustomFunctionCall
(
'
Cone_Backprojection3D_Kernel_Launcher
'
,
...
@@ -45,7 +48,7 @@ FUNCTIONS = {
...
@@ -45,7 +48,7 @@ FUNCTIONS = {
TypedSymbol
(
'
volume_origin_x
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_origin_x
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_origin_y
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_origin_y
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_origin_z
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_origin_z
'
,
create_type
(
'
float32
'
),
const
=
True
),
*
[
FieldShapeSymbol
([
'
projection
'
],
i
)
for
i
in
range
(
1
,
-
1
,
-
1
)],
*
[
FieldShapeSymbol
([
'
projection
'
],
i
)
for
i
in
range
(
2
,
0
,
-
1
)],
TypedSymbol
(
'
projection_multiplier
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
projection_multiplier
'
,
create_type
(
'
float32
'
),
const
=
True
),
fields_accessed
=
[
volume
,
projection
,
projection_matrices
],
custom_signature
=
"""
fields_accessed
=
[
volume
,
projection
,
projection_matrices
],
custom_signature
=
"""
void Cone_Backprojection3D_Kernel_Launcher(const float *sinogram_ptr, float *out, const float *projection_matrices, const int number_of_projections,
void Cone_Backprojection3D_Kernel_Launcher(const float *sinogram_ptr, float *out, const float *projection_matrices, const int number_of_projections,
...
@@ -66,7 +69,7 @@ void Cone_Backprojection3D_Kernel_Launcher(const float *sinogram_ptr, float *out
...
@@ -66,7 +69,7 @@ void Cone_Backprojection3D_Kernel_Launcher(const float *sinogram_ptr, float *out
TypedSymbol
(
'
volume_spacing_x
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_spacing_x
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_spacing_y
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_spacing_y
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_spacing_z
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_spacing_z
'
,
create_type
(
'
float32
'
),
const
=
True
),
*
[
FieldShapeSymbol
([
'
projection
'
],
i
)
for
i
in
range
(
1
,
-
1
,
-
1
)],
*
[
FieldShapeSymbol
([
'
projection
'
],
i
)
for
i
in
range
(
2
,
0
,
-
1
)],
TypedSymbol
(
'
step_size
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
step_size
'
,
create_type
(
'
float32
'
),
const
=
True
),
fields_accessed
=
[
volume
,
projection
,
inv_matrices
,
source_points
],
custom_signature
=
"""
fields_accessed
=
[
volume
,
projection
,
inv_matrices
,
source_points
],
custom_signature
=
"""
void Cone_Projection_Kernel_Launcher(const float* volume_ptr, float *out, const float *inv_AR_matrix, const float *src_points,
void Cone_Projection_Kernel_Launcher(const float* volume_ptr, float *out, const float *inv_AR_matrix, const float *src_points,
...
@@ -86,7 +89,7 @@ void Cone_Projection_Kernel_Launcher(const float* volume_ptr, float *out, const
...
@@ -86,7 +89,7 @@ void Cone_Projection_Kernel_Launcher(const float* volume_ptr, float *out, const
TypedSymbol
(
'
volume_spacing_x
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_spacing_x
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_spacing_y
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_spacing_y
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_spacing_z
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_spacing_z
'
,
create_type
(
'
float32
'
),
const
=
True
),
*
[
FieldShapeSymbol
([
'
projection
'
],
i
)
for
i
in
range
(
1
,
-
1
,
-
1
)],
*
[
FieldShapeSymbol
([
'
projection
'
],
i
)
for
i
in
range
(
2
,
0
,
-
1
)],
TypedSymbol
(
'
step_size
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
step_size
'
,
create_type
(
'
float32
'
),
const
=
True
),
fields_accessed
=
[
volume
,
projection
,
inv_matrices
,
source_points
],
custom_signature
=
"""
fields_accessed
=
[
volume
,
projection
,
inv_matrices
,
source_points
],
custom_signature
=
"""
void Cone_Projection_Kernel_Tex_Interp_Launcher(
void Cone_Projection_Kernel_Tex_Interp_Launcher(
...
@@ -97,6 +100,49 @@ void Cone_Projection_Kernel_Tex_Interp_Launcher(
...
@@ -97,6 +100,49 @@ void Cone_Projection_Kernel_Tex_Interp_Launcher(
const float volume_spacing_x, const float volume_spacing_y,
const float volume_spacing_x, const float volume_spacing_y,
const float volume_spacing_z, const int detector_width,
const float volume_spacing_z, const int detector_width,
const int detector_height, const float step_size);
"""
),
# noqa
const int detector_height, const float step_size);
"""
),
# noqa
'
Parallel_Projection2D_Kernel_Launcher
'
:
CustomFunctionCall
(
'
Parallel_Projection2D_Kernel_Launcher
'
,
FieldPointerSymbol
(
volume_slice
.
name
,
volume_slice
.
dtype
,
const
=
True
),
FieldPointerSymbol
(
projections_1d
.
name
,
projections_1d
.
dtype
,
const
=
False
),
FieldPointerSymbol
(
ray_vectors
.
name
,
ray_vectors
.
dtype
,
const
=
True
),
FieldShapeSymbol
([
ray_vectors
.
name
],
0
),
*
[
FieldShapeSymbol
([
'
volume_slice
'
],
i
)
for
i
in
range
(
1
,
-
1
,
-
1
)],
TypedSymbol
(
'
volume_spacing_x
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_spacing_y
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_origin_x
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_origin_y
'
,
create_type
(
'
float32
'
),
const
=
True
),
FieldShapeSymbol
([
projections_1d
.
name
],
1
),
TypedSymbol
(
'
detector_spacing
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
detector_origin
'
,
create_type
(
'
float32
'
),
const
=
True
),
fields_accessed
=
[
volume_slice
,
projections_1d
,
ray_vectors
],
custom_signature
=
"""
void Parallel_Projection2D_Kernel_Launcher(
const float *volume_ptr, float *out, const float *ray_vectors,
const int number_of_projections, const int volume_width,
const int volume_height, const float volume_spacing_x,
const float volume_spacing_y, const float volume_origin_x,
const float volume_origin_y, const int detector_size,
const float detector_spacing, const float detector_origin);
"""
),
# noqa
'
Parallel_Backprojection2D_Kernel_Launcher
'
:
CustomFunctionCall
(
'
Parallel_Backprojection2D_Kernel_Launcher
'
,
FieldPointerSymbol
(
projections_1d
.
name
,
projections_1d
.
dtype
,
const
=
True
),
FieldPointerSymbol
(
volume_slice
.
name
,
volume_slice
.
dtype
,
const
=
False
),
FieldPointerSymbol
(
ray_vectors
.
name
,
ray_vectors
.
dtype
,
const
=
True
),
FieldShapeSymbol
([
ray_vectors
.
name
],
0
),
*
[
FieldShapeSymbol
([
'
volume_slice
'
],
i
)
for
i
in
range
(
1
,
-
1
,
-
1
)],
TypedSymbol
(
'
volume_spacing_x
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_spacing_y
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_origin_x
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
volume_origin_y
'
,
create_type
(
'
float32
'
),
const
=
True
),
FieldShapeSymbol
([
projections_1d
.
name
],
1
),
TypedSymbol
(
'
detector_spacing
'
,
create_type
(
'
float32
'
),
const
=
True
),
TypedSymbol
(
'
detector_origin
'
,
create_type
(
'
float32
'
),
const
=
True
),
fields_accessed
=
[
volume_slice
,
projections_1d
,
ray_vectors
],
custom_signature
=
"""
void Parallel_Backprojection2D_Kernel_Launcher(const float *sinogram_ptr, float *out, const float *ray_vectors, const int number_of_projections,
const int volume_width, const int volume_height, const float volume_spacing_x, const float volume_spacing_y,
const float volume_origin_x, const float volume_origin_y,
const int detector_size, const float detector_spacing, const float detector_origin);
"""
),
# noqa
}
}
...
...
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