nanomesh.io

Functions:

load_vol(filename[, dtype, mmap_mode, shape])

Load data from .vol file.

read_info(filename)

Read volume metadata.

nanomesh.io.load_vol(filename: ~os.PathLike, dtype=<class 'numpy.float32'>, mmap_mode: ~typing.Optional[str] = None, shape: ~typing.Optional[tuple] = None) ndarray[source]

Load data from .vol file.

The image shape is deduced from the .vol.info file. If this file is not present, the shape can be specified using the shape keyword.

Parameters
  • filename (os.PathLike) – Path to the file.

  • dtype (dtype, optional) – Numpy dtype of the data.

  • mmap_mode (None, optional) – If not None, open the file using memory mapping. For more info on the modes, see: numpy.memmap()

  • shape (tuple, optional) – Tuple of three ints specifying the shape of the data (order: z, y, x).

Returns

result – Data stored in the file.

Return type

numpy.ndarray

nanomesh.io.read_info(filename: PathLike) dict[source]

Read volume metadata.

Parameters

filename (PathLike) – Path to the file.

Returns

dct – Dictionary with the metadata.

Return type

dict