Skip to content

Commit

Permalink
rename compute_vox2ras to mgh_vox2ras
Browse files Browse the repository at this point in the history
  • Loading branch information
dfsp-spirit committed Feb 12, 2021
1 parent 51a885d commit 4fcef96
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/FreeSurfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions src/fs_mgh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,18 @@ end


"""
compute_vox2ras(mgh::Mgh)
mgh_vox2ras(mgh::Mgh)
Compute the VOX2RAS matrix for an Mgh instance. Requires valid RAS header data.
# Examples
```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
Expand Down
2 changes: 1 addition & 1 deletion test/test_fs_mgh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4fcef96

Please sign in to comment.