The function ``iConnComp2d'' performs the analogous operations on 2-D x-y planes of a volume.
minCompSize = 10The ``minCompSize'' restricts the minimum size in voxels of saved components; all components smaller than this number are deleted (set to 0).
maxNumComp = 1
connectivity = 6
saveLabels = No
The ``maxNumComp'' option determines how many components to save. If this parameter is set to 5, for example, only the 5 largest components are saved - all others are deleted. If you only want to save the largest connected component, set this parameter to 1.
The option ``connectivity'' sets the connectivity requirement of connected components. The options are ``6'' (for 6-connected) and ``26'' (for 26-connected) [28,23].
The ``saveLabels'' option toggles between ``Yes'' and ``No''. When the option is set to ``No'', only actions involving deleting components are done (per the settings of the parameters ``minCompSize = '' and ``maxNumComp''). If the option is set to ``Yes'', each different component will be assigned a unique number between 2 and 255; i.e., the component labeled 2 will have all of its voxels set to 2, etc.