dcnum.logic.chunk_slot_data

Attributes

mp_spawn

Classes

ChunkSlotData

Module Contents

dcnum.logic.chunk_slot_data.mp_spawn = None
class dcnum.logic.chunk_slot_data.ChunkSlotData(shape, available_features=None)[source]
shape

3D shape of the chunk in this slot

length
_task_reserve_array
_task_reserve_lock
_task_progress_array
_state
_chunk
property chunk

Current chunk being analyzed

property state

Current state of the slot

Valid values are:

  • “0”: construction of instance

  • “i”: image loading (populates image, image_bg, image_corr, bg_off)

  • “s”: segmentation (populates mask or labels)

  • “m”: mask labeling (takes mask and populates labels)

  • “l”: label processing (modifies labels in-place)

  • “e”: feature extraction (requires labels)

  • “w”: writing

  • “d”: done (slot can be repurposed for next chunk)

  • “n”: not specified

The pipeline workflow is:

“0” -> “i” -> “s” -> “m” -> “l” -> “e” -> “w” -> “d” -> “i” …

property bg_off

Brightness offset correction for the current chunk

property image

numpy view on image data

property image_bg

numpy view on background image data

property image_corr

numpy view on background-corrected image data

property labels

numpy view on the labeling data

property mask

numpy view on the boolean, unlabeled mask data

acquire_task_lock(req_state: str, batch_size: int | None = None) tuple[int, int][source]

Acquire the lock for performing a task

Return the start and stop indices for which the lock was acquired. If no lock could be acquired, return (0, 0). The returned indices might not match the input batch size: Locks for contiguous indices are returned based on availability.

release_task_lock(start, stop, task_done=True)[source]

Release the task lock for a batch range

Releasing the task lock is done after completing the task for which a lock was required. This method also updates the progress (see get_progress) for the current task. Only release the task lock if you acquired it before.

get_progress()[source]

Return the progress of the current task

Return a value between 0 and 1. If processing is done in batches (batch_size set in acquire_task_lock), this returns the fraction of frames for which release_task_lock was called with task_done=True.