Ejemplo n.º 1
0
from random import shuffle

# Define the flags class for variables
FLAGS = tf.app.flags.FLAGS

# Define the data directory to use
home_dir = str(Path.home()) + '/PycharmProjects/Datasets/BreastData/Mammo/'
risk_dir = home_dir + 'RiskStudy/'
short_fu = risk_dir + '1yr_FU/Raw/'
brca_dir = home_dir + 'BRCA/'
calc_dir = home_dir + 'Calcs/Eduardo/'
chemo_dir = home_dir + 'Chemoprevention/'

sdl = SDL.SODLoader(data_root=home_dir)
sdd = SDD.SOD_Display()


def re_save_1yr(type='CC'):
    """
    Loads the 1 year followup chemoprevention files and resaves the CC and/or MLO DICOM
    :param box_dims: dimensions of the saved images
    :return:
    """

    # Load the filenames and randomly shuffle them
    path = '/media/stmutasa/Slow1/PycharmProjects/Datasets/BreastData/Mammo/RiskStudy/1yr_FU/Raw/'
    save_path_CC = '/media/stmutasa/Slow1/PycharmProjects/Datasets/BreastData/Mammo/RiskStudy/1yr_FU/Processed_CC/'
    save_path_All = '/media/stmutasa/Slow1/PycharmProjects/Datasets/BreastData/Mammo/RiskStudy/1yr_FU/Processed_MLO_CC/'
    filenames = sdl.retreive_filelist('**', True, path)
    shuffle(filenames)
Ejemplo n.º 2
0
import cv2
import datetime

from pathlib import Path
from random import shuffle
from Array2Gif import gif

# Define the flags class for variables
FLAGS = tf.app.flags.FLAGS

# Define the data directory to use
home_dir = str(Path.home()) + '/PycharmProjects/Datasets/HCC/'

# Utility classes
sdl = SDL.SODLoader(data_root=home_dir)
sdd = Display.SOD_Display()


def display_warps(box_dims=64, xforms=20):
    """
    We want to load all of the examples and perform affine warps, then display example images
    Dimensions to display
    number of warps to show
    """

    # Load the filenames and randomly shuffle them
    filenames = sdl.retreive_filelist('nii.gz', True,
                                      home_dir + 'HCC_registered/')
    shuffle(filenames)

    # Load labels