from keras.initializers import Constant import nibabel as nib from scipy import ndimage from sklearn.model_selection import KFold import skimage.transform import tensorflow as tf import matplotlib as mptlib #mptlib.use('TkAgg') import matplotlib.pyplot as plt import settings from settings import process_options, perform_setup (options, args) = process_options() IMG_DTYPE, SEG_DTYPE, _globalnpfile, _globalexpectedpixel, _nx, _ny = perform_setup( options) print('database file: %s ' % settings._globalnpfile) from setupmodel import GetDataDictionary, BuildDB from trainmodel import TrainModel from predictmodel import PredictModel from kfolds import OneKfold, Kfold if options.builddb: BuildDB() if options.kfolds > 1: if options.idfold > -1: databaseinfo = GetDataDictionary(options.dbfile) OneKfold(i=options.idfold, datadict=databaseinfo) else: Kfold()
import numpy as np import csv import sys import os import settings from settings import process_options, perform_setup (options, args) = process_options() IMG_DTYPE, SEG_DTYPE, _nx, _ny = perform_setup(options) # from setupmodel import GetDataDictionary, BuildDB from trainmodel import TrainModel from predictmodel import PredictCSV, PredictNifti from kfolds import OneKfold, Kfold from generator import * if ((not options.trainmodel) and (not options.predictmodel)): print("parser error") quit() if options.trainmodel: if options.liver: if not options.datafiles_liver: print('no list of liver .npy files given for training') quit() else: saveloclist = options.datafiles_liver elif options.tumor: if not options.datafiles_tumor: print('no list of tumor .npy files given for training')