ClearMap.IO#
This module handels data reading and writing in ClearMap via sources and sinks.
The base class for IO is a Source
that automatically
detects file type and gathers some basic infomration about the file.
The IO
module is the main module organizing all the IO
functionailty.
>>> import numpy as np
>>> import ClearMap.IO.IO as io
>>> x = np.random.rand(30,40,50);
>>> s = io.as_source(x);
>>> print(s);
Numpy-Source(30, 40, 50)[float64]|C|
The first tuple is the shape of the array, the next list contains the datype or data structure, the |.| bracket denotes the order of this array, which can be |C| for c-contigous, |F| for Fortran contigous or ‘’ if the array is non-contigous.
File sources contain further information about the location of the files etc.
The FileList
source allows to turn a list of files into a
sinlge source, e.g. for microscope data in which each imageing plane comes
in a separate file.
Supported source types include:
Format |
Module |
Description |
---|---|---|
tif |
tif images and stacks |
|
raw / mhd |
raw image files with optional mhd header file |
|
nrrd |
nearly raw raster data files |
|
csv |
text files as comma separated values |
|
npy |
numpy binary file |
|
gt |
graph tool file |
|
file list |
folder, file list or file expression for a list source files |
|
memory mapped file |
||
shared memory array |
Note
Sources can be sliced as numpy arrays using the Slice
module.
Note
All sources can be made virtual, containing only pointers to data in order to use them in parallel processing via the as_virtual function.
Sub-packages and modules#
Interface to read and write csv files.
Module to handle sources distributed over a list of files.
This module provides utilities for file management used by various IO modules.
Interface to read and write graph tool files.
IO interface to read files as sources.
IO interface to mhd / raw files.
Interface to numpy memmaps
IO interface to numpy arrays.
IO interface to NRRD volumetric image data files.
Shared memory arrays for parallel processing.
This module provides basic handling of slicing of sources.
This module provides the base class for data sources and sinks.
TIF module provides interface to read and write tif image files.
Utility functions to create temporary files.
The Workspace module keeps track of the data files of a project.