Skip to content

Commit 3bf9137

Browse files
committed
minor changes
1 parent 2ff9736 commit 3bf9137

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

data_processing/point_features.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def distinctiveness(img, sigma):
4545
return D.view(1, 1, *D.shape) # torch image format (NxCxDxHxW)
4646

4747

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):
4949
print('start')
5050
start = time.time()
5151

@@ -219,6 +219,18 @@ def compute_point_features(img, fissures, lobes, mask, out_dir, case, sequence):
219219
torch.save(mind_features.cpu(), os.path.join(out_dir,
220220
f'{case}_mind{"_ssc" if ssc else ""}_{sequence}.pth'))
221221

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+
222234

223235
if __name__ == '__main__':
224236
data_dir = '/home/kaftan/FissureSegmentation/data'

0 commit comments

Comments
 (0)