I/O

Functions:

load_image(path)

Detects the extension and loads image into a numpy array if it's a tif/tiff or an asc file.

load_sdt_data(filepath)

Loads the data of an SDT file, reshaping the output is necessary as this outputs a 1d array.

load_sdt_file(file_path)

Loads an sdt file and attemps to reshape the data into a cube corresponding to common file shapes.

read_asc(path)

Reads in an asc file into a numpy ndarray

cell_analysis_tools.io.load_image(path: str | PurePath) ndarray[source]

Detects the extension and loads image into a numpy array if it’s a tif/tiff or an asc file.

Parameters:

path (pathlib path or str) – path to the image.

Returns:

ndarray with the image data.

Return type:

np.ndarray

cell_analysis_tools.io.load_sdt_data(filepath)[source]

Loads the data of an SDT file, reshaping the output is necessary as this outputs a 1d array.

Parameters:

filepath (string, pathlib path) – path to the input image

Returns:

data – 1D array containing all channel and pixel data

Return type:

np.ndarray

cell_analysis_tools.io.load_sdt_file(file_path)[source]

Loads an sdt file and attemps to reshape the data into a cube corresponding to common file shapes.

Parameters:

file_path (pathlib path) – Path path to the sdt file

Returns:

image – A 3d-array representation of image.

Return type:

np.ndarray

cell_analysis_tools.io.read_asc(path)[source]

Reads in an asc file into a numpy ndarray

Parameters:

path (pathlib.Path) – path to the file.

Returns:

array – Numpy array holding the image data.

Return type:

np.ndarray