if (channelIndex >= image.getNumChannels())
{
throw new IllegalArgumentException("The channel index must be smaller than the number of channels in the image (" + image.getNumChannels() + ").");
}
int dim = image.getMaxSample(channelIndex) + 1;
MemoryCoOccurrenceMatrix matrix = new MemoryCoOccurrenceMatrix(dim);
initCoOccurrenceMatrix(image, channelIndex, matrix);
return matrix;
}