nexusLIMS.extractors.plugins.tescan_tif#

Tescan (P)FIB/SEM TIFF extractor plugin.

Module Contents#

Classes#

TescanTiffExtractor

Extractor for Tescan FIB/SEM TIFF files.

Data#

TESCAN_TIFF_TAG

TIFF tag ID where Tescan stores INI-style metadata in TIFF files. The tag contains holds instrument configuration, beam parameters, stage position, detector settings, and other acquisition metadata.

API#

nexusLIMS.extractors.plugins.tescan_tif.TESCAN_TIFF_TAG#

50431

TIFF tag ID where Tescan stores INI-style metadata in TIFF files. The tag contains holds instrument configuration, beam parameters, stage position, detector settings, and other acquisition metadata.

class nexusLIMS.extractors.plugins.tescan_tif.TescanTiffExtractor[source]#

Extractor for Tescan FIB/SEM TIFF files.

This extractor handles metadata extraction from .tif files saved by Tescan FIB and SEM instruments (e.g., AMBER X). The extractor uses a two-tier strategy:

  1. Primary: Look for sidecar .hdr file with full metadata in INI format

  2. Fallback: Extract basic metadata from TIFF tags if no .hdr file exists

The .hdr file contains comprehensive acquisition parameters in two sections: [MAIN] and [SEM], which are parsed using Python’s configparser.

name#

‘tescan_tif_extractor’

priority#

150

supported_extensions#

Type: typing.ClassVar

supports(context: ExtractionContext) bool[source]#

Check if this extractor supports the given file.

Performs content sniffing to verify this is a Tescan TIFF file by:

  1. Checking file extension (.tif or .tiff)

  2. Looking for either a sidecar .hdr file or Tescan-specific TIFF tags

Parameters:

context – The extraction context containing file information

Returns:

True if this appears to be a Tescan TIFF file

Return type:

bool

extract(context: ExtractionContext) list[dict[str, Any]][source]#

Extract metadata from a Tescan FIB/SEM TIFF file.

Returns the metadata (as a list of dictionaries) from a .tif file saved by Tescan instruments. Uses a three-tier extraction strategy:

  1. Try to parse embedded HDR metadata from TIFF Tag 50431

  2. If that fails, look for a sidecar .hdr file

  3. Always extract basic TIFF tags as well

Parameters:

context – The extraction context containing file information

Returns:

List containing a single metadata dict with ‘nx_meta’ key

Return type:

list[dict]