test code to extract a data array from the images