Data module

Image Factory

Author:Sebastian Reinhard
Organization:Biophysics and Biotechnology, Julius-Maximillians-University of Würzburg
Version:2019.06.26
class impro.data.image_factory.ImageFactory

Bases: object

Interface to File readers

classmethod create_image_file(path: str)
classmethod create_storm_file(path: str)

Image

Author:Sebastian Reinhard
Organization:Biophysics and Biotechnology, Julius-Maximillians-University of Würzburg
Version:2019.06.26
class impro.data.image.ImageReader(path)

Bases: object

Read Image file

Possible formats are .czi, .lsm, .tiff, .png

path

Path to file

Type:str
data

Image data as array

Type:np.array
metaData

Meta Data of image file containing computional dimensions: {ShapeSizeX, ShapeSizeY, ShapeSizeZ, ShapeSizeC} and physical dimensions: SizeX(Pixel Size in X direction)…

Type:np.array

Example

>>> file = ImageReader("path_to_file.czi")
>>> file.parse()
>>> file.data.shape
(4,103,2430,2430)
parse(calibration_px=1.0)

Read data/Metadata from file

reset_data()

resets data

set_calibration(px: float)

Set pixel size manually

class impro.data.image.LocalisationReader(path: str)

Bases: object

Read RapidSTORM files

Rewritten class to read STORM/dSTORM data from a text file in a numpy array. Improved performance and logic. Can transform the localizations if a matrix is given. Recives metadata from file header.

path

Path to Rapidstorm .txt file

Type:str
stormData

Restructured data: X, Y, Precision, Z, Emission, Frame #todo switch Precision and Z

Type:np.array
size

X,Y size of data in nanometer

Type:np.array

Example

>>> file = LocalisationReader("path_to_Rapidstormfile.txt")
>>> file.parse()
>>> data = file.stormData
>>> data.shape
(100000, 6)
parse()

Read dSTORM data/Metadata from file

reset_data()

Resets dSTORM data

transformAffine(path=None, src=None, dst=None)

Transform dSTORM data affine with Landmarks file

Parameters:
  • path (str, optional) – path to file containing source points in column 1,2 (starting by 0) and target points in column 3,4
  • src ((,2) ndarray) – X,Y coordinates of source points
  • dst ((,2) ndarray) – X,Y coordinates of destination points
class impro.data.image.StormReader(input_loc_path)

Bases: object

Internal Class. Find dSTORM columns with regular expressions

clear()
get_header_info()
readfile()
save_loc_file(path, file)

Module contents