PennLINC / qsiprep

Preprocessing of diffusion MRI
http://qsiprep.readthedocs.io
BSD 3-Clause "New" or "Revised" License
140 stars 58 forks source link

Custom Atlases #224

Closed rtybanana closed 3 years ago

rtybanana commented 3 years ago

Hi,

I've been trying to use a custom atlas in qsirecon, following the docs here; however, I can't seem to get it to work and I just want to see if you have any suggestions because I'm pretty new to atlas registration and orientation etc.

So we a want to use either the DiFuMo or Craddock atlases which we have acquired through the nilearn atlas fetcher. fslhd showed that the sform and orientation weren't in format required by qsirecon so I tried some things to correct that.

I registered the custom atlas to the MNI152NLin2009cAsym space which you provide here using flirt and then zeroed the sform using fslorient -setsform. This made the headers at least look a bit more like the required format; however, I did notice that the custom atlas still has four dimensions whereas all of the examples of qsirecon compatible atlases have three.

This is the output from fslhd for the Craddock atlas after the process described above:

filename        craddock_lps.nii.gz

sizeof_hdr      348
data_type       INT16
dim0            4
dim1            193
dim2            229
dim3            193
dim4            43
dim5            1
dim6            1
dim7            1
vox_units       mm
time_units      s
datatype        4
nbyper          2
bitpix          16
pixdim0         1.000000
pixdim1         1.000000
pixdim2         1.000000
pixdim3         1.000000
pixdim4         1.000000
pixdim5         0.000000
pixdim6         0.000000
pixdim7         0.000000
vox_offset      352
cal_max         0.000000
cal_min         0.000000
scl_slope       1.000000
scl_inter       0.000000
phase_dim       0
freq_dim        0
slice_dim       0
slice_name      Unknown
slice_code      0
slice_start     0
slice_end       0
slice_duration  0.000000
toffset         0.000000
intent          Unknown
intent_code     0
intent_name
intent_p1       0.000000
intent_p2       0.000000
intent_p3       0.000000
qform_name      MNI_152
qform_code      4
qto_xyz:1       -1.000000 0.000000 0.000000 96.000000
qto_xyz:2       0.000000 -1.000000 0.000000 96.000000
qto_xyz:3       0.000000 0.000000 1.000000 -78.000000
qto_xyz:4       0.000000 0.000000 0.000000 1.000000
qform_xorient   Right-to-Left
qform_yorient   Anterior-to-Posterior
qform_zorient   Inferior-to-Superior
sform_name      MNI_152
sform_code      4
sto_xyz:1       -1.000000 0.000000 0.000000 96.000000
sto_xyz:2       0.000000 -1.000000 0.000000 96.000000
sto_xyz:3       0.000000 0.000000 1.000000 -78.000000
sto_xyz:4       0.000000 0.000000 0.000000 1.000000
sform_xorient   Right-to-Left
sform_yorient   Anterior-to-Posterior
sform_zorient   Inferior-to-Superior
file_type       NIFTI-1+
file_code       1
descrip         6.0.4:ddd0a010
aux_file

Any help would be massively appreciated.

Thanks, Rory

rtybanana commented 3 years ago

Ok, I've done a little more research and learned about the difference between a probablistic atlas (4D) and a labelled or "hard" atlas which is 3D. It seems like the nilearn atlases are in the probablistic format so I need to convert it somehow.