tomoscan.factory.Factory#

class tomoscan.factory.Factory#

Bases: object

Factory any TomoObject

__init__()#

Methods

__init__()

create_scan_object(scan_path[, entry])

type scan_path:

str

create_scan_object_frm_dict(_dict)

Create a TomoScanBase instance from a dictionary.

create_scan_objects(scan_path)

type scan_path:

str

create_tomo_object_from_identifier(identifier)

Create an instance of TomoScanBase from his identifier if possible

is_tomoscan_dir(scan_path)

type scan_path:

str

static create_scan_object(scan_path, entry=None)#
Parameters:

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

Return type:

TomoScanBase

Returns:

ScanBase instance fitting the scan folder or scan path

static create_scan_object_frm_dict(_dict)#

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

Parameters:

_dict (dict) – dictionary to be converted

Return type:

TomoScanBase

Returns:

instance of TomoScanBase

static create_scan_objects(scan_path)#
Parameters:

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

Return type:

tuple

Returns:

all possible instances of TomoScanBase contained in the given path

static create_tomo_object_from_identifier(identifier)#

Create an instance of TomoScanBase from his identifier if possible

Parameters:

identifier (str | ScanIdentifier) – 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

Return type:

TomoObject

static is_tomoscan_dir(scan_path)#
Parameters:

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

Return type:

bool

Returns:

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