From ecff1d42a0622e99b68d4b4bdcac13aa4d41206e Mon Sep 17 00:00:00 2001 From: yilmaz <72473367+yilmaz7@users.noreply.github.com> Date: Sat, 24 Oct 2020 09:16:33 -0400 Subject: [PATCH 1/2] Update Enhancement_GAN.py --- Enhancement_GAN.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Enhancement_GAN.py b/Enhancement_GAN.py index 6f3a971..eb9330d 100644 --- a/Enhancement_GAN.py +++ b/Enhancement_GAN.py @@ -1,3 +1,8 @@ +#!/usr/bin/python3 + + + +#Libraries that we used in this python script import os import time import numpy as np @@ -7,6 +12,7 @@ import sys import nibabel import SimpleITK as sitk +import sys from keras.models import model_from_json # load GAN model here @@ -302,7 +308,7 @@ def enhance(config_file): if(len(sys.argv) != 2): print('Number of arguments should be 2. e.g.') print('python Enhancement_GAN.py config17/train_wt_ax.txt') - exit() + sys.exit()# config_file = str(sys.argv[1]) assert(os.path.isfile(config_file)) enhance(config_file) From 04c5513cbba224c650e4b279fde82acdf28d59a0 Mon Sep 17 00:00:00 2001 From: yilmaz <72473367+yilmaz7@users.noreply.github.com> Date: Sat, 24 Oct 2020 09:28:23 -0400 Subject: [PATCH 2/2] Update Enhancement_GAN.py --- Enhancement_GAN.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Enhancement_GAN.py b/Enhancement_GAN.py index eb9330d..d16e37c 100644 --- a/Enhancement_GAN.py +++ b/Enhancement_GAN.py @@ -303,14 +303,18 @@ def enhance(config_file): print(volume_name_enhanced) #print(data_num) - -if __name__ == '__main__': + +def main(): if(len(sys.argv) != 2): print('Number of arguments should be 2. e.g.') print('python Enhancement_GAN.py config17/train_wt_ax.txt') - sys.exit()# + sys.exit() #to safely exit & cleanup memory config_file = str(sys.argv[1]) assert(os.path.isfile(config_file)) enhance(config_file) +if __name__ == '__main__':main() + +#END of script +