dcnum.logic.chunk_slot_data =========================== .. py:module:: dcnum.logic.chunk_slot_data Attributes ---------- .. autoapisummary:: dcnum.logic.chunk_slot_data.mp_spawn Classes ------- .. autoapisummary:: dcnum.logic.chunk_slot_data.ChunkSlotData Module Contents --------------- .. py:data:: mp_spawn :value: None .. py:class:: ChunkSlotData(shape, available_features=None) .. py:attribute:: shape 3D shape of the chunk in this slot .. py:attribute:: length .. py:attribute:: _task_reserve_array .. py:attribute:: _task_reserve_lock .. py:attribute:: _task_progress_array .. py:attribute:: _state .. py:attribute:: _chunk .. py:property:: chunk Current chunk being analyzed .. py: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" ... .. py:property:: bg_off Brightness offset correction for the current chunk .. py:property:: image numpy view on image data .. py:property:: image_bg numpy view on background image data .. py:property:: image_corr numpy view on background-corrected image data .. py:property:: labels numpy view on the labeling data .. py:property:: mask numpy view on the boolean, unlabeled mask data .. py:method:: acquire_task_lock(req_state: str, batch_size: int | None = None) -> tuple[int, int] 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. .. py:method:: release_task_lock(start, stop, task_done=True) 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. .. py:method:: get_progress() 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`.