tomwer.core.scan.scanbase.TomwerScanBase#

class tomwer.core.scan.scanbase.TomwerScanBase(overwrite_proc_file=False)#

Simple interface to extend the tomoscan.TomwerScanBase with specific functions

VALID_RECONS_EXTENSION = ('.edf', '.npy', '.npz', '.hdf5', '.tiff', '.jp2', '.vol')#
acquire_process_file_lock()#

create a FileLocker context manager to insure safe write to the process file

add_latest_reconstructions(urls)#
add_latest_vol_reconstructions(volume_identifiers)#
add_reconstruction_path(path)#
property axis_params#
clear_caches()#
clear_latest_reconstructions()#
clear_latest_vol_reconstructions()#
data_flat_field_correction(data, index=None)#

Apply flat field correction on the given data

Parameters:
  • data (numpy.ndarray) – the data to apply correction on

  • index (int | None) – index of the data in the acquisition sequence

Return type:

numpy.ndarray

Returns:

corrected data

equal(other)#
Parameters:

other – instance to compare with

Returns:

True if instance are equivalent

Note:

we cannot use the __eq__ function because this object need to be picklable

getReconstructedFilesFromParFile(with_index)#
get_nabu_dataset_info(binning=1, binning_z=1, proj_subsampling=1)#
Return type:

dict

Returns:

nabu dataset descriptor

get_normed_sinogram(line, subsampling=1)#

Util to get the sinogram normed with settings currently defined on the ‘intensity_normalization’ property

Parameters:
  • line (int) –

  • subsampling (int) –

Return type:

ndarray

Returns:

get_opposite_projections(mode)#

Return the two best opposite projections for the required mode.

Return type:

tuple

static get_process_file_name(scan)#
get_proj_angle_url(use_cache=True, *args, **kwargs)#

retrieve the url for each projections (including the alignment / return one) and associate to each (if possible) the angle. Alignment angle are set as angle (1) to specify that this is an alignment one. :type use_cache: bool :param use_cache: :rtype: dict[int | str, DataUrl] :return: dictionary with angle (str or int) as key and url as value

get_proposal_name()#
Return type:

str | None

static get_pyhst_recons_file(scanID)#

Return the .par file used for the current reconstruction if any. Otherwise return None

get_reconstructed_slices()#

Return a set of all the reconstructed slices that can be discovered for the scan (it will only look for reconstructed slices and not the volumes!!!!) slices are given as a string representing volume identifier

get_reconstructed_slices_from_path(path, check_url=False)#

Look for some reconstructed slices at a specific position slices are given as a string representing volume identifier

get_sinogram(line, subsampling=1, norm_method=None, **kwargs)#

extract the sinogram from projections

Parameters:
  • line (int) – which sinogram we want

  • subsampling (int) – subsampling to apply on the sinogram

Return type:

ndarray

Returns:

sinogram from the radio lines

get_url_proj_index(url)#

Return the index in the acquisition from the url

property latest_reconstructions#

List of latest slices reconstructions (as VolumeIdentifier) - single slice volume

property latest_vol_reconstructions#

List of latest volume reconstructions (as VolumeIdentifier)

load_from_dict(desc)#
property nabu_recons_params#
pop_process_index()#

Return and lock the next free process index

Return type:

int

property process_file: str#
Returns:

file used to store the processes launch by tomwer

property process_file_url: DataUrl#
Returns:

DataUrl of the process file

projections_with_angle()#
property reconstruction_paths#
property reconstructions#

list of reconstruction files

property sa_delta_beta_params#
property saaxis_params#
scan_basename()#

return basename of the directory containing the acquisition

Return type:

str | None

scan_dir_name()#

return name of the directory containing the acquisition

Return type:

str | None

scan_parent_dir_basename()#

return parent basename of the directory containing the acquisition

Return type:

str | None

set_latest_reconstructions(urls)#
set_latest_vol_reconstructions(volume_identifiers)#
set_process_index_frm_tomwer_process_file()#

Set the process_index to the last index find in the tomwer_process_file + 1

set_proposal_name(proposal_name)#
Return type:

None

to_dict()#
to_nabu_dataset_analyser()#

Return the equivalent DatasetAnalyzer for nabu

property working_directory: str | None#

working directory to use for this scan (for launching reconstruction for example)