Commit c6767be4 authored by sjromuel's avatar sjromuel
Browse files

f

parent 51a653c8
......@@ -201,8 +201,8 @@ def main():
log.write("Start Cross Validation Training \r")
log.close()
print("Start Cross Validation Training")
for validation_round in specificmodels:
#for validation_round in range(number_patients//2):
#for validation_round in specificmodels:
for validation_round in range(number_patients//2):
log = open("logs" + modelname + ".txt", "a+")
test_patients = (2*validation_round+1, 2*validation_round+2)
vallist= list(range(1, number_patients+1)) + list(range(1, number_patients+1))
......
import numpy as np
import matplotlib.pyplot as plt
gt_path = "data/npy/"
threshs = ["100", "250", "400"]
......@@ -8,7 +9,15 @@ for patientnumber in range(17):
filename = "P"+str(patientnumber+1).zfill(2)+"_seg.gipl.npy"
print(filename)
patient_array = np.load(gt_path+filename)
'''flippedarray = np.flip(patient_array)
fig = plt.figure()
fig.add_subplot(1, 2, 1)
plt.imshow(patient_array[5, :, :], cmap=plt.cm.bone)
fig.add_subplot(1, 2, 2)
plt.imshow(flippedarray[5, :, :], cmap=plt.cm.bone)
plt.show()'''
patient_array = np.flip(patient_array)
if filename.startswith('P01'):
corr_patient_array = patient_array[2:27, :, :]
......@@ -48,6 +57,8 @@ for patientnumber in range(17):
else:
corr_patient_array = patient_array
corr_patient_array = np.flip(corr_patient_array)
np.save(gt_path+"P"+str(patientnumber+1).zfill(2)+"_mr_ctseg_gt.gipl", corr_patient_array)
thresh_gt_path = "data/npy_thresh/"
......@@ -56,7 +67,9 @@ for patientnumber in range(17):
for thresh in threshs:
filename = "P"+str(patientnumber+1).zfill(2)+"_"+thresh+"_thresh.gipl.npy"
print(filename)
patient_array = np.load(thresh_gt_path+filename)
patient_array = np.flip(patient_array)
if filename.startswith('P01'):
corr_patient_array = patient_array[2:27, :, :]
......@@ -97,4 +110,6 @@ for patientnumber in range(17):
else:
corr_patient_array = patient_array
corr_patient_array = np.flip(corr_patient_array)
np.save(thresh_gt_path+"P"+str(patientnumber+1).zfill(2)+"_"+thresh+"_mr_ctthresh_gt.gipl", corr_patient_array)
\ No newline at end of file
......@@ -9,14 +9,29 @@ import matplotlib.pyplot as plt
from scipy import ndimage
from datetime import datetime
mr_img = np.load("data/npy/P01_segmr.gipl.npy")
ct_img = np.load("data/npy/P01_seg.gipl.npy")
mr_img = np.load("data/npy/P03_mr_T1.gipl.npy")
ct_img = np.load("data/npy/P03_mr_ctseg_gt.gipl.npy")
mrseg = np.load("data/npy/P03_segmr.gipl.npy")
print(np.shape(mr_img))
print(np.shape(ct_img))
print(np.shape(mrseg))
for i in range(18):
print(i)
fig = plt.figure()
fig.add_subplot(1, 3, 1)
plt.imshow(ct_img[i,:, :], cmap=plt.cm.bone)
plt.title('CT Seg')
fig.add_subplot(1, 3, 2)
plt.imshow(mr_img[i,:, :], cmap=plt.cm.bone)
plt.title('MR Image')
fig.add_subplot(1, 3, 3)
plt.imshow(mrseg[i,:, :], cmap=plt.cm.bone)
plt.title('MR Segmentation')
# print(i)
plt.show()
print(np.shape(mr_img))
print(np.min(mr_img))
print(np.max(mr_img))
......
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