[Neuroimaging] Extracting a network from a nifti with 6 others

Serafeim Loukas seralouk at gmail.com
Mon Nov 25 04:40:42 EST 2019


Why don’t you just open the file and mask it (e.g. put 1s where voxel values are 5) for each network, then save it and then repeat.
It should be easy.

> On 25 Nov 2019, at 03:09, Angus Campbell <angus.j.g.campbell at gmail.com> wrote:
> 
> I have a nifti file which contains 7 networks.  I want to extract each one as a seperate image so I can pull the zscore of each mni coordinate to make a binary mask.
> 
> Is there any information in the header i have missed that would let me do this?  How can I pull the data I want out as an array?
> 
>  header=Buckner7net_img.header
> 
> print(header)
> <class 'nibabel.nifti1.Nifti1Header'> object, endian='<'
> sizeof_hdr      : 348
> data_type       : b'          '
> db_name         : b'                  '
> extents         : 0
> session_error   : 0
> regular         : b' '
> dim_info        : 32
> dim             : [  4 256 256 256   1   1   1   1]
> intent_p1       : 0.0
> intent_p2       : 0.0
> intent_p3       : 0.0
> intent_code     : none
> datatype        : float32
> bitpix          : 32
> slice_start     : 0
> pixdim          : [-1.  1.  1.  1.  0.  0.  0.  0.]
> vox_offset      : 0.0
> scl_slope       : nan
> scl_inter       : nan
> slice_end       : 0
> slice_code      : unknown
> xyzt_units      : 18
> cal_max         : 7.0
> cal_min         : 0.0
> slice_duration  : 0.0
> toffset         : 0.0
> glmax           : 0
> glmin           : 0
> descrip         : b'FreeSurfer matlab                                                               '
> aux_file        : b'                        '
> qform_code      : scanner
> sform_code      : scanner
> quatern_b       : 0.0
> quatern_c       : 0.70710677
> quatern_d       : -0.70710677
> qoffset_x       : 127.0
> qoffset_y       : -145.0
> qoffset_z       : 147.0
> srow_x          : [ -1.   0.   0. 127.]
> srow_y          : [   0.    0.    1. -145.]
> srow_z          : [  0.  -1.   0. 147.]
> intent_name     : b'huh?            '
> magic           : b'n+1'  
> _______________________________________________
> Neuroimaging mailing list
> Neuroimaging at python.org
> https://mail.python.org/mailman/listinfo/neuroimaging

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20191125/961055d3/attachment.html>


More information about the Neuroimaging mailing list