def extract_mesh(self, obj):
from neuropythy.mri import is_subject<EOL>if is_subject(obj):<EOL><INDENT>if self.chirality is None: return None<EOL>else: ch = self.chirality<EOL>if ch not in obj.hemis: return None<EOL>else: obj = obj.hemis[ch]<EOL><DEDENT>if isinstance(obj, Topology):<EOL><INDENT>if (obj.chirality  is not None and<EOL>self.chirality is not None and<EOL>obj.chirality != self.chirality): return None<EOL>reg = self.registration<EOL>if self.registration is None: reg = '<STR_LIT>'<EOL>if reg in obj.registrations: return obj.registrations[reg]<EOL>else: return None<EOL><DEDENT>else: raise ValueError('<STR_LIT>')<EOL>
proj.extract_mesh(topo) yields the mesh registration object from the given topology topo
  that is registered to the given projection, or None if no such registration is found.
proj.extract_mesh(subj) yields the registration for a subject.

Note that None is also returned if the projection cannot find an appropriate hemisphere in
the subject.