# Sharing utility scripts

**URL:** <https://mne.discourse.group/t/sharing-utility-scripts/2865>\
**Category:** Support & Discussions\
**Created:** [March 20, 2021, 11:24pm UTC](https://mne.discourse.group/t/sharing-utility-scripts/2865 "2021-03-20T23:24:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RuKrei](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/rukrei/32/58_2.png) [@RuKrei](https://mne.discourse.group/u/RuKrei)\
**Post date:** [March 20, 2021, 11:24pm UTC](https://mne.discourse.group/t/sharing-utility-scripts/2865/1 "2021-03-20T23:24:24Z")

</div>

Dear everybody,

I wrote a little bash script today, which is calling python under the hood in order to facilitate freesurfer segmentation of subjects organized in folders.  
The point was, that it scales as needed (serial/parallel processing) and makes it simple to start.

Now, that I am done with it I can’t help but notice that I might have been the 100th person to write such a script, so I have been “wasting” my time solving a problem, that has long been solved multiple times elsewhere.

Now I am thinking that there is no point in everybody doing this on their own, so I am sharing my solution here (or on github, to be more precise).

You can find it under: [https://github.com/RuKrei/MEG\_MRI\_scripts](https://github.com/RuKrei/MEG_MRI_scripts)

It’s called do\_fs\_folder.sh and

- Executes do\_recon\_all\_nipype.py
- runs either on all subjects, or on a specified subset
- can be to run in parallel mode, or sequential
- Converts DICOM-Subfolders to nifti
- runs freesurfer (recon-all)
- runs SegmentHA\_T1.sh (hippocampal subfield segmentation)

It’s a bit tailored to my needs, but adjusting this might be faster, than re-inventing the wheel.

@MNE-Team:  
Do you think it would be a good idea to include some sample utility-scripts to mne-python?  
If yes, then this could be the starting point 🙂

If no, then everybody feel free to push some of your scripts to the above mentioned repo.

Best  
Rudi K

---

<div class="post-metadata">

**Author:** ![drammock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/drammock/32/4_2.png) [@drammock](https://mne.discourse.group/u/drammock)\
**Post date:** [April 1, 2021, 6:51pm UTC](https://mne.discourse.group/t/sharing-utility-scripts/2865/2 "2021-04-01T18:51:16Z")

</div>

Thanks for this! We probably won’t start including utility scripts as part of MNE-Python repo, but there is a separate repo:

> **[mne-tools/mne-scripts](https://github.com/mne-tools/mne-scripts/)**
>
> Sample scripts based on MNE. Contribute to mne-tools/mne-scripts development by creating an account on GitHub.

where people put such things sometimes. I don’t know how visible/discoverable it is (clearly since you didn’t find it, it’s not very visible!) but it might be slightly more discoverable to others than putting it in your own GitHub repo.
