docs: def calc_prediction(registered_map, preregistration_mesh, native_mesh, model):
      '''
      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.
      '''
      # invert the map projection to make the registration map into a mesh
      coords3d = np.array(preregistration_mesh.coordinates)
      idcs = registered_map.labels
      coords3d[:,idcs] = registered_map.meta('projection').inverse(registered_map.coordinates)
      rmesh = preregistration_mesh.copy(coordinates=coords3d)
      # go ahead and get the model predictions...
      d = model.cortex_to_angle(registered_map.coordinates)
      id2n = model.area_id_to_name
      (ang, ecc) = d[0:2]
      lbl = np.asarray(d[2], dtype=np.int)
      rad = np.asarray([predict_pRF_radius(e, id2n[l]) if l > 0 else 0 for (e,l) in zip(ecc,lbl)])
      d = {'polar_angle':ang, 'eccentricity':ecc, 'visual_area':lbl, 'radius':rad}
      # okay, put these on the mesh
      rpred = {}
      for (k,v) in six.iteritems(d):
          v.setflags(write=False)
          tmp = np.zeros(rmesh.vertex_count, dtype=v.dtype)
          tmp[registered_map.labels] = v
          tmp.setflags(write=False)
          rpred[k] = tmp
      rpred = pyr.pmap(rpred)
      rmesh = rmesh.with_prop(rpred)
      # next, do all of this for the native mesh..
      if native_mesh is preregistration_mesh:
          pred = rpred
          pmesh = rmesh
      else:
          # we need to address the native coordinates in the prereg coordinates then unaddress them
          # in the registered coordinates; this will let us make a native-registered-map and repeat
          # the exercise above
          addr = preregistration_mesh.address(native_mesh.coordinates)
          natreg_mesh = native_mesh.copy(coordinates=rmesh.unaddress(addr))
          d = model.cortex_to_angle(natreg_mesh)
          (ang,ecc) = d[0:2]
          lbl = np.asarray(d[2], dtype=np.int)
          rad = np.asarray([predict_pRF_radius(e, id2n[l]) if l > 0 else 0 for (e,l) in zip(ecc,lbl)])
          pred = pyr.m(polar_angle=ang, eccentricity=ecc, radius=rad, visual_area=lbl)
          pmesh = natreg_mesh.with_prop(pred)
      return {'registered_mesh'        : rmesh,
              'registration_prediction': rpred,
              'prediction'             : pred,
              'predicted_mesh'         : pmesh}