GraphCutBM: Manual Refinement Graph-Cut Pipeline for Bruch’s Membrane

PRLEC Framework for OCT Processing and Visualization

OCT_GUI.Algorithms.ManualCorrection.GraphCutBM.calculateWeightStandard(value_v_i, value_v_j)[source]

Calculate the linear weight between two vertices vi and vj.

Parameters:
value_v_i: scalar, float

intensity at vertices vi

value_v_j: scalar, float

intensity at vertices vj

Returns:
weight: scalar, float

linear weight between edge vi and vj

OCT_GUI.Algorithms.ManualCorrection.GraphCutBM.connectpoints(cropped_segmentation, mode, dictParameters)[source]

Connecting points by line with certain thickness.

The thickness depends on the mode (high or low).

Parameters:
cropped_segmentation: ndarray

cropped segmentation volume

mode: string

‘high’ or ‘low’

dictParameters: dictionary

Parameters from parameter.txt

Returns:
cropped_segmentation: ndarray

segmentation result in cropped volume

OCT_GUI.Algorithms.ManualCorrection.GraphCutBM.getGraph(_slice, shortest_path, dictParameters)[source]

Construct Graph for Manual BM Refinement.

7-neighborhood.

Parameters:
_slice: ndarray

calcualted weights

shortest_path: ndarray

shortest path from predecessor

dictParameters: dictionary

Parameters from parameter.txt

Returns:
g: graph

resulting graph

endpoint: scalar

endpoint of graph

OCT_GUI.Algorithms.ManualCorrection.GraphCutBM.inpaint(_slice, shortest_path, dictParameters)[source]

Inpaint path into segmentation.

Parameters:
_slice: ndarray

calcualted weights

shortest_path: ndarray

shortest path from predecessor

dictParameters: dictionary

Parameters from parameter.txt

Returns:
segmentation: ndarray

resulting inpainted segmentation

OCT_GUI.Algorithms.ManualCorrection.GraphCutBM.propagateBM(volumeOriginal, segmentation, segmentation_original, saved_slices, rect_correction, mode)[source]

Manual refinement algorithm for Bruch’s Membrane.

The algorithm takes the corrected slices and connects them with lines of certain thicknesses in slow-scan direction. The thickness is based on the mode, detected by the propagation call.

If the spacing between subsequent corrected lines is rather low, the thickness of the connections is 1 resulting in the final output.

If the spacing is rather high, the thickness is t and in this area, a graph cut is executed.

Parameter used from Parameters text:
  • MAN_BM_BF_BSCAN: B-scan smoothing bilateral filter values
  • MAN_BM_MEDIAN: Median filtering resulting lines
  • MAN_BM_THICKNESS: Thickness of connecting lines
Parameters:
volumeOriginal: ndarray

original volume

segmentation: ndarray

segmentation

segmentation_original:ndarray

original segmentation

saved_slices: dictionary (scalar, ndarray) = (slice number, slice)

slices that were manually corrected

rect_correction[0]: scalar

startpoint x-axis

rect_correction[2]: scalar

startpoint y-axis

rect_correction[1]: scalar

endpoint x-axis

rect_correction[3]:scalar

endpoint y-axis

mode: string

‘high’ or ‘low’

Returns:
cropped_segmentation: ndarray

segmentation result in cropped volume