1. A method, comprising: obtaining multispectral image information for a sample comprising a fluorescent dye, wherein the multispectral image information forms an image cube comprising multiple two-dimensional layers, each layer comprising an image of the sample; calculating from the image cube a first spectrum comprising contributions from endogenous fluorescence in the sample; calculating from the image cube a second spectrum comprising contributions from the fluorescent dye and from endogenous fluorescence in the sample; and calculating a pure spectrum of the fluorescent dye in the sample based on the first and second spectra, wherein a relative contribution of light emission from the fluorescent dye to the second spectrum is larger than a relative contribution of light emission from the fluorescent dye to the first spectrum; wherein calculating the first spectrum comprises identifying a first set of pixel intensity values in the image cube corresponding to a first set of pixel locations, and using the first set of pixel intensity values to calculate the first spectrum; wherein calculating the second spectrum comprises identifying a second set of pixel intensity values in the image cube corresponding to a second set of pixel locations, the second set of pixel locations being different from the first set of pixel locations, and using the second set of pixel intensity values to calculate the second spectrum; and wherein identifying the first set of pixel intensity values comprises designating one or more layers of the image cube as a first layer set, and identifying members of the first set of pixel intensity values based on the first layer set.