@@ -45,7 +45,7 @@ def distinctiveness(img, sigma):
45
45
return D .view (1 , 1 , * D .shape ) # torch image format (NxCxDxHxW)
46
46
47
47
48
- def foerstner_keypoints (img : torch .Tensor , roi : torch .Tensor , sigma : float = 1.5 , distinctiveness_threshold : float = 1e-8 , show = False ):
48
+ def foerstner_keypoints_wrong (img : torch .Tensor , roi : torch .Tensor , sigma : float = 1.5 , distinctiveness_threshold : float = 1e-8 , show = False ):
49
49
print ('start' )
50
50
start = time .time ()
51
51
@@ -219,6 +219,18 @@ def compute_point_features(img, fissures, lobes, mask, out_dir, case, sequence):
219
219
torch .save (mind_features .cpu (), os .path .join (out_dir ,
220
220
f'{ case } _mind{ "_ssc" if ssc else "" } _{ sequence } .pth' ))
221
221
222
+ # # VISUALIZATION
223
+ # for i in range(-5, 5):
224
+ # chosen_slice = img_tensor.squeeze().shape[1] // 2 + i
225
+ # plt.imshow(img_tensor.squeeze()[:, chosen_slice].cpu(), 'gray')
226
+ # keypoints_slice = kp_cpu[kp_cpu[:, 1] == chosen_slice]
227
+ # plt.plot(keypoints_slice[:, 2], keypoints_slice[:, 0], '+')
228
+ # plt.gca().invert_yaxis()
229
+ # plt.axis('off')
230
+ # plt.tight_layout()
231
+ # plt.savefig(f'results/EMPIRE02_fixed_keypoints_{i+5}.png', bbox_inches='tight', dpi=300, pad_inches=0)
232
+ # plt.show()
233
+
222
234
223
235
if __name__ == '__main__' :
224
236
data_dir = '/home/kaftan/FissureSegmentation/data'
0 commit comments