Skip to content

Commit fde618a

Browse files
Merge pull request #75 from MannLabs/fix_selection
fix segmentation shape problem in the selection pipeline
2 parents 7012ec3 + c9d0725 commit fde618a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/scportrait/pipeline/selection.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ def process(
170170
)
171171

172172
segmentation = tempmmap.mmap_array_from_path(self.path_seg_mask)
173-
print(segmentation)
174173

175174
# create segmentation loader
176175
sl = SegmentationLoader(
@@ -179,6 +178,13 @@ def process(
179178
processes=self.config["processes_cell_sets"],
180179
)
181180

181+
if len(segmentation.shape) == 3:
182+
segmentation = np.squeeze(segmentation)
183+
else:
184+
raise ValueError(
185+
f"Segmentation shape is not correct. Expected 2D array, got {segmentation.shape}"
186+
)
187+
182188
# get shape collections
183189
shape_collection = sl(segmentation, self.cell_sets, self.calibration_marker)
184190

0 commit comments

Comments
 (0)