@pimms.value<EOL><INDENT>def hemis(path, subject_id, filemap, default_alignment):<DEDENT>
sid = subject_id<EOL>hmaps = filemap['<STR_LIT>']<EOL>def _ctx_loader(k):<EOL><INDENT>def _f():<EOL><INDENT>try: return Subject._cortex_from_hemimap(sid, k, hmaps[k])<EOL>except Exception: return None<EOL><DEDENT>return _f<EOL><DEDENT>hemmap0 = pimms.lazy_map({k:_ctx_loader(k) for k in six.iterkeys(hmaps)})<EOL>hemmap0 = Subject._cortex_setup_native_retinotopy(path, sid, hemmap0, hmaps, '<STR_LIT>')<EOL>def _ctx_lookup(k): return lambda:hemmap0[k]<EOL>hemmap = {}<EOL>da = '<STR_LIT:_>' + default_alignment<EOL>for k in six.iterkeys(hmaps):<EOL><INDENT>hemmap[k] = _ctx_lookup(k)<EOL>if k.endswith(da):<EOL><INDENT>kk = k[:-len(da)]<EOL>hemmap[kk] = hemmap[k]<EOL>if kk.endswith('<STR_LIT>'): hemmap[k[<NUM_LIT:0>:<NUM_LIT:2>]] = hemmap[k]<EOL><DEDENT><DEDENT>return pimms.lazy_map(hemmap)<EOL>
sub.hemis is a persistent map of hemispheres/cortex objects for the given HCP subject sub.
HCP subjects have many hemispheres of the name <chirality>_<topology>_<alignment> where
chirality is lh or rh, topology is native or an atlas name, and alignment is MSMAll or
MSMSulc. The lh and rh hemispheres are aliases for lh_native and rh_native. The
default_alignment of the subject determines whether MSMAll or MSMSulc alignments are aliased
as <chirality>_<alignment> hemispheres.