Exemplo n.º 1
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
Exemplo n.º 3
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
Exemplo n.º 4
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
Exemplo n.º 5
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
Exemplo n.º 6
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