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 (Uion[int, None]) – index of the data in the acquisition sequence

Returns:

corrected data

Return type:

numpy.ndarray

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 pickable

getReconsParamList()#
Returns:

reconstruction parameters

Return type:

ReconsParamList

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

nabu dataset descriptor

Return type:

dict

get_normed_sinogram(line, subsampling=1)#

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

Parameters:
  • line

  • subsampling

Returns:

get_opposite_projections(mode)#

Return the radios for axis calculation and the requested mode.

Param:

angles we want to use for COR calculation. Can be 0-180, 90-180 or manual. If manual will return the ‘most’ appropriate

Type:

CorAngleMode

Parameters:

nearest – if True then, pick the closest angle from the requested one. If False, return (None, None) if the the angles does not exists.

Type:

bool

Returns:

couple of opposite radios that can be used for axis calculation.

Return type:

tuple(Optional[AxisResource], Optional[AxisResource])

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

retrieve the url for each projections (including the alignement / 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. :param bool use_cache: :return: dictionary with angle (str or int) as key and url as value :rtype: dict

get_proposal_name()#
Return type:

Optional[str]

static get_pyhst_recons_file(scanID)#

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

get_reconstructions_urls()#
Returns:

list of urls that contains reconstruction from nabu

Return type:

list

get_reconstructions_urls_from_path(path, check_url=False)#
get_sinogram(line, subsampling=1, norm_method=None, **kwargs)#

extract the sinogram from projections

Parameters:
  • line – which sinogram we want

  • subsampling – subsampling to apply on the sinogram

Type:

int

Returns:

sinogram from the radio lines

Return type:

numpy.array

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:

Optional[str]

scan_dir_name()#

return name of the directory containing the acquisition

Return type:

Optional[str]

scan_parent_dir_basename()#

return parent basename of the directory containing the acquisition

Return type:

Optional[str]

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)