Submodule: binary

Threshold

class flika.process.binary.Threshold

threshold(value, darkBackground=False, keepSourceWindow=False)

Creates a boolean matrix by applying a threshold

Parameters:
  • value (float) – The threshold to be applied
  • darkBackground (bool) – If this is True, pixels below the threshold will be True
Returns:

newWindow

BlocksizeSlider

class flika.process.binary.BlocksizeSlider(demicals=0)

Adapative_threshold

class flika.process.binary.Adaptive_threshold

adaptive_threshold(value, block_size, darkBackground=False, keepSourceWindow=False)

Creates a boolean matrix by applying an adaptive threshold using the scikit-image threshold_local function

Parameters:
  • value (int) – The threshold to be applied
  • block_size (int) – size of a pixel neighborhood that is used to calculate a threshold value for the pixel. Must be an odd number greater than 3.
  • darkBackground (bool) – If this is True, pixels below the threshold will be True
Returns:

newWindow

Canny_edge_detector

class flika.process.binary.Canny_edge_detector

canny_edge_detector(sigma, keepSourceWindow=False)

Parameters:sigma (float) –
Returns:newWindow

Logically_combine

class flika.process.binary.Logically_combine

logically_combine(window1, window2,operator, keepSourceWindow=False)

Combines two windows according to the operator

Parameters:
Returns:

newWindow

Remove_small_blobs

class flika.process.binary.Remove_small_blobs

remove_small_blobs(rank, value, keepSourceWindow=False)

Finds all contiguous ‘True’ pixels in rank dimensions. Removes regions which have fewer than the specified pixels.

Parameters:
  • rank (int) – The number of dimensions. If rank==2, each frame is treated independently
  • value (int) – The size (in pixels) below which each contiguous region must be in order to be discarded.
Returns:

newWindow

Binary_Dilation

class flika.process.binary.Binary_Dilation

binary_dilation(rank,connectivity,iterations, keepSourceWindow=False)

Performs a binary dilation on a binary image. The ‘False’ pixels neighboring ‘True’ pixels become converted to ‘True’ pixels.

Parameters:
  • rank (int) – The number of dimensions to dilate. Can be either 2 or 3.
  • connectivity (int) – connectivity determines the distance to dilate. connectivity may range from 1 (no diagonal elements are neighbors) to rank (all elements are neighbors).
  • iterations (int) – How many times to repeat the dilation
  • keepSourceWindow (bool) – If this is False, a new Window is created with the result. Otherwise, the currentWindow is used
Returns:

newWindow