linumpy.microscope.oct#

Spectral-domain OCT data loader for ThorLabs microscopes.

Classes#

OCT

Spectral-domain OCT class to reconstruct the data.

Module Contents#

class linumpy.microscope.oct.OCT(directory, axial_res=3.5)[source]#

Spectral-domain OCT class to reconstruct the data.

Parameters:
  • directory (string) – Path to the directory containing the raw tiles and info file.

  • axial_res (float, optional) – Axial resolution of the data in microns.

directory[source]#
info_filename[source]#
info[source]#
rz = 3.5[source]#
read_scan_info(filename)[source]#

Read the scan information file.

Parameters:

filename (pathlib.Path) – Path to the scan_file written by the OCT (.txt)

Return type:

None

load_image(crop=True, fix_galvo_shift=True, fix_camera_shift=False)[source]#

Load an image dataset.

Parameters:
  • crop (bool) – If crop is True, the galvo returns will be cropped from the volume

  • fix_galvo_shift (bool | int | None) – If True, the shift caused by the galvo mirror return will be evaluated from the data. If an integer value is given, this value will be used to fix the shift. The fix is only applied if detection confidence >= 0.3.

  • fix_camera_shift (bool) – If True, the camera shift will be evaluated and compensated from the data. This will detect the first pixel of the scan that is always overexposed and shift the data to compensate for this.

Return type:

numpy.ndarray

Notes

  • The returned volume is in this order : z (depth), x (a-line), y (b-scan)

  • This method doesn’t consider repeated a-lines or b-scans yet.

property position_available: bool[source]#

Return True if the position is available in the info.txt file.

Return type:

bool

property dimension: tuple[float, float, float][source]#

Return the OCT physical dimension in mm. Will be (1, 1, 1) if not found.

Return type:

tuple[float, float, float]

property position: tuple[float, float, float][source]#

Return the OCT physical position in mm. Will be (0, 0, 0) if not found.

Return type:

tuple[float, float, float]

property resolution: tuple[float, float, float][source]#

Return the OCT physical resolution in mm.

Will be (1, 1, 1) if not found.

Return type:

tuple[float, float, float]

property shape: tuple[float, float, float][source]#

Return the OCT shape in pixels from the info.txt file. Returns (nx, ny, nz).

Return type:

tuple[float, float, float]