A confocal imaging system, comprising: a light source configured to emit excitation light having one or more wavelengths; a sample holder configured to hold a sample; a two-dimensional imaging device; and an optical system comprising: a first spatial light modulator, SLM; a second SLM; and a dispersive element, wherein the dispersive element is a pair of double Amici prisms placed along the optical axis of the confocal imaging system, and wherein at least one of the pair of double Amici prisms is rotatable relative to the other around the optical axis of the confocal imaging system; wherein the optical system is configured to (i) collimate the excitation light; (ii) apply, using the first SLM, a predetermined phase modulation pattern to the collimated excitation light; (iii) use the phase-modulated collimated excitation light as an excitation pattern to illuminate the sample, wherein the excitation pattern is located at a Fourier plane relative to a focal plane within the sample; (iv) collect emission light from the focal plane within the sample; (v) direct the collected emission light to the imaging device via the second SLM such that the focal plane within the sample is conjugate to a plane of a pattern of pinholes formed by pixels of the second SLM; (vi) use the dispersive element to spectrally disperse the collected emission light before the collected emission light reaches the imaging device; wherein the confocal imaging system is configured to obtain, using the imaging device, a plurality of 2-D images of the spectrally dispersed emission light; and tο reconstruct the plurality of images to provide a hyperspectral confocal image dataset of the sample. a light source configured to emit excitation light having one or more wavelengths; a sample holder configured to hold a sample; a two-dimensional imaging device; and an optical system comprising: a first spatial light modulator, SLM; a second SLM; and a dispersive element, wherein the dispersive element is a pair of double Amici prisms placed along the optical axis of the confocal imaging system, and wherein at least one of the pair of double Amici prisms is rotatable relative to the other around the optical axis of the confocal imaging system; wherein the optical system is configured to (i) collimate the excitation light; (ii) apply, using the first SLM, a predetermined phase modulation pattern to the collimated excitation light; (iii) use the phase-modulated collimated excitation light as an excitation pattern to illuminate the sample, wherein the excitation pattern is located at a Fourier plane relative to a focal plane within the sample; (iv) collect emission light from the focal plane within the sample; (v) direct the collected emission light to the imaging device via the second SLM such that the focal plane within the sample is conjugate to a plane of a pattern of pinholes formed by pixels of the second SLM; (vi) use the dispersive element to spectrally disperse the collected emission light before the collected emission light reaches the imaging device; wherein the confocal imaging system is configured to obtain, using the imaging device, a plurality of 2-D images of the spectrally dispersed emission light; and tο reconstruct the plurality of images to provide a hyperspectral confocal image dataset of the sample. a first spatial light modulator, SLM; a second SLM; and a dispersive element, wherein the dispersive element is a pair of double Amici prisms placed along the optical axis of the confocal imaging system, and wherein at least one of the pair of double Amici prisms is rotatable relative to the other around the optical axis of the confocal imaging system; wherein the optical system is configured to (i) collimate the excitation light; (ii) apply, using the first SLM, a predetermined phase modulation pattern to the collimated excitation light; (iii) use the phase-modulated collimated excitation light as an excitation pattern to illuminate the sample, wherein the excitation pattern is located at a Fourier plane relative to a focal plane within the sample; (iv) collect emission light from the focal plane within the sample; (v) direct the collected emission light to the imaging device via the second SLM such that the focal plane within the sample is conjugate to a plane of a pattern of pinholes formed by pixels of the second SLM; (vi) use the dispersive element to spectrally disperse the collected emission light before the collected emission light reaches the imaging device; wherein the confocal imaging system is configured to obtain, using the imaging device, a plurality of 2-D images of the spectrally dispersed emission light; and tο reconstruct the plurality of images to provide a hyperspectral confocal image dataset of the sample.