Skip to content

mean of 3d nifti does not match calc by fslstats and 3dBrickStat #70

@WillForan

Description

@WillForan

Thanks for this package! I'm excited to be able to use Julia in my analysis.

I'm sanity checking and measuring performance here, with this nifti.

The mean of that 3d dataset is 838.206399 (according to fsl and AFNI tools), but mean(niread('mynii.nii.gz')) reports 836.1491.

I'm not sure how to narrow down where the discrepancy is coming from.

fslstats wf-mp2rage-7t_2017087.nii.gz -m
 838.206399 

3dBrickStat -slow -mean wf-mp2rage-7t_2017087.nii.gz
 838.206       


scripts/niimean.jl
 836.1491

cat scripts/niimean.jl 
#!/usr/bin/env julia
using Statistics
using NIfTI
ni = niread("wf-mp2rage-7t_2017087.nii.gz");
print(mean(ni))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions