Closed Mohinta2892 closed 1 month ago
Hi! Would it be possible to get a sample to experiment with? If you can share the line where you are calling the function that would help as well.
Thanks!
Sure, data is here.
I am running it as such:
n [1]: import cc3d
...: import numpy as np
In [2]: import zarr
In [3]: f = zarr.open("/media/samia/DATA/ark/connexion/data/MITO-HEMI/data_3d/merged/hemi_x11051_y20992_z21948_merged_ids_clahed.zarr")
In [4]: labels_in = f["volumes/labels/neuron_ids"][...]
In [5]:
In [5]: labels_out = cc3d.dust(
...: labels_in, threshold=100,
...: connectivity=26, in_place=False
...: )
Hi Samia,
Can you run the following code and let me know the result? I seem to be unable to reproduce your problem. There were issues with the dust function in the past, are you using the latest version of cc3d (currently version 3.16.0)?
import zarr
import cc3d
import numpy as np
zarray = zarr.open("hemi_x11051_y20992_z21948_merged_ids_clahed.zarr")
labels_in = zarray["volumes/labels/neuron_ids"][:]
labels_out = cc3d.dust(
labels_in, threshold=100,
connectivity=26, in_place=False
)
uniq, cts = np.unique(labels_out, return_counts=True)
cts = np.array([ x for x in cts if x > 0 ])
print(np.any(cts < 100))
Output:
False
Here's a photo of a 2d slice of removed segments:
import microviewer
microviewer.view(labels_out != labels_in)
Hi William,
Many thanks! You were right about the version, I had to upgrade to the latest version (3.17) and then it seems to be working.
Closing the issue now.
Best, Samia
Hello William,
I am trying to remove small objects via
dust
from a labelled ndarray (512^3) containing neuron segmentation instances. I have played around with the hyper-parameters ofdust
(threshold 100-1024, my objects are between 100 to 256); connectivity 6,18,26), however, none seems to be effective in removing small objects.Have you seen anything like this happen before? Any suggestions will be really appreciated.
Best, Samia