Parser for Transformation Matrices

class TransformParser.TransformParser[source]

A class to read and save transformation matrices

load_matrix(matrixname, mmap_mode=None)[source]

Load an array(s) from .npy, .npz

Arguments:

matrixname:
.npy matrix If the filename extension is .gz, the file is first decompressed (see numpy.load for more information)
mmap_mode:

default None (memory-map the file) It can be set with different mode: ‘r’,’r+’,’w+’,’c’ accordingly with numpy.load (see numpy.memmap for a detailed description of the modes) The file is opened in this mode:

‘r’ Open existing file for reading only. ‘r+’ Open existing file for reading and writing. ‘w+’ Create or overwrite existing file for reading and writing. ‘c’ Copy-on-write: assignments affect data in memory, but changes are not saved to disk. The file on disk is read-only.

A memory-mapped array is kept on disk. However, it can be accessed and sliced like any ndarray. Memory mapping is especially useful for accessing small fragments of large files without reading the entire file into memory.

save_npy_matrix(file, arr)[source]

Save an array to a binary file in NumPy .npy format.

Arguments:
file
File or filename to which the data is saved. If file is a file-object, then the filename is unchanged. If file is a string, a .npy extension will be appended to the file name if it does not already have one.
arr
array_like. Array data to be saved.
save_npz_matrix(file)[source]

Save several arrays into a single file in uncompressed .npz format. (See numpy.savez for more information)