1. A method comprising: (a) dividing each digital image of a plurality of slices of tissue of a patient into tiles, wherein the tiles obtained from digital images of different slices of tissue are coregistered with each other to form a stack of tiles; (b) generating first objects that are linked to pixels of the tiles, wherein a first rule set defines which pixels are linked to each of the first objects; (c) using a second rule set to generate first numerical data by measuring a first characteristic of the first objects located in each of the tiles; (d) generating a heat map by aggregating the first numerical data associated with each stack of tiles, wherein each stack of tiles is used to generate a pixel of the heat map; (e) generating second objects from the heat map, wherein a third rule set defines which pixels of the heat map are linked to each of the second objects; (f) using a fourth rule set to generate second numerical data by measuring a second characteristic of the second objects detected in the heat map; (g) determining how well the second numerical data correlates with clinical data for the patient; (h) improving how well the second numerical data correlates with the clinical data for the patient by modifying the first rule set, the second rule set, the third rule set and the fourth rule set and then repeating (b) through (g); and (i) defining an image-based diagnostic test based on the first rule set, the second rule set, the third rule set and the fourth rule set.