tomoscan.factory.Factory

class tomoscan.factory.Factory

Bases: object

Factory any TomoObject

__init__()

Methods

__init__()

create_scan_object(scan_path[, entry])

param str scan_path:

path to the scan directory or file

create_scan_object_frm_dict(_dict)

Create a TomoScanBase instance from a dictionary.

create_scan_objects(scan_path)

param str scan_path:

path to the scan directory or file

create_tomo_object_from_identifier(identifier)

Create an instance of TomoScanBase from his identifier if possible

is_tomoscan_dir(scan_path)

param str scan_path:

path to the scan directory or file

static create_scan_object(scan_path: str, entry: Optional[str] = None) TomoScanBase
Parameters:

scan_path (str) – path to the scan directory or file

Returns:

ScanBase instance fitting the scan folder or scan path

Return type:

TomoScanBase

static create_scan_object_frm_dict(_dict: dict) TomoScanBase

Create a TomoScanBase instance from a dictionary. It should contains the TomoScanBase._DICT_TYPE_KEY key at least.

Parameters:

_dict – dictionary to be converted

Returns:

instance of TomoScanBase

Return type:

TomoScanBase

static create_scan_objects(scan_path: str) tuple
Parameters:

scan_path (str) – path to the scan directory or file

Returns:

all possible instances of TomoScanBase contained in the given path

Return type:

tuple

static create_tomo_object_from_identifier(identifier: Union[str, ScanIdentifier]) TomoObject

Create an instance of TomoScanBase from his identifier if possible

Parameters:

identifier (str) – identifier of the TomoScanBase

Raises:

TypeError if identifier is not a str

Raises:

ValueError if identifier cannot be converted back to an instance of TomoScanBase

static is_tomoscan_dir(scan_path: str) bool
Parameters:

scan_path (str) – path to the scan directory or file

Returns:

True if the given path is a root folder of an acquisition.

Return type:

bool