Commit 39b00ef6 authored by Pierre Paleo's avatar Pierre Paleo
Browse files

Extend base class method arguments

parent d82c8a66
Pipeline #26897 passed with stages
in 4 minutes and 8 seconds
......@@ -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")
......
......@@ -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()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment