Performance of the PAMELA Si-W imaging calorimeter in space