<no title> — Normalization 0 documentation

    In [ ]:

    import os
    import sys
    import numpy as np
    import matplotlib.pyplot as plt
    import matplotlib.patches as patches
    from matplotlib import gridspec
    %matplotlib notebook

    In [2]:

    root_folder = os.path.dirname(os.getcwd())
    sys.path.append(root_folder)
    import NeuNorm as neunorm
    from NeuNorm.normalization import Normalization
    from NeuNorm.roi import ROI

    In [3]:

    path_im = '../data/sample'
    assert os.path.exists(path_im)

    In [4]:

    path_ob = '../data/ob/'
    ob1 = path_ob + '0001.tif'
    ob2 = path_ob + '0002.tif'
    assert os.path.exists(ob1)
    assert os.path.exists(ob2)

    In [5]:

    o_norm = Normalization()
    o_norm.load(folder=path_im)
    o_norm.load(file=[ob1, ob2], data_type='ob')

    In [6]:

    norm_roi = ROI(x0=3, y0=5, width=20, height=40)
    o_norm.normalization(roi=norm_roi)

    Out[6]:

    True

    In [7]:

    normalized_data = o_norm.data['normalized']

    In [8]:

    np.shape(normalized_data)

    Out[8]:

    (15, 100, 100)

    In [9]:

    roi_to_keep = ROI(x0=0, y0=0, width=2, height=2)
    o_norm.crop(roi=roi_to_keep)

    norm_crop = o_norm.data['normalized']
    np.shape(norm_crop)

    Out[9]:

    (15, 3, 3)

    In [ ]: