Hi FreeSurfer Developers,

I’m using mne.bem.make_flash_bem python function to create BEM meshes, and mne.bem.make_flash_bem makes use of the FreeSurfer functions fsl_rigid_register and mri_convert. I’m running into an error reading the temporary files when using fsl_rigid_register.

It looks like the FSL flirt step in fsl_rigid_register creates a compressed file outvol.fsl_rigid_register.nii.gz in the temporary folder. But in mri_convert, the uncompressed file name outvol.fsl_rigid_register.nii is passed to niiRead(), which runs into an error opening it since the compressed file from flirt has a different format suffix. 

Is there a way to specify the output format of FSL when sourcing Freesurfer such that it saves in .nii rather than .nii.gz formats? I tried to specify the FSF_OUTPUT_FORMAT, which doesn’t seem to impact FSL output formats. Alternatively, is there a way to flag to either mri_convert of niiRead() such that they can handle a compressed .nii.gz file? 

Thank you for your time and help! 

Best,
Alex