ExtractBatchMask

class lib.infer.objects.ExtractBatchMask(centering: CenteringType, matrices: npt.NDArray[np.float32], storage_size: int = 0, masks: npt.NDArray[np.uint8] = <factory>)

Bases: object

Dataclass for holding information about masks produced by the extraction pipeline

Parameters:
  • centering (CenteringType) – The centering type of the masks

  • matrices (npt.NDArray[np.float32]) – The normalized matrices required to take the masks from (0, 1) to full frame

  • storage_size (int) – The pixel size to store the mask at in the alignments file. Default: 0 (must be populated later)

  • masks (npt.NDArray[np.uint8]) – The masks for this batch. Default: empty array (must be populated later)

Attributes Summary

storage_size

The pixel size to store the mask at in the alignments file

Methods Summary

append(mask_batch)

Append the given mask batch object to this batch mask object

apply_mask(mask)

Apply a boolean mask to the batch object.

Attributes Documentation

storage_size: int = 0

The pixel size to store the mask at in the alignments file

Methods Documentation

append(mask_batch: ExtractBatchMask) None

Append the given mask batch object to this batch mask object

Parameters:

mask_batch (ExtractBatchMask) – The object containing data to be appended to this object

Return type:

None

apply_mask(mask: ndarray[tuple[Any, ...], dtype[bool]]) None

Apply a boolean mask to the batch object. True values are kept, False values are discarded

Parameters:

mask (ndarray[tuple[Any, ...], dtype[bool]]) – The boolean mask to apply to the object. Must be of size (num_masks, )

Return type:

None

append(mask_batch: ExtractBatchMask) None

Append the given mask batch object to this batch mask object

Parameters:

mask_batch (ExtractBatchMask) – The object containing data to be appended to this object

Return type:

None

apply_mask(mask: ndarray[tuple[Any, ...], dtype[bool]]) None

Apply a boolean mask to the batch object. True values are kept, False values are discarded

Parameters:

mask (ndarray[tuple[Any, ...], dtype[bool]]) – The boolean mask to apply to the object. Must be of size (num_masks, )

Return type:

None

centering: CenteringType = <dataclasses._MISSING_TYPE object>

The centering type of the masks

masks: npt.NDArray[np.uint8] = <dataclasses._MISSING_TYPE object>

The masks for this batch

matrices: npt.NDArray[np.float32] = <dataclasses._MISSING_TYPE object>

The normalized matrices required to take the masks from (0, 1) to full frame

storage_size: int = 0

The pixel size to store the mask at in the alignments file