playnano.io.formats.read_spm_folder module

Placeholder for a functional script to load a folder containing .spm frames.

playnano.io.formats.read_spm_folder.load_spm_folder(folder_path: Path | str, channel: str) AFMImageStack[source]

Load an AFM video from a folder of individual .spm image files.

Parameters:
  • folder_path (Path | str) – Path to folder containing .spm files.

  • channel (str) – Channel to extract.

Returns:

Loaded AFM image stack with metadata and per-frame info.

Return type:

AFMImageStack

playnano.io.formats.read_spm_folder.parse_spm_header(file_path, max_bytes=65536)[source]

Extract ASCII header key-value pairs from a .spm file.

Parameters:
  • file_path (str or Path) – Path to the .spm file.

  • max_bytes (int) – Number of bytes to read from the start of the file. Default is 65536.

Returns:

Mapping of header keys to values as strings.

Return type:

dict