コード例 #1
0
def main():
    """
    utils.create_png_images:

    Creates PNGs for all the subjects in the subject list. The NIFTI images from where these PNGs are generated
    must have been downloaded first (step 1).

    Make sure that you set NUM_LABELS, HISTOLOGY_RANGE_MIN and HISTOLOGY_RANGE_MAX in the configuration file before
    creating running this step.

    The HISTOLOGY_RANGE_MIN and HISTOLOGY_RANGE_MAX parameters determine how histology values are mapped to labels.
    These two parameters correspond to cmin, and cmax in scipy.misc.bytescale
    See: https://docs.scipy.org/doc/scipy-0.18.1/reference/generated/scipy.misc.bytescale.html

    """

    config = dh_read_config(
        '/home/dcantor/projects/deephisto/code/config_neuronal_density.ini')
    #config = dh_read_config('/home/dcantor/projects/deephisto/code/config_field_fraction.ini')

    subjects = dh_load_subjects(config)
    utils = ImageUtils(config)

    dh_get_histo_range(config)

    # comment this for loop if you only want to run dh_get_histo_range. This will report the domain values (histology)
    for s in subjects:
        print s
        utils.create_png_images(s)
コード例 #2
0
def main():
    # config = dh_read_config('/home/dcantor/projects/deephisto/code/config_neuronal_density.ini')
    config = dh_read_config(
        '/home/dcantor/projects/deephisto/code/config_field_fraction.ini')

    subjects = dh_load_subjects(config)
    for s in subjects:
        dh_visual_inspection(config, s, 0, 0)
コード例 #3
0
def main():
    """
    This is the first step you need to run on your DeepHisto project.
    Use one of the configuration files or create your own.

    >> config_neuronal_densitiy.ini
    >> config_field_fraction.ini

    """
    config = dh_read_config('/home/dcantor/projects/deephisto/code/config_neuronal_density.ini')
    #config = dh_read_config('/home/dcantor/projects/deephisto/code/config_field_fraction.ini')

    subjects = dh_load_subjects(config)
    dog = ImageRetriever(config)
    for s in subjects:
        dog.retrieve(s)
コード例 #4
0
def main():
    config = dh_read_config('/home/dcantor/projects/deephisto/code/config_neuronal_density.ini')
    #config = dh_read_config('/home/dcantor/projects/deephisto/code/config_field_fraction.ini')

    dh_create_dataset(config)
コード例 #5
0
def main():
    #config = dh_read_config('/home/dcantor/projects/deephisto/code/config_neuronal_density.ini')
    #config = dh_read_config('/home/dcantor/projects/deephisto/code/config_field_fraction.ini')
    config = dh_read_config('/home/dcantor/projects/deephisto/code/config_neuronal_density_rt.ini')
    net = NetBuilder_fcn8(config)
    net.make()
コード例 #6
0
def main():
    config = dh_read_config(
        '/home/dcantor/projects/deephisto/code/config_neuronal_density.ini')
    #config = dh_read_config('/home/dcantor/projects/deephisto/code/config_field_fraction.ini')
    dh_unpack_annotations(config)
コード例 #7
0
ファイル: rename_annotations.py プロジェクト: d13g0/deephisto
import os

from deephisto import Locations

from config import dh_load_subjects, dh_read_config

#config = dh_read_config('/home/dcantor/projects/deephisto/code/config_neuronal_density.ini')
config = dh_read_config(
    '/home/dcantor/projects/deephisto/code/config_field_fraction.ini')

locations = Locations(config)
subjects = dh_load_subjects(config)

for subject in subjects:
    locations.set_subject(subject)
    files = os.listdir(locations.MASK_DIR)
    print
    print locations.MASK_DIR
    for f in files:
        if f.startswith('A_'):
            A, B, C, I = f.split('_')
            I1, _ = I.split('.')
            change = 'A_H_%s.png' % I1

            source = locations.MASK_DIR + '/' + f
            target = locations.MASK_DIR + '/' + change
            print source, target
            os.rename(source, target)