Commit cc8a7d78 authored by sjromuel's avatar sjromuel
Browse files

d

parent bfa5a3d6
......@@ -19,7 +19,7 @@ class mrt_unet(BaseNetwork):
test_patients=(1, 2),
val_patients= (3, 4, 5, 6),
number_patients=4,
img_path="../data/npy/",
img_path="data/npy/",
shrink_data=True,
newSize=(512, 512),
lr=1e-4,
......@@ -62,30 +62,16 @@ class mrt_unet(BaseNetwork):
X_img_list = []
GT_img_list = []
# thresh_img_list = []
if transfer:
for elem in full_list:
if elem.startswith('P' + str(transpats[0]).zfill(2)) or elem.startswith('P' + str(transpats[1]).zfill(2)):
if elem.endswith(self.gt_type+".gipl.npy"):
GT_img_list.append(elem[0:4]+"segmr"+elem[-9:])
elif elem.endswith("T1.gipl.npy"):
X_img_list.append(elem)
else:
if elem.endswith("T1.gipl.npy"):
X_img_list.append(elem)
if self.gt_type == "thresh":
X_img_list.append(elem)
X_img_list.append(elem)
elif elem.endswith(self.gt_type+".gipl.npy"):
GT_img_list.append(elem)
else:
for elem in full_list:
if elem.endswith("T1.gipl.npy"):
for elem in full_list:
if elem.endswith("T1.gipl.npy"):
X_img_list.append(elem)
if self.gt_type == "thresh":
X_img_list.append(elem)
if self.gt_type == "thresh":
X_img_list.append(elem)
X_img_list.append(elem)
elif elem.endswith(self.gt_type+".gipl.npy"):
GT_img_list.append(elem)
X_img_list.append(elem)
elif elem.endswith(self.gt_type+".gipl.npy"):
GT_img_list.append(elem)
list.sort(X_img_list)
list.sort(GT_img_list)
......@@ -94,6 +80,7 @@ class mrt_unet(BaseNetwork):
return X_img_list, GT_img_list
def augment_slice(self, image, image_name, augmentation_type='normal'):
augmented_image = image
if augmentation_type=='fliplr':
augmented_image = np.fliplr(image)
......@@ -110,8 +97,6 @@ class mrt_unet(BaseNetwork):
elif augmentation_type == 'normal':
augmented_image = image
else:
augmented_image = image
return augmented_image
#def main(argv):
......@@ -121,7 +106,7 @@ def main():
test_patients = (1, 2)
val_patients = (3, 4, 5, 6)
number_patients = 17
img_path = "../data/npy/"
img_path = "data/npy/"
shrink_data = True # needs to be debugged -> only works if true. See autoencoder_main.py
newSize = (512, 512) # only if shrink data = True
lr = 1e-4
......@@ -137,7 +122,7 @@ def main():
continue_training = False
e = 0
gt_type = "ctseg_gt"
modelname = "mr_unet_cv_segmr"
modelname = "mr_unet_cv_ctseg"
###############################
......
......@@ -36,8 +36,8 @@ for patientnumber in range(17):
elif filename.startswith('P09'):
corr_patient_array = patient_array[1:, :, :]
elif filename.startswith('P11'):
corr_patient_array = patient_array[2:, :, :]
#elif filename.startswith('P11'):
# corr_patient_array = patient_array[:, :, :]
elif filename.startswith('P12'):
corr_patient_array = patient_array[:36, :, :]
......@@ -85,8 +85,8 @@ for patientnumber in range(17):
elif filename.startswith('P09'):
corr_patient_array = patient_array[1:, :, :]
elif filename.startswith('P11'):
corr_patient_array = patient_array[2:, :, :]
#elif filename.startswith('P11'):
# corr_patient_array = patient_array[2:, :, :]
elif filename.startswith('P12'):
corr_patient_array = patient_array[:36, :, :]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment