@pimms.calc('<STR_LIT>', '<STR_LIT>')<EOL>def calc_cortices(subject, atlas_subject, worklog, hemis=None):
if hemis is None or hemis is Ellipsis: hemis = '<STR_LIT>'<EOL>if pimms.is_str(hemis):<EOL><INDENT>if hemis.lower() in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT:all>']: hemis = ('<STR_LIT>','<STR_LIT>')<EOL>else: hemis = re.split(r'<STR_LIT>', hemis)[::<NUM_LIT:2>]<EOL><DEDENT>if atlas_subject.name == '<STR_LIT>':<EOL><INDENT>hemis = ['<STR_LIT>' if h == '<STR_LIT>' else h for h in hemis]<EOL><DEDENT>sctcs = {}<EOL>actcs = {}<EOL>worklog('<STR_LIT>')<EOL>for h in hemis:<EOL><INDENT>if h not in subject.hemis:<EOL><INDENT>raise ValueError('<STR_LIT>' % (subject.name, h))<EOL><DEDENT>sctcs[h] = curry(lambda sub,h: sub.hemis[h], subject,       h)<EOL>h = '<STR_LIT>' if h == '<STR_LIT>' else h<EOL>if h not in atlas_subject.hemis:<EOL><INDENT>raise ValueError('<STR_LIT>' % (<EOL>atlas_subject.name, h))<EOL><DEDENT>actcs[h] = curry(lambda sub,h: sub.hemis[h], atlas_subject, h)<EOL><DEDENT>return {'<STR_LIT>': pimms.lazy_map(sctcs),<EOL>'<STR_LIT>':   pimms.lazy_map(actcs)}<EOL>
calc_cortices extracts the hemisphere objects (of the subject) to which the atlas is being
applied. By default these are 'lh' and 'rh', but for HCP subjects other hemispheres may be
desired.

Afferent parameters:
  @ hemis 
    The hemispheres onto which to put the atlas; this may take a number of forms: 'lh' or 'rh' 
    (or --hemis=lh / --hemis=rh) applies the atlas to the given hemisphere only; otherwise a
    list of hemispheres may be specified as a python object (e.g.
    --hemis='("lh_LR32k","rh_LR32k")') or as a comma or whitespace separated string (such as
    'lh_LR32k,lh_LR59k' or 'rh rh_LR164k'). 'lr', 'both', and 'all' are equivalent to 'lh rh';
    this is the default behavior if hemis is not provided explicitly.
  @ subject 
    The neuropythy subject object onto which the atlas is being projected.
  @ atlas_subject 
    Theneuropythy subject object from which the atlas is being projected.