<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extract_largest(self, inplace=False):
 """ Extract largest connected set in mesh. Can be used to reduce residues obtained when generating an isosurface. Works only if residues are not connected (share at least one point with) the main component of the image. Parameters inplace : bool, optional Updates mesh in-place while returning nothing. Returns ------- mesh : vtki.PolyData Largest connected set in mesh """

        mesh =  self.connectivity(largest=True)
        if inplace:
            self.overwrite(mesh)
        else:
            return mesh