extraction.core.extractor.ExtractorParameters¶
- class ExtractorParameters(tree, sub_bg={}, multichannel_ops={})[source]¶
Bases:
ParametersABC
Base class to define parameters for extraction.
Methods
from_yaml
(source)Returns instance from a yaml filename or stdin
guess_from_meta
(store_name[, suffix])Find the microscope used from the h5 metadata.
to_dict
([iterable])Recursive function to return a nested dictionary of the attributes of the class instance.
to_yaml
([path])Returns a yaml stream of the attributes of the class instance.
update
(name, new_value)Update values recursively if name is a dictionary, replace data where existing found or add if not.
default
from_dict
from_meta
- Parameters
- tree: dict
Nested dictionary indicating channels, reduction functions and metrics to be used. str channel -> U(function,None) reduction -> str metric If not of depth three, tree will be filled with None.
- sub_bg: set
- multichannel_ops: dict
Methods
from_yaml
(source)Returns instance from a yaml filename or stdin
guess_from_meta
(store_name[, suffix])Find the microscope used from the h5 metadata.
to_dict
([iterable])Recursive function to return a nested dictionary of the attributes of the class instance.
to_yaml
([path])Returns a yaml stream of the attributes of the class instance.
update
(name, new_value)Update values recursively if name is a dictionary, replace data where existing found or add if not.
default
from_dict
from_meta
- __init__(tree, sub_bg={}, multichannel_ops={})[source]¶
- Parameters
- tree: dict
Nested dictionary indicating channels, reduction functions and metrics to be used. str channel -> U(function,None) reduction -> str metric If not of depth three, tree will be filled with None.
- sub_bg: set
- multichannel_ops: dict
Methods
__init__
(tree[, sub_bg, multichannel_ops])- Parameters
default
()from_dict
(d)from_meta
(meta)from_yaml
(source)Returns instance from a yaml filename or stdin
guess_from_meta
(store_name[, suffix])Find the microscope used from the h5 metadata.
to_dict
([iterable])Recursive function to return a nested dictionary of the attributes of the class instance.
to_yaml
([path])Returns a yaml stream of the attributes of the class instance.
update
(name, new_value)Update values recursively if name is a dictionary, replace data where existing found or add if not.
- classmethod from_yaml(source)¶
Returns instance from a yaml filename or stdin
- static guess_from_meta(store_name, suffix='fast')[source]¶
Find the microscope used from the h5 metadata.
- Parameters
- store_namestr or Path
For a h5 file
- suffixstr
Added at the end of the predicted parameter set
- to_dict(iterable='null')¶
Recursive function to return a nested dictionary of the attributes of the class instance.
- Return type
Dict
- to_yaml(path=None)¶
Returns a yaml stream of the attributes of the class instance. If path is provided, the yaml stream is saved there.
- Parameters
- pathUnion[PosixPath, str]
Output path.
- update(name, new_value)¶
Update values recursively if name is a dictionary, replace data where existing found or add if not. It warns against type changes.
If the existing structure under name is a dictionary, it looks for the first occurrence and modifies it accordingly.
If a leaf node that is to be changed is a collection, it adds the new elements.