示例#1
0
def colorise(counts):
    counts = np.reshape(counts, (counts.shape[0], counts.shape[1]))
    print_histogram(counts)
    colormap = np.array([(0, 0, 0), (0, 128, 0), (128, 0, 0), (0, 0, 128)])
    #outarray = np.zeros((counts.shape[0], counts.shape[1], 3), dtype=np.uint8)
    outarray = colormap[counts]
    apply_npcolormap(outarray, counts, colormap)
    return outarray
示例#2
0
def colorise(counts):
    counts = np.reshape(counts, (counts.shape[0], counts.shape[1]))

    colormap = make_npcolormap(MAX_COUNT+1,
                               [Color('black'), Color('darkblue'), Color('green'), Color('cyan'), Color('yellow'), Color('black')],
                               [16, 16, 32, 32, 128])

    outarray = np.zeros((counts.shape[0], counts.shape[1], 3), dtype=np.uint8)
    apply_npcolormap(outarray, counts, colormap)
    return outarray
def colorise(counts):
    counts = np.reshape(counts, (counts.shape[0], counts.shape[1]))
    max_count = int(np.max(counts))
    colormap = make_npcolormap(
        max_count + 1,
        [Color(0), Color('darkblue'),
         Color('yellow'),
         Color(1)], [0.5, 2, 7])
    outarray = np.zeros((counts.shape[0], counts.shape[1], 3), dtype=np.uint8)
    apply_npcolormap(outarray, counts, colormap)
    return outarray
示例#4
0
def colorise(counts):
    counts = np.reshape(counts, (counts.shape[0], counts.shape[1]))

    colormap = make_npcolormap(MAX_COUNT + 1, [
        Color('black'),
        Color('red'),
        Color('orange'),
        Color('yellow'),
        Color('white')
    ], [16, 8, 32, 128])

    outarray = np.zeros((counts.shape[0], counts.shape[1], 3), dtype=np.uint8)
    apply_npcolormap(outarray, counts, colormap)
    return outarray
示例#5
0
def colorise(counts):
    counts = np.reshape(counts, (counts.shape[0], counts.shape[1]))

    colormap = make_npcolormap(
        int(np.max(counts)) + 1, [
            Color('black'),
            Color('cadetblue'),
            Color('yellow'),
            Color('white'),
            Color('white')
        ], [50, 100, 100, 102400])

    outarray = np.zeros((counts.shape[0], counts.shape[1], 3), dtype=np.uint8)
    apply_npcolormap(outarray, counts, colormap)
    return outarray
示例#6
0
def colorise(counts):
    counts = np.reshape(counts, (counts.shape[0], counts.shape[1]))

    colormap = make_npcolormap(
        int(np.max(counts)) + 1, [
            Color('firebrick'),
            Color('goldenrod'),
            Color('lime'),
            Color('green'),
            Color('darkgreen'),
            Color('white')
        ], [5, 5, 5, 10, 10240])

    outarray = np.zeros((counts.shape[0], counts.shape[1], 3), dtype=np.uint8)
    apply_npcolormap(outarray, counts, colormap)
    return outarray
示例#7
0
def colorise(counts):
    counts = np.reshape(counts, (counts.shape[0], counts.shape[1]))
    power_counts = np.power(counts, 0.25)
    maxcount = np.max(power_counts)
    normalised_counts = (power_counts * 1023 / max(maxcount, 1)).astype(
        np.uint32)

    colormap = make_npcolormap(
        1024, [Color('black'),
               Color('green'),
               Color('yellow'),
               Color('red')])

    outarray = np.zeros((counts.shape[0], counts.shape[1], 3), dtype=np.uint8)
    apply_npcolormap(outarray, normalised_counts, colormap)
    return outarray