def LABVisualization(bins, slices, project=True,color=False,fullOpacity=True, data = "8bit"): startTime = time.time() colorMax = 255 if data == "8bitsegmented": histogram = DataParse.loadStack(300, 200, 3000, mode="8bit", segmented=True) elif data == "8bit": histogram = DataParse.loadStack(300, 200, 3000, mode="8bit", segmented=False) elif data == "12bit": histogram = DataParse.loadStack(300, 200, 3000, mode="12bit", segmented=False) colorMax = 4095 ColorPlots.histogramToLAB(histogram, colorMax, slices, project=project, color=color, fullOpacity=True) endTime = time.time() print "Total Time: %g Seconds" % (endTime-startTime)
def saveABPlot(slices, bins, floor, ceiling): startTime = time.time() histogram = DataParse.loadStack(slices, bins, floor, ceiling, bits=12, segmented=False, colorSpace="LAB") filename = "AB Plot" + str(bins) + "Bins" + "Floor" + str(floor) + "Ceiling" + str(ceiling) + ".png" ColorPlots.ABPlot(histogram, bins, filename) endTime = time.time() print "Total Time: %g Seconds" % (endTime-startTime) print "For %g Bins" % bins
def howManyClusters(): histogram = DataParse.loadStack() Cluster.howManyClusters(histogram, 2, 45, 5)
def sliceDraw(): histogram = DataParse.loadStack() data, centroidList, distance = Cluster.kMeans(histogram, main.CLUSTERS) Draw.drawSlice(data, centroidList)
def dirichelet(): histogram = DataParse.loadStack() MG, obs = Cluster.expectationMaximization(histogram, main.CLUSTERS, mode="Dirichelet") Draw.EMDraw(obs, MG, histogram)
def EM(): histogram = DataParse.loadStack() MG, obs = Cluster.expectationMaximization(histogram, main.CLUSTERS) Draw.EMDraw(obs, MG, histogram)
def SVM(): histogram = DataParse.loadStack() data, classifier = Classifier.train(histogram) Draw.SVMDraw(data, classifier, histogram)
def kMeans(): histogram = DataParse.loadStack() data, centroidList, distance = Cluster.kMeans(histogram, main.CLUSTERS) Draw.clusterDraw(data, centroidList, histogram)
def histogram(): histogram = DataParse.loadStack() Draw.draw(histogram)
def histogramToPNG(): histogram = DataParse.loadStack(300, 200, 3000, mode="12bit", segmented=False) Utils.saveHistogramAsPNG(histogram)
def volumeRenderLowerCorner(): histogram = DataParse.loadStack() histogram = Utils.magnifyLowerLeft(histogram, .25) Draw.volumeRender(histogram, mode="greyscale", prune=0)
def twelveBitVolumeRender(): histogram = DataParse.loadStack(300, 200, 3000, mode="12bit") Draw.volumeRender(histogram, mode="greyscale", prune=0)
def volumeRender(): histogram = DataParse.loadStack(300, 200, 3000, mode="8bit", segmented=False) Draw.volumeRender(histogram, mode="fullcolor", prune=0)