Thresholding largest/smallest component in ITK

3D images frequently have strong topological connectivity. You could explore your image using 3D Slicer. It’s Islands operations use ITK’s connected component and relabel filters.