A computer-implemented method of training a machine-learning algorithm to perform histopathological image analysis, the method comprising: obtaining , by the computer, a plurality of first microscopic images of first histological specimens that have been stained with a first marker; obtaining , by the computer, a respective plurality of second microscopic images of second histological specimens that have been stained with a second marker, different from the first marker, each one of the second histological specimens corresponding to a respective one of the first histological specimens; obtaining , by the computer, a respective plurality of mask images generated for the second microscopic images, each mask image identifying a histological feature of interest highlighted in the respective second microscopic image by the second marker; for each first microscopic image and the respective second microscopic image and mask image: obtaining , by the computer, a transformation that maps between the first microscopic image and the second microscopic image, and aligning , by the computer, the first microscopic image and the mask image, using the transformation; and training , by the computer, the machine-learning algorithm with the plurality of aligned first microscopic images and mask images, thereby training the machine-learning algorithm to predict, from another first microscopic image of another histological specimen stained with the first marker, a histological feature of interest that would be highlighted in that specimen by the second marker. obtaining , by the computer, a plurality of first microscopic images of first histological specimens that have been stained with a first marker; obtaining , by the computer, a respective plurality of second microscopic images of second histological specimens that have been stained with a second marker, different from the first marker, each one of the second histological specimens corresponding to a respective one of the first histological specimens; obtaining , by the computer, a respective plurality of mask images generated for the second microscopic images, each mask image identifying a histological feature of interest highlighted in the respective second microscopic image by the second marker; for each first microscopic image and the respective second microscopic image and mask image: obtaining , by the computer, a transformation that maps between the first microscopic image and the second microscopic image, and aligning , by the computer, the first microscopic image and the mask image, using the transformation; and obtaining , by the computer, a transformation that maps between the first microscopic image and the second microscopic image, and aligning , by the computer, the first microscopic image and the mask image, using the transformation; and training , by the computer, the machine-learning algorithm with the plurality of aligned first microscopic images and mask images, thereby training the machine-learning algorithm to predict, from another first microscopic image of another histological specimen stained with the first marker, a histological feature of interest that would be highlighted in that specimen by the second marker. <EOS>