Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tomotools
Nabu
Commits
39b00ef6
Commit
39b00ef6
authored
Jun 08, 2020
by
Pierre Paleo
Browse files
Extend base class method arguments
parent
d82c8a66
Pipeline
#26897
passed with stages
in 4 minutes and 8 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nabu/app/fullfield.py
View file @
39b00ef6
...
...
@@ -224,11 +224,13 @@ class FullFieldPipeline:
self
.
_init_reader_finalize
()
@
use_options
(
"flatfield"
,
"flatfield"
)
def
_init_flatfield
(
self
):
def
_init_flatfield
(
self
,
shape
=
None
):
if
shape
is
None
:
shape
=
self
.
radios_shape
options
=
self
.
processing_options
[
"flatfield"
]
# FlatField parameter "radios_indices" must account for subsampling
self
.
flatfield
=
self
.
FlatFieldClass
(
self
.
radios_
shape
,
shape
,
flats
=
self
.
dataset_infos
.
flats
,
darks
=
self
.
dataset_infos
.
darks
,
radios_indices
=
options
[
"projs_indices"
],
...
...
@@ -443,10 +445,12 @@ class FullFieldPipeline:
)
@
pipeline_step
(
"reconstruction"
,
"Reconstruction"
)
def
_reconstruct
(
self
):
for
i
in
range
(
self
.
sinos
.
shape
[
0
]):
def
_reconstruct
(
self
,
sinos
=
None
):
if
sinos
is
None
:
sinos
=
self
.
sinos
for
i
in
range
(
sinos
.
shape
[
0
]):
self
.
reconstruction
.
fbp
(
self
.
sinos
[
i
],
output
=
self
.
recs
[
i
]
sinos
[
i
],
output
=
self
.
recs
[
i
]
)
@
pipeline_step
(
"writer"
,
"Saving data"
)
...
...
nabu/app/fullfield_cuda.py
View file @
39b00ef6
...
...
@@ -241,6 +241,7 @@ class CudaFullFieldPipelineLimitedMemory(CudaFullFieldPipeline):
self
.
_retrieve_phase
()
self
.
_apply_unsharp
()
self
.
_take_log
()
self
.
radios
=
self
.
_old_radios
# Copy D2H
self
.
_d_radios
[:
transfer_size
,
:,
:].
get
(
ary
=
self
.
_h_radios
[
start_idx
:
end_idx
])
self
.
logger
.
debug
(
"End of processing steps on radios"
)
...
...
@@ -279,7 +280,7 @@ class CudaFullFieldPipelineLimitedMemory(CudaFullFieldPipeline):
# Copy H2D
self
.
_d_sinos
[:,
:,
:]
=
self
.
_sinobuilder_output
[:,
:,
:]
# Process stack of sinograms (chunk_size, n_angles, width)
self
.
_reconstruct
()
self
.
_reconstruct
(
sinos
=
self
.
_d_sinos
)
# Copy D2H
self
.
_d_recs
.
get
(
ary
=
self
.
_h_recs
[
start_idx
:
end_idx
])
self
.
logger
.
debug
(
"End of processing steps on sinos"
)
...
...
@@ -292,3 +293,5 @@ class CudaFullFieldPipelineLimitedMemory(CudaFullFieldPipeline):
self
.
_process_chunk_ccd
()
self
.
_process_chunk_sinos
()
self
.
_process_finalize
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment