Commit ef9d396b authored by sjromuel's avatar sjromuel
Browse files

f

parent 9bcd9389
......@@ -67,7 +67,7 @@ class mrt_unet(BaseNetwork):
for elem in full_list:
if elem.endswith("T1.gipl.npy"):
X_img_list.append(elem)
if self.gt_type == "ctthresh_gt" or self.gt_type == "_mr_ctunetpred":
if self.gt_type == "ctthresh_gt":
X_img_list.append(elem)
X_img_list.append(elem)
elif elem.endswith(self.gt_type + ".gipl.npy"):
......
......@@ -108,7 +108,7 @@ class BaseNetwork:
else:
if elem.endswith("ct.gipl.npy"):
X_img_list.append(elem)
if self.gt_type == "thresh" or self.gt_type == "_mr_ctunetpred":
if self.gt_type == "thresh":
X_img_list.append(elem)
X_img_list.append(elem)
elif elem.endswith(self.gt_type+".gipl.npy"):
......@@ -117,7 +117,7 @@ class BaseNetwork:
for elem in full_list:
if elem.endswith("ct.gipl.npy"):
X_img_list.append(elem)
if self.gt_type == "thresh" or self.gt_type == "_mr_ctunetpred":
if self.gt_type == "thresh":
X_img_list.append(elem)
X_img_list.append(elem)
elif elem.endswith(self.gt_type+".gipl.npy"):
......
......@@ -21,7 +21,7 @@ def main():
root = tk.Tk()
root.withdraw()
file_path = filedialog.askopenfilename(initialdir="saves/mr_unet_cv_ctthresh/")
file_path = filedialog.askopenfilename(initialdir="finalResults/complete_segmr/mr_unet_cv_ctthresh")
file_path = file_path[:-9]
print(file_path)
......@@ -196,12 +196,12 @@ def main():
y_true = onehotencode(y_true)
y_pred = Unet(image, weights, filter_multiplier, training=False)
if detailed_images:
if npys3d:
if y_pred3d == []:
y_pred3d = y_pred[:,:,:,0].numpy()
else:
y_pred3d = np.append(y_pred[:,:,:,0].numpy(), y_pred3d, axis=0)
print(np.shape(y_pred3d))
#print(np.shape(y_pred3d))
# print(tf.shape(y_pred), tf.shape(y_true))
#y_true = onehotencode(tf.reshape(y_true, (1, 512, 512, 1)), autoencoder=True)
......@@ -271,8 +271,9 @@ def main():
y_pred[0, :, :, 0], cmap=plt.cm.bone)
if npys3d:
np.save(img_savepath + "P" + str(TP_num).zfill(2) + "_pred3D", y_pred3d)
np.save("data/npy/" + "P" + str(TP_num).zfill(2) + "_mr_ctunetpred.gipl", y_pred3d)
#np.save(img_savepath + "P" + str(TP_num).zfill(2) + "_pred3D", y_pred3d)
np.save("data/npy_thresh/" + "P" + str(TP_num).zfill(2) + "_mr_ctunetpred.gipl", y_pred3d)
print("ypred shape: ", np.shape(y_pred3d))
#plt.show()
#print(test_loss)
print("TestLoss Mean for P", test_patients[j], ": ", np.mean(test_loss))
......
......@@ -9,7 +9,14 @@ import matplotlib.pyplot as plt
from scipy import ndimage
from datetime import datetime
mr_img = np.load("data/npy/P03_mr_T1.gipl.npy")
img = np.load("data/npy_thresh/P01_mr_ctunetpred.gipl.npy")
print(np.shape(img))
plt.imshow(img[5,:, :], cmap=plt.cm.bone)
plt.show()
'''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")
......@@ -30,7 +37,7 @@ for i in range(18):
plt.imshow(mrseg[i,:, :], cmap=plt.cm.bone)
plt.title('MR Segmentation')
# print(i)
plt.show()
plt.show()'''
......
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