Skip to content

Commit 0921404

Browse files
removing print statements
1 parent 91d4ab7 commit 0921404

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

cellpose/gui/gui.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,6 @@ def remove_stroke(self, delete_points=True, stroke_ind=-1):
15021502
stroke = np.array(self.strokes[stroke_ind])
15031503
cZ = self.currentZ
15041504
inZ = stroke[0, 0] == cZ
1505-
print(inZ.sum())
15061505
if inZ:
15071506
outpix = self.outpix[cZ, stroke[:, 1], stroke[:, 2]] > 0
15081507
self.layerz[stroke[~outpix, 1], stroke[~outpix, 2]] = np.array([0, 0, 0, 0])
@@ -1688,7 +1687,6 @@ def add_set(self):
16881687
color = self.colormap[self.ncells, :3]
16891688
median = self.add_mask(points=self.current_point_set, color=color)
16901689
if median is not None:
1691-
print(median)
16921690
self.removed_cell = []
16931691
self.toggle_mask_ops()
16941692
self.cellcolors = np.append(self.cellcolors, color[np.newaxis, :],
@@ -1728,7 +1726,6 @@ def add_mask(self, points=None, color=(100, 200, 50), dense=True):
17281726
ar, ac = ar + vr.min() - 2, ac + vc.min() - 2
17291727
# get dense outline
17301728
contours = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
1731-
print(contours[-2][0].shape)
17321729
pvc, pvr = contours[-2][0][:,0].T
17331730
vr, vc = pvr + vr.min() - 2, pvc + vc.min() - 2
17341731
# concatenate all points
@@ -1745,15 +1742,13 @@ def add_mask(self, points=None, color=(100, 200, 50), dense=True):
17451742
mask[ar - vr.min() + 2, ac - vc.min() + 2] = 1
17461743
contours = cv2.findContours(mask, cv2.RETR_EXTERNAL,
17471744
cv2.CHAIN_APPROX_NONE)
1748-
print(contours[-2][0].shape)
17491745
pvc, pvr = contours[-2][0][:,0].T
17501746
vr, vc = pvr + vr.min() - 2, pvc + vc.min() - 2
17511747
ars = np.concatenate((ars, ar), axis=0)
17521748
acs = np.concatenate((acs, ac), axis=0)
17531749
vrs = np.concatenate((vrs, vr), axis=0)
17541750
vcs = np.concatenate((vcs, vc), axis=0)
1755-
print("HI", ars, acs)
1756-
1751+
17571752
self.draw_mask(z, ars, acs, vrs, vcs, color)
17581753
median.append(np.array([np.median(ars), np.median(acs)]))
17591754

cellpose/gui/io.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,8 @@ def _masks_to_gui(parent, masks, outlines=None, colors=None):
482482
fastremap.renumber(masks, in_place=True)
483483
outlines = None
484484
masks = masks.reshape(shape)
485-
outlines = None
485+
if masks.ndim == 2:
486+
outlines = None
486487
masks = masks.astype(np.uint16) if masks.max() < 2**16 - 1 else masks.astype(
487488
np.uint32)
488489
if parent.restore and "upsample" in parent.restore:
@@ -650,7 +651,6 @@ def _save_sets(parent):
650651
"diameter":
651652
parent.diameter
652653
}
653-
print(dat["masks"].shape)
654654
if parent.restore is not None:
655655
dat["img_restore"] = parent.stack_filtered
656656
np.save(base + "_seg.npy", dat)

0 commit comments

Comments
 (0)