nabu.pipeline.helical.helical_chunked_regridded module

class nabu.pipeline.helical.helical_chunked_regridded.HelicalChunkedRegriddedPipeline(process_config, sub_region, logger=None, extra_options=None, phase_margin=None, reading_granularity=10, span_info=None)[source]

Bases: object

Pipeline for “helical” full or half field tomography. Data is processed by chunks. A chunk consists in K+-1 contiguous lines of all the radios which are read at variable height following the translations

Initialize a “HelicalChunked” pipeline.

Parameters:
  • process_config (nabu.resources.processcinfig.ProcessConfig) – Process configuration.

  • sub_region (tuple) – Sub-region to process in the volume for this worker, in the format (start_x, end_x, start_z, end_z).

  • logger (nabu.app.logger.Logger, optional) – Logger class

  • extra_options (dict, optional) – Advanced extra options.

  • phase_margin (tuple, optional) – Margin to use when performing phase retrieval, in the form ((up, down), (left, right)). See also the documentation of PaganinPhaseRetrieval. If not provided, no margin is applied.

  • reading_granularity (int) – The data angular span which needs to be read for a reconstruction is read step by step, reading each time a maximum of reading_granularity radios, and doing the preprocessing till phase retrieval for each of these angular groups

Notes

Using a phase_margin results in a lesser number of reconstructed slices. More specifically, if phase_margin = (V, H), then there will be chunk_size - 2*V reconstructed slices (if the sub-region is in the middle of the volume) or chunk_size - V reconstructed slices (if the sub-region is on top or bottom of the volume).

extra_marge_granularity = 4

This offers extra reading space to be able to read the redundant part which might be sligtly larger and or require extra border for interpolation

FlatFieldClass

alias of FlatFieldDataVariableRegionUrls

DoubleFlatFieldClass

alias of DoubleFlatFieldVariableRegion

CCDFilterClass

alias of CCDFilter

MLogClass

alias of Log

PaganinPhaseRetrievalClass

alias of PaganinPhaseRetrieval

UnsharpMaskClass

alias of UnsharpMask

VerticalShiftClass

alias of VerticalShift

SinoBuilderClass

alias of SinoBuilder

FBPClass = None
HBPClass = None
HistogramClass

alias of PartialHistogram

regular_accumulator = None
set_subregion(sub_region)[source]

Set a sub-region to process.

Parameters:

sub_region (tuple) – Sub-region to process in the volume, in the format (start_x, end_x, start_z, end_z) or (start_z, end_z).

property use_radio_processing_margin
property phase_margin

Return the margin for phase retrieval in the form ((up, down), (left, right))

register_callback(step_name, callback)[source]

Register a callback for a pipeline processing step.

Parameters:
  • step_name (str) – processing step name

  • callback (callable) – A function. It will be executed once the processing step step_name is finished. The function takes only one argument: the class instance.

binning_expanded(region)[source]
balance_weights()[source]
reset_translation_diagnostics_accumulators()[source]
process_chunk(sub_region=None)[source]
apply_weights(i_slice)[source]

radios_slim is on gpu

classmethod estimate_required_memory(process_config, reading_granularity=None, chunk_size=None, margin_v=0, span_info=None)[source]

Estimate the memory (RAM) needed for a reconstruction.

Parameters:
  • process_config (ProcessConfig object) – Data structure with the processing configuration

  • chunk_size (int, optional) – Size of a “radios chunk”, i.e “delta z”. A radios chunk is a 3D array of shape (n_angles, chunk_size, n_x) If set to None, then chunk_size = n_z

Notes

It seems that Cuda does not allow allocating and/or transferring more than 16384 MiB (17.18 GB). If warn_from_GB is not None, then the result is in the form (estimated_memory_GB, warning) where warning is a boolean indicating wheher memory allocation/transfer might be problematic.

nabu.pipeline.helical.helical_chunked_regridded.overlap_logic(subr_start_z, subr_end_z, dtasrc_start_z, dtasrc_end_z)[source]

determines the useful lines which can be transferred from the dtasrc_start_z:dtasrc_end_z range targeting the range subr_start_z: subr_end_z ………………

nabu.pipeline.helical.helical_chunked_regridded.padding_logic(subr_start_z, subr_end_z, dtasrc_start_z, dtasrc_end_z)[source]

………. and the missing ranges which possibly could be obtained by extension padding

nabu.pipeline.helical.helical_chunked_regridded.shift(arr, shift, fill_value=0.0)[source]

trivial horizontal shift. Contrarily to scipy.ndimage.interpolation.shift, this shift does not cut the tails abruptly, but by interpolation

nabu.pipeline.helical.helical_chunked_regridded.rebalance(radios_weights, angles, ax_pos)[source]

rebalance the weights, within groups of equivalent (up to multiple of 180), data pixels