take largest connected components in 2D slices and then reconstruct the 3D by stacking them
Isolate and reconstruct 3D objects from 2D slices in MATLAB! Learn how to take the largest connected components in each slice and stack them for 3D reconstructi