@pimms.calc('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>')<EOL>def calc_prediction(registered_map, preregistration_mesh, native_mesh, model):
<EOL>coords3d = np.array(preregistration_mesh.coordinates)<EOL>idcs = registered_map.labels<EOL>coords3d[:,idcs] = registered_map.meta('<STR_LIT>').inverse(registered_map.coordinates)<EOL>rmesh = preregistration_mesh.copy(coordinates=coords3d)<EOL>d = model.cortex_to_angle(registered_map.coordinates)<EOL>id2n = model.area_id_to_name<EOL>(ang, ecc) = d[<NUM_LIT:0>:<NUM_LIT:2>]<EOL>lbl = np.asarray(d[<NUM_LIT:2>], dtype=np.int)<EOL>rad = np.asarray([predict_pRF_radius(e, id2n[l]) if l > <NUM_LIT:0> else <NUM_LIT:0> for (e,l) in zip(ecc,lbl)])<EOL>d = {'<STR_LIT>':ang, '<STR_LIT>':ecc, '<STR_LIT>':lbl, '<STR_LIT>':rad}<EOL>rpred = {}<EOL>for (k,v) in six.iteritems(d):<EOL><INDENT>v.setflags(write=False)<EOL>tmp = np.zeros(rmesh.vertex_count, dtype=v.dtype)<EOL>tmp[registered_map.labels] = v<EOL>tmp.setflags(write=False)<EOL>rpred[k] = tmp<EOL><DEDENT>rpred = pyr.pmap(rpred)<EOL>rmesh = rmesh.with_prop(rpred)<EOL>if native_mesh is preregistration_mesh:<EOL><INDENT>pred = rpred<EOL>pmesh = rmesh<EOL><DEDENT>else:<EOL><INDENT>addr = preregistration_mesh.address(native_mesh.coordinates)<EOL>natreg_mesh = native_mesh.copy(coordinates=rmesh.unaddress(addr))<EOL>d = model.cortex_to_angle(natreg_mesh)<EOL>(ang,ecc) = d[<NUM_LIT:0>:<NUM_LIT:2>]<EOL>lbl = np.asarray(d[<NUM_LIT:2>], dtype=np.int)<EOL>rad = np.asarray([predict_pRF_radius(e, id2n[l]) if l > <NUM_LIT:0> else <NUM_LIT:0> for (e,l) in zip(ecc,lbl)])<EOL>pred = pyr.m(polar_angle=ang, eccentricity=ecc, radius=rad, visual_area=lbl)<EOL>pmesh = natreg_mesh.with_prop(pred)<EOL><DEDENT>return {'<STR_LIT>'        : rmesh,<EOL>'<STR_LIT>': rpred,<EOL>'<STR_LIT>'             : pred,<EOL>'<STR_LIT>'         : pmesh}<EOL>
calc_registration_prediction is a pimms calculator that creates the both the prediction and the
registration_prediction, both of which are pimms itables including the fields 'polar_angle',
'eccentricity', and 'visual_area'. The registration_prediction data describe the vertices for
the registered_map, not necessarily of the native_mesh, while the prediction describes the
native mesh.

Provided efferent values:
  @ registered_mesh Will be a mesh object that is equivalent to the preregistration_mesh but
    with the coordinates and predicted fields (from the registration) filled in. Note that this
    mesh is still in the resampled configuration is resampling was performed.
  @ registration_prediction Will be a pimms ITable object with columns 'polar_angle', 
    'eccentricity', and 'visual_area'. For values outside of the model region, visual_area will
    be 0 and other values will be undefined (but are typically 0). The registration_prediction
    describes the values on the registrered_mesh.
  @ prediction will be a pimms ITable object with columns 'polar_angle', 'eccentricity', and
    'visual_area'. For values outside of the model region, visual_area will be 0 and other
    values will be undefined (but are typically 0). The prediction describes the values on the
    native_mesh and the predicted_mesh.