Giter VIP home page Giter VIP logo

jnifti's People

Contributors

fangq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jnifti's Issues

the colin27_zlib.bnii sample has an uint8 Affine matrix

>> jnii = loadjnifti('colin27_zlib.bnii')
jnii = 
  struct with fields:

    NIFTIHeader: [1×1 struct]
      NIFTIData: [181×217×181 uint8]
>> jnii.NIFTIHeader.Affine
ans =
  3×4 uint8 matrix
   1   0   0   0
   1   0   0   0
   1   0   0   0

I guess that the the srow_x, srow_y and srow_z arrays are used to make the Affine matrix. According to https://brainder.org/2012/09/23/the-nifti-file-format/ these arrays should be float (i.e., single precision).

Looking more critically at the correspondence between nifti and jnifti, I would actually say that there should not be a 3x4 Affine array, but that it should have the 1x4 srow_x, srow_y and srow_z arrays.

the colin27 samples do not specify the offset (translation) in the SForm

this is what I expect

>> mri = ft_read_mri('~/matlab/fieldtrip/template/anatomy/single_subj_T1_1mm.nii')
the coordinate system appears to be 'scanras'
mri = 
  struct with fields:

          dim: [181 217 181]
      anatomy: [181×217×181 double]
          hdr: [1×1 struct]
    transform: [4×4 double]
         unit: 'mm'
>> mri.transform
ans =
     1     0     0   -91
     0     1     0  -127
     0     0     1   -73
     0     0     0     1

and this is what I get

>> mri = ft_read_mri('colin27_zlib.jnii')
mri = 
  struct with fields:

          hdr: [1×1 struct]
      anatomy: [181×217×181 uint8]
          dim: [181 217 181]
         unit: 'mm'
     coordsys: 'scanras'
    transform: [4×4 double]
>> mri.transform
ans =
     1     0     0     0
     0     1     0     0
     0     0     1     0
     0     0     0     1

the colin27_zlib.bnii sample file has an incorrect Affine matrix

>> jnii = loadjnifti('colin27_zlib.bnii')
jnii = 
  struct with fields:

    NIFTIHeader: [1×1 struct]
      NIFTIData: [181×217×181 uint8]

>> jnii.NIFTIHeader.Affine
ans =
  3×4 uint8 matrix
   1   0   0   0
   1   0   0   0
   1   0   0   0

I had expected it to be eye(3,4), consistent with the colin27_zlib.jnii sample.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.