CellSeg
CellSeg copied to clipboard
error during stitching the image
I am trying to see if CellSeg works on my images. I have installed and followed the instructions to run the segmentation. But it gives error on the way. Any clue on what to do to get rid of the error? Below you see an output from the jupyter notebook:
Initializing CSSegmenter at /home/htahir/CellSeg/LeicaImage/LeicaImg Working with images of shape: (5736, 3, 5736) Initializing model with weights located at /home/htahir/CellSeg/CellSeg-master/src/modelFiles/final_weights.h5 Using autosizing for image shape Checking previous segmentation progress... These tiles already segmented: []
Segmenting with CellSeg: image1.tif Dividing image into 8 crops with 8 rows and 1 columns Segmented crop in 17.69936180114746 seconds. Segmented crop in 17.05249834060669 seconds. Segmented crop in 16.5869243144989 seconds. Segmented crop in 16.667478799819946 seconds. Segmented crop in 16.51861333847046 seconds. Segmented crop in 16.605283737182617 seconds. Segmented crop in 16.501692056655884 seconds. Segmented crop in 15.956273078918457 seconds. Stitching: image1.tif Removing masks with area less than 8 pixels.
ValueError Traceback (most recent call last)
~/CellSeg/CellSeg-master/main.py in main() 118 119 print('Stitching:', filename) --> 120 stitched_mask = CVMask(stitcher.stitch_masks(masks, rows, cols)) 121 122 #inside the stitcher, split the masks back into crops
~/CellSeg/CellSeg-master/src/cvstitch.py in stitch_masks(self, masks, nrows, ncols) 129 mask_overlaps_compress[i, :] = expanded_mask_arr[:, :, i][mask_overlaps] 130 --> 131 mask_conflicts = np.unique(mask_overlaps_compress, axis = 1) 132 133 del mask_overlaps, mask_overlaps_compress
~/miniconda3/envs/cellsegsegmenter/lib/python3.6/site-packages/numpy/lib/arraysetops.py in unique(ar, return_index, return_inverse, return_counts, axis) 276 # Must reshape to a contiguous 2D array for this to work... 277 orig_shape, orig_dtype = ar.shape, ar.dtype --> 278 ar = ar.reshape(orig_shape[0], -1) 279 ar = np.ascontiguousarray(ar) 280 dtype = [('f{i}'.format(i=i), ar.dtype) for i in range(ar.shape[1])]
ValueError: cannot reshape array of size 0 into shape (0,newaxis)