-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest_fs_label.jl
32 lines (24 loc) · 1.2 KB
/
test_fs_label.jl
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
using DataFrames
@testset "A FreeSurfer surface label file can be read" begin
LABEL_FILE = joinpath(Base.source_dir(), "data/subjects_dir/subject1/label/lh.entorhinal_exvivo.label")
fs_label = read_label(LABEL_FILE)
@test typeof(fs_label) == DataFrames.DataFrame
@test Base.length(fs_label[!, "vertex_index"]) == 1085
@test fs_label[!, "vertex_index"][1] == 88791
@test fs_label[!, "vertex_index"][1085] == 149165
end
@testset "A FreeSurfer surface label file can be read, written and re-read" begin
LABEL_FILE = joinpath(Base.source_dir(), "data/subjects_dir/subject1/label/lh.entorhinal_exvivo.label")
fs_label = read_label(LABEL_FILE)
@test typeof(fs_label) == DataFrames.DataFrame
@test Base.length(fs_label[!, "vertex_index"]) == 1085
@test fs_label[!, "vertex_index"][1] == 88791
@test fs_label[!, "vertex_index"][1085] == 149165
tf = tempname()
write_label(tf, fs_label)
fs_label_reread = read_label(tf)
@test typeof(fs_label_reread) == DataFrames.DataFrame
@test Base.length(fs_label_reread[!, "vertex_index"]) == 1085
@test fs_label_reread[!, "vertex_index"][1] == 88791
@test fs_label_reread[!, "vertex_index"][1085] == 149165
end