How can I separate point cloud using label?

I’m trying to separate point cloud using ClusterDBSCAN.
return value of the function is vector. I think it includes cluster number for each point.
I want to separate the point cloud using the labels.
Is there useful function in open3d? or any other useful method?
Thank you.

Have you tried finding the indices of the labels with numpy? That’s how I’ve done it at least.

As an example, I use it to detect the biggest object from all the labeled points, so I am searching for the label that is most frequent by summing up each of the detected labels and then getting the argument (the index, or in this case the label of the dbscan) of the maximum value:

labels_in_pc = dbscan(np.asarray(in_pc.points), eps=dist)
label_biggest = np.argmax([np.sum(labels_in_pc[1] == k) for k in range(labels_in_pc[1].max() + 1)])

out_pc = open3d.geometry.PointCloud()
out_pc.points = open3d.utility.Vector3dVector(np.asarray(in_pc.points)[labels_in_pc[1] == label_biggest])

Hello. How are you? I suggest the paper