CLAM icon indicating copy to clipboard operation
CLAM copied to clipboard

Run your own dataset

Open Tanhongyun opened this issue 1 year ago • 2 comments

Hello, it seems like you're encountering an error while trying to convert your dataset from NIfTI format (nii.gz) to TIFF format (tif). The error message you provided indicates a problem with the code or data you are working with. Here's a translation of the error message and an explanation of the issue: progress: 0.00, 0/1 processing PD_175.tiff Traceback (most recent call last): File "/home/chenwj/anaconda3/envs/clam/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 1432, in squeeze squeeze = a.squeeze AttributeError: 'NoneType' object has no attribute 'squeeze'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "create_patches_fp.py", line 309, in process_list=process_list, auto_skip=args.no_auto_skip) File "create_patches_fp.py", line 185, in seg_and_patch WSI_object, seg_time_elapsed = segment(WSI_object, current_seg_params, current_filter_params) File "create_patches_fp.py", line 30, in segment WSI_object.segmentTissue(**seg_params, filter_params=filter_params) File "/home/chenwj/clam/CLAM/wsi_core/WholeSlideImage.py", line 169, in segmentTissue hierarchy = np.squeeze(hierarchy, axis=(0,))[:, 2:] File "<array_function internals>", line 6, in squeeze File "/home/chenwj/anaconda3/envs/clam/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 1434, in squeeze return _wrapit(a, 'squeeze', axis=axis) File "/home/chenwj/anaconda3/envs/clam/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 47, in _wrapit result = getattr(asarray(obj), method)(*args, **kwds) numpy.AxisError: axis 0 is out of bounds for array of dimension 0

Tanhongyun avatar Nov 29 '23 09:11 Tanhongyun

Hi, did you solve this problem? I meet the same one :(

XNN19 avatar Jan 22 '24 18:01 XNN19

I experienced this issue too. For me this happened, because I tried to use binary masks as a proxy and use those to get opencv contours. This didn't work, as the binary rgb images were converted to hsv color space internally, resulting in only zeros in the saturation channel. The saturation channel is used to compute contours on, resulting in no contours. Since there was no contour/hierarchy, hierarchy = np.squeeze(hierarchy, axis=(0,))[:, 2:] failed.

siemdejong avatar Jan 30 '24 12:01 siemdejong