# convert MRI to .fif

**URL:** <https://mne.discourse.group/t/convert-mri-to-fif/999>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [April 13, 2016, 3:58pm UTC](https://mne.discourse.group/t/convert-mri-to-fif/999 "2016-04-13T15:58:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 13, 2016, 3:58pm UTC](https://mne.discourse.group/t/convert-mri-to-fif/999/1 "2016-04-13T15:58:20Z")

</div>

Is there an mne tool which can convert an MRI to a .fif file .  
I'm starting with .mgz and so can easily get to .nii and many other formats.  
It's the conversion to .fif that's the problem.

Thanks - Don  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20160413/6491a56f/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160413/6491a56f/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 13, 2016, 5:40pm UTC](https://mne.discourse.group/t/convert-mri-to-fif/999/2 "2016-04-13T17:40:40Z")

</div>

this does not exist. Yet?

sorry  
A

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 13, 2016, 7:49pm UTC](https://mne.discourse.group/t/convert-mri-to-fif/999/3 "2016-04-13T19:49:03Z")

</div>

If you have the Neuromag software there's the GUI-based dicom\_access tool.  
There was also a neuromag command line utility create\_mri\_sets (possibly  
only for HPUX?) to do this.

Since (presumably?) the usual Freesurfer --\> MNE pipeline isn't appropriate  
in this case for some reason, there's another command line alternative.  
First you'd use Freesurfer's unpacksdcmdir to extract the info about the  
dicom files from a directory (this produces a text file with information  
like run #, # of slices, etc), and then run it again using those extracted  
parameters to read the dicom files from the directory and convert them into  
an .mgh file (see [https://surfer.nmr.mgh.harvard.edu/fswiki/FsFastUnpackData](https://surfer.nmr.mgh.harvard.edu/fswiki/FsFastUnpackData)  
for a complicated example). Then you can use the MNE-C command  
mne\_make\_cor\_set to convert the .mgh file into a fif file (e.g.,  
mne\_make\_cor\_set --mgh mgh\_input\_file.mgh --out shiny\_new\_fif\_file.fif).

All are a bit old school but should still work. Probably.

Jon

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 13, 2016, 8:43pm UTC](https://mne.discourse.group/t/convert-mri-to-fif/999/4 "2016-04-13T20:43:11Z")

</div>

Yes, plus you can use the excellent mne\_organize\_dicoms to avoid the  
persnickity unpacksdcmdir.

hth  
d

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 13, 2016, 9:32pm UTC](https://mne.discourse.group/t/convert-mri-to-fif/999/5 "2016-04-13T21:32:11Z")

</div>

Thank you very much, Jon.  
I will try it first thing.

Best - Don
