Filter unconnected pores using flood fill.