-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.m
49 lines (24 loc) · 970 Bytes
/
Main.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
clear all
close all
%%define paths PC
pathimage = 'C:\Users\boazk\Desktop\team challenge\Algo\Team challenge 2021\Scoliose\';
pathlandm = 'C:\Users\boazk\Desktop\team challenge\Algo\Team challenge 2021\Landmarks\';
%%define paths laptop
% pathimage = 'C:\School\Master\Jaar 2\Q3\TC\Team challenge 2021\Scoliose\';
% pathlandm = 'C:\School\Master\Jaar 2\Q3\TC\Team challenge 2021\Landmarks\';
nameimage = '1preop.nii';
namelandm = '1preop.xml';
s = strcat(pathimage,nameimage);
s2 = strcat(pathlandm,namelandm);
%%read in .nii and landmarks file
nii = niftiread(s);
landmarks_struct = xml2struct(s2);
%%extract landmarks
landmarks = getlandmarks(landmarks_struct);
landmarks = round(landmarks);
%%visualize landmarks
landmark_slice = landmarks(1,3);
slice_interval = 10;
[nii2, Vertebra_body_points, Spinal_canal_points, Side_Vertebra_body_points] = getlandmarkcoordinates(nii, landmark_slice, landmarks, slice_interval);
%%
volumeViewer(nii2);