Does the Defacing algorithm in mne_bids require freesurfer processed files for defacing?
I used a nifti file converted using AFNI to display the fiducials. The landmarks appear correct (our anatomical positions and head coils are the same - so NAS is not the anatomical nasion). When I use defacing=True, too much of the head is removed. I can import this same nifti file into freesurfer and do the same fiducial plot and defacing. The defacing algorithm works fine with the T1.mgz file as an input. Additionally if I convert the T1.mgz file to nifti, the algorithm still works, so it does not appear to be a nifti issue. As you can see the fiducial locations are the same in all images.
Code used - From mne-bids examples
>>
t1w_bids_path = write_anat(
image=t1_fname, # path to the MRI scan
bids_path=bids_path,
raw=raw, # the raw MEG data file connected to the MRI
trans=trans, # our transformation matrix
deface={‘inset’:0},
overwrite=True,
verbose=True # this will print out the sidecar file
)
anat_dir = t1w_bids_path.directory
##<<
Below are the “info” outputs from the freesurfer generated nifti and afni generated nifti. The voxel sizes appear the same, but the number of slices are not. The translation column also appears to be different.
**# Info for dataset created using >> mri_convert T1.mgz T1.nii **
mri_info T1.nii
Volume information for T1.nii
type: nii
dimensions: 256 x 256 x 256
voxel sizes: 1.000000, 1.000000, 1.000000
type: UCHAR (0)
fov: 256.000
dof: 0
xstart: -128.0, xend: 128.0
ystart: -128.0, yend: 128.0
zstart: -128.0, zend: 128.0
TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees
nframes: 1
PhEncDir: UNKNOWN
FieldStrength: 0.000000
ras xform present
xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = 1.0390
: x_a = 0.0000, y_a = 0.0000, z_a = 1.0000, c_a = 27.3820
: x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = -13.1950
Orientation : LIA
Primary Slice Direction: coronal
voxel to ras transform:
-1.0000 0.0000 0.0000 129.0390
0.0000 0.0000 1.0000 -100.6180
0.0000 -1.0000 0.0000 114.8050
0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant -1
ras to voxel transform:
-1.0000 -0.0000 -0.0000 129.0390
-0.0000 -0.0000 -1.0000 114.8050
-0.0000 1.0000 -0.0000 100.6180
-0.0000 -0.0000 -0.0000 1.0000
##AFNI conversion to nifti. File used as input to the Freesurfer recon
mri_info APBWVFAR.nii
Volume information for APBWVFAR.nii
type: nii
dimensions: 256 x 256 x 208
voxel sizes: 1.000000, 1.000000, 1.000000
type: SHORT (4)
fov: 256.000
dof: 0
xstart: -128.0, xend: 128.0
ystart: -128.0, yend: 128.0
zstart: -104.0, zend: 104.0
TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees
nframes: 1
PhEncDir: UNKNOWN
FieldStrength: 0.000000
ras xform present
xform info: x_r = -0.0000, y_r = -0.0000, z_r = 1.0000, c_r = 1.0390
: x_a = -1.0000, y_a = -0.0000, z_a = -0.0000, c_a = 27.3820
: x_s = 0.0000, y_s = -1.0000, z_s = 0.0000, c_s = -13.1950
Orientation : PIR
Primary Slice Direction: sagittal
voxel to ras transform:
-0.0000 -0.0000 1.0000 -102.9610
-1.0000 -0.0000 -0.0000 155.3820
0.0000 -1.0000 0.0000 114.8050
0.0000 0.0000 0.0000 1.0000
voxel-to-ras determinant 1
ras to voxel transform:
0.0000 -1.0000 0.0000 155.3820
0.0000 0.0000 -1.0000 114.8050
1.0000 0.0000 0.0000 102.9610
0.0000 0.0000 0.0000 1.0000
- MNE-Python version: 0.22
- mne-bids: 0.7
- operating system: Ubuntu 18.04.1