1. An apparatus for processing multi-energy image data to separate at least two types of material, comprising: processing circuitry configured to: adaptively change a function of a first intensity value from a lower-energy scan and a second intensity value from a higher-energy scan, based on multi-energy intensity information associated with pixels or voxels of multi-energy image data which is taken with at least a higher-energy and a lower-energy, respectively; and obtain a classification of pixels or voxels of multi-energy image data into pixels or voxels corresponding to each of the types of material by using the changed function as a boundary; determine the adaptively changed function in dependence on the multi-energy intensity information associated with the pixels or voxels; wherein the determining the adaptively changed function comprises: determining at least one candidate threshold; and for the or each candidate threshold, partitioning the pixels or voxels into a first group of pixels or voxels and a second group of pixels or voxels in dependence on the candidate threshold; and determining a statistical dissimilarity between the first group of pixels or voxels and the second group of pixels or voxels, wherein the obtaining a classification of pixels or voxels of multi-energy image data into pixels or voxels corresponding to each of the types of material comprises: obtaining an initial non-probabilistic classification of pixels or voxels of multi-energy image data into pixels or voxels corresponding to each of the types of material by using the adaptively changed function as the boundary; and obtaining a further, refined probabilistic classification of pixels or voxels corresponding to each of the types of material by refining the initial classification in dependence on multi-energy intensity information associated with the pixels or voxels and spatial information associated with the pixels or voxels using a cluster filtering algorithm, and wherein the obtaining the initial non-probabilistic classification of pixels or voxels includes an iterative method, wherein for each iteration, a line is drawn on a 2D joint histogram, then two ID marginal distributions are calculated on a low energy axis, then using the distributions to calculate a statistical dissimilarity matrix, continuing the iterations for a range of lines, and then selecting one of the lines based on detecting a signature shape.