diff --git a/src/FreeSurfer.jl b/src/FreeSurfer.jl index dacf10e..257d458 100644 --- a/src/FreeSurfer.jl +++ b/src/FreeSurfer.jl @@ -6,7 +6,7 @@ export read_curv, write_curv, Curv, CurvHeader export read_surf, num_vertices, num_faces, export_to_obj, BrainMesh, FsSurface, FsSurfaceHeader export read_label export read_annot, FsAnnot, ColorTable, regions, vertex_regions, region_vertices, label_from_rgb -export read_mgh, Mgh, MghHeader, compute_vox2ras +export read_mgh, Mgh, MghHeader, mgh_vox2ras include("./utils.jl") include("./fs_common.jl") diff --git a/src/fs_mgh.jl b/src/fs_mgh.jl index 3f83cb9..4498263 100644 --- a/src/fs_mgh.jl +++ b/src/fs_mgh.jl @@ -120,7 +120,7 @@ end """ - compute_vox2ras(mgh::Mgh) + mgh_vox2ras(mgh::Mgh) Compute the VOX2RAS matrix for an Mgh instance. Requires valid RAS header data. @@ -128,10 +128,10 @@ Compute the VOX2RAS matrix for an Mgh instance. Requires valid RAS header data. ```julia-repl julia> mgh_file = joinpath(tdd(), "subjects_dir/subject1/mri/brain.mgz"); julia> mgh = read_mgh(mgh_file); -julia> compute_vox2ras(mgh) +julia> mgh_vox2ras(mgh) ``` """ -function compute_vox2ras(mgh::Mgh) +function mgh_vox2ras(mgh::Mgh) hdr = mgh.header if hdr.is_ras_good != 1 diff --git a/test/test_fs_mgh.jl b/test/test_fs_mgh.jl index 4df6386..8b5505a 100644 --- a/test/test_fs_mgh.jl +++ b/test/test_fs_mgh.jl @@ -37,7 +37,7 @@ end # Use FreeSurfer's `mri_info` command line tool on the brain.mgz file to get this info: expected_vox2ras = Base.reshape([-1.,0,0,0, 0,0,-1,0, 0,1,0,0, 127.5,-98.6273,79.0953,1], (4,4)) - vox2ras = compute_vox2ras(mgh) + vox2ras = mgh_vox2ras(mgh) @test Base.length(vox2ras) == 16 @test all(isapprox.(vox2ras, expected_vox2ras, atol=0.05)) end