def gifti_to_array(gii):
if pimms.is_str(gii): return gifti_to_array(ny.load(gii, '<STR_LIT>'))<EOL>elif pimms.is_nparray(gii): return gii <EOL>elif isinstance(gii, nib.gifti.gifti.GiftiImage):<EOL><INDENT>return np.squeeze(np.asarray([x.data for x in gii.darrays]))<EOL><DEDENT>else: raise ValueError('<STR_LIT>')<EOL>
gifti_to_array(gii) yields the squeezed array of data contained in the given gifti object, gii,
  Note that if gii does not contain simple data in its darray object, then this will produce
  undefined results. This operation is effectively equivalent to:
  np.squeeze([x.data for x in gii.darrays]).
gifti_to_array(gii_filename) is equivalent to gifti_to_array(neyropythy.load(gii_filename)).