This operation is done using the following topological operations. First, complement the input volume. Then, perform a 3-D or 2-D connected-components analysis (depending on parameter settings) on the volume, saving only the largest component. Then, complement the volume again.
option = 3-DThe parameter ``option = '' determines how the cavities are deleted. It toggles between ``3-D'', ``2-D transverse'', ``2-D sagittal'', and ``2-D coronal''. For ``3-D'', all 3-D cavities are deleted. For ``2-D transverse'', all cavities on 2-D transverse planes are deleted, etc.
connectivity = 6
The option ``connectivity'' toggles between 6 (connectivity) and 26 (connectivity). When one of the 2-D options is selected, 6-connectivity is interpreted as 4-connectivity and 26-connectivity is interpreted as 8-connectivity [24,28,23]. (4-connectivity is the 2-D analog of 6-connectivity, etc.)