function ds = cosmo_flatten(arr, dim_labels, dim_values, dim, varargin)
cosmo find local extrema hdr
cosmo fmri convert xform hdr