heyexReader package

heyexReader.volReader module

class heyexReader.volReader.volFile(filename)
__init__(filename)

Parses Heyex Spectralis *.vol files.

Parameters:filename (str) – Path to vol file
Returns:volFile class
oct

Retrieve OCT volume as a 3D numpy array.

Returns:3D numpy array with OCT intensities as ‘uint8’ array
irslo

Retrieve IR SLO image as 2D numpy array

Returns:2D numpy array with IR reflectance SLO image as ‘uint8’ array.
grid

Retrieve the IR SLO pixel coordinates for the B scan OCT slices

Returns:2D numpy array with the number of b scan images in the first dimension and x_0, y_0, x_1, y_1 defining the line of the B scan on the pixel coordinates of the IR SLO image.
renderIRslo(filename, renderGrid=False)

Renders IR SLO image as a PNG file and optionally overlays grid of B scans

Parameters:
  • filename (str) – filename to save IR SLO image
  • renderGrid (bool) – True will render red lines for the location of the B scans.
Returns:

None

renderOCTscans(filepre='oct', renderSeg=False)

Renders OCT images a PNG file and optionally overlays segmentation lines

Parameters:
  • filepre (str) – filename prefix. OCT Images will be named as “<prefix>-001.png”
  • renderSeg (bool) – True will render colored lines for the segmentation of the RPE, ILM, and NFL on the B scans.
Returns:

None

fileHeader

Retrieve vol header fields

Returns:
Dictionary with the following keys
  • version: version number of vol file definition
  • numBscan: number of B scan images in the volume
  • octSizeX: number of pixels in the width of the OCT B scan
  • octSizeZ: number of pixels in the height of the OCT B scan
  • distance: unknown
  • scaleX: resolution scaling factor of the width of the OCT B scan
  • scaleZ: resolution scaling factor of the height of the OCT B scan
  • sizeXSlo: number of pixels in the width of the IR SLO image
  • sizeYSlo: number of pixels in the height of the IR SLO image
  • scaleXSlo: resolution scaling factor of the width of the IR SLO image
  • scaleYSlo: resolution scaling factor of the height of the IR SLO image
  • fieldSizeSlo: field of view (FOV) of the retina in degrees
  • scanFocus: unknown
  • scanPos: Left or Right eye scanned
  • examTime: Datetime of the scan (needs to be checked)
  • scanPattern: unknown
  • BscanHdrSize: size of B scan header in bytes
  • ID: unknown
  • ReferenceID
  • PID: unknown
  • PatientID: Patient ID string
  • DOB: Date of birth
  • VID: unknown
  • VisitID: Visit ID string
  • VisitDate: Datetime of visit (needs to be checked)
  • GridType: unknown
  • GridOffset: unknown
bScanHeader(slicei)

Retrieve the B Scan header information per slice.

Parameters:slicei (int) – index of B scan
Returns:
Dictionary with the following keys
  • startX: x-coordinate for B scan on IR. (see getGrid)
  • startY: y-coordinate for B scan on IR. (see getGrid)
  • endX: x-coordinate for B scan on IR. (see getGrid)
  • endY: y-coordinate for B scan on IR. (see getGrid)
  • numSeg: 2 or 3 segmentation lines for the B scan
  • quality: OCT signal quality
  • shift: unknown
saveGrid(outfn)

Saves the grid coordinates mapping OCT Bscans to the IR SLO image to a text file. The text file will be a tab-delimited file with 5 columns: The bscan number, x_0, y_0, x_1, y_1 in pixel space scaled to the resolution of the IR SLO image.

Parameters:outfn (str) – location of where to output the file
Returns:None