You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add z_batch_size parameter (default: 20) to process large Z-stacks in batches
- Implement _process_zyx_in_batches() for memory-efficient Z-stack processing
- Add explicit memory cleanup between timepoints (del + gc.collect())
- Improve subprocess memory management with try-finally blocks
- Clear input image immediately after segmentation to reduce peak memory
- Prevent OOM crashes when processing large TZYX data (e.g., 23×98×1024×1024)
For 98 Z-plane stacks: memory usage reduced from ~3-4 GB to ~600 MB per timepoint
Fixes processing of large time-series with 48 GB RAM systems
Copy file name to clipboardExpand all lines: src/napari_tmidas/processing_functions/convpaint_prediction.py
+100-5Lines changed: 100 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,13 @@
77
77
"default": False,
78
78
"description": "Force using dedicated environment even if napari-convpaint is available",
79
79
},
80
+
"z_batch_size": {
81
+
"type": int,
82
+
"default": 20,
83
+
"min": 1,
84
+
"max": 200,
85
+
"description": "Number of Z-planes to process at once for 3D data (lower = less memory, slower). For large Z-stacks (>50 planes), use 10-20 to avoid OOM.",
86
+
},
80
87
},
81
88
)
82
89
defconvpaint_predict(
@@ -87,6 +94,7 @@ def convpaint_predict(
87
94
background_label: int=1,
88
95
use_cpu: bool=False,
89
96
force_dedicated_env: bool=False,
97
+
z_batch_size: int=20,
90
98
) ->np.ndarray:
91
99
"""
92
100
Semantic segmentation using pretrained convpaint models.
0 commit comments