/// <summary> /// displays a histogram of cluster counts. /// the argument clusters is an array of integer. Indicates cluster assigned to each binary frame. /// </summary> public static void OutputClusterAndWeightInfo(int[] clusters, List <double[]> wts, string imagePath) { DataTools.getMaxIndex(clusters, out var maxIndex); int binCount = clusters[maxIndex] + 1; int[] histo = Histogram.Histo(clusters, binCount, out var binWidth, out var min, out var max); LoggedConsole.WriteLine("Sum = " + histo.Sum()); DataTools.writeArray(histo); DataTools.writeBarGraph(histo); //make image of the wts matrix wts = DataTools.RemoveNullElementsFromList(wts); var m = DataTools.ConvertList2Matrix(wts); m = DataTools.MatrixTranspose(m); ImageTools.DrawMatrixInColour(m, imagePath, false); }