pystack3d.utils_metadata_fibics module

utilities functions to extract metadata from FIB-SEM acquisitions in the .a3d-setup parameters file and a .tif file (corresponding to the first slice)

pystack3d.utils_metadata_fibics.params_from_metadata(stack_dir, fname_toml_ref=None, save=False, verbosity=True)

Return processing parameters for a 3D FIB-SEM acquisition from metadata extracted from raw data directory

Parameters:
  • stack_dir (Path or str) – Pathname of the acquisition folder. Must contain the Atlas3D.a3d-setup file and slices as TIF in subdirectories for each channel

  • fname_toml_ref (Path or str, optional) – Pathname of the .toml file taken as reference for the parameters file. If None, consider the RAW params.toml located in the ‘assets’ folder

  • save (bool, optional) – Key to save a ‘params_from_metadata.toml’ in the ‘stack_dir’

  • verbosity (bool, optional, default True) – Activation key for verbosity displaying

Returns:

params – Dictionary with parameters for the Stack3d FIB-SEM data processing

Return type:

dict

pystack3d.utils_metadata_fibics.currents_from_metadata(fnames)

Return currents from metadata

Parameters:

fnames (list of n-str) – List of the ‘.tif’ filenames

Returns:

currents – Currents values extracted from the metadata

Return type:

np.ndarray((n))

pystack3d.utils_metadata_fibics.read_tags(fname, print_tags=False, fname_xml=None, encoding='iso-8859-1')

Extract metadata from an image made with fibics Atlas Engine

Parameters:
  • fname (Path or str) – Pathname of the .tif file (or parameter file) to read metadata from

  • print_tags (Bool, optional) – key to control metadata print as they are read. Default False

  • fname_xml (Path or str, optional) – Pathname to save the resulting xml tags file

  • encoding (str, optional) – encoding of the file to read

Returns:

ETroot

Return type:

root of the ElementTree object resulting from the xml parsing

pystack3d.utils_metadata_fibics.param_from_xml_ETroot(param_name, ETroot_from_xml, full_output=False)

Extract a parameter from a lxml.Element object using the xpath of the parameters stored in a predefined dictionary.

Parameters:
  • param_name (str) – Name of the parameter to extract as defined in the dictionnaries in this function

  • ETroot_from_xml (lxml.Element object) – lxml.Element object parsed from an xml string or file as returned by read_tags()

  • full_output (bool, optional) – Activation key to return value AND tag

Returns:

  • value (str) – Value of the parameter (as a string)

  • tag (str, optional) – Parameter name in the original XML (if full_output is True)