# dwi2mask synthstrip 

**URL:** <https://community.mrtrix.org/t/dwi2mask-synthstrip/7085>\
**Category:** Uncategorized\
**Created:** [November 6, 2023, 11:09pm UTC](https://community.mrtrix.org/t/dwi2mask-synthstrip/7085 "2023-11-06T23:09:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmitch](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/t/bcef8e/32.png) [@tmitch](https://community.mrtrix.org/u/tmitch)\
**Post date:** [November 6, 2023, 11:09pm UTC](https://community.mrtrix.org/t/dwi2mask-synthstrip/7085/1 "2023-11-06T23:09:26Z")

</div>

Hello,

I am trying to improve the mask for participants with lesions. I wanted to try running dwi2mask synthstrip on the dwi image since this worked well in FreeSurfer with the T1. However, I get the following error:

dwi2mask: [ERROR] Expected exactly 2 arguments (3 supplied)  
dwi2mask: [ERROR] Usage: dwi2mask input output  
dwi2mask: [ERROR] Yours: dwi2mask synthstrip P03\_T3/P03\_T3\_dwi\_den\_unr\_preproc\_unb\_upsampled.mif P03\_T3/P03\_T3\_mask\_den\_unr\_preproc\_unb\_upsampled.mif

I can’t find any documentation indicating the syntax is wrong. I appreciate any help!

Thank you!  
Trina

---

<div class="post-metadata">

**Author:** ![WilliamFCB](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/w/e68b1a/32.png) [@WilliamFCB](https://community.mrtrix.org/u/WilliamFCB)\
**Post date:** [November 7, 2023, 6:41am UTC](https://community.mrtrix.org/t/dwi2mask-synthstrip/7085/2 "2023-11-07T06:41:46Z")

</div>

Dear Trina

dwi2mask has nothing to do with synthstrip (see [dwi2mask — MRtrix3 3.0 documentation](https://mrtrix.readthedocs.io/en/latest/reference/commands/dwi2mask.html#dwi2mask)). dwi2mask only expects an input and output. Any options are preceded with “-”

Synthtrip is part of freesurfer as mri\_synthstrip or can be installed as, for example, a singularity container from [SynthStrip](https://surfer.nmr.mgh.harvard.edu/docs/synthstrip/)

Hope this helps  
BW  
William

---

<div class="post-metadata">

**Author:** ![mblesac](https://community.mrtrix.org/user_avatar/community.mrtrix.org/mblesac/32/2210_2.png) [@mblesac](https://community.mrtrix.org/u/mblesac)\
**Post date:** [November 7, 2023, 9:33am UTC](https://community.mrtrix.org/t/dwi2mask-synthstrip/7085/3 "2023-11-07T09:33:04Z")

</div>

Hi,

In the developers branch, there is a new [dwi2mask](https://mrtrix.readthedocs.io/en/dev/reference/commands/dwi2mask.html) command that allows you to use different algorithms. One of them is synthstrip. To use that you need to install the developers branch, as (I think) this has not been yet officially merged. I hope this helps.

Best regards,

Manuel

---

<div class="post-metadata">

**Author:** ![tmitch](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/t/bcef8e/32.png) [@tmitch](https://community.mrtrix.org/u/tmitch)\
**Post date:** [November 7, 2023, 4:52pm UTC](https://community.mrtrix.org/t/dwi2mask-synthstrip/7085/4 "2023-11-07T16:52:25Z")

</div>

Hi Manuel,

Thanks very much for your reply. I tried downloading the dev branch but there are no compile or build scripts made when I follow these steps for the dev branch.

git clone [GitHub - MRtrix3/mrtrix3: MRtrix3 provides a set of tools to perform various advanced diffusion MRI analyses, including constrained spherical deconvolution (CSD), probabilistic tractography, track-density imaging, and apparent fibre density](https://github.com/MRtrix3/mrtrix3.git)  
cd mrtrix3  
git checkout dev # \<== switch over to the dev branch  
git pull # \<== make sure that branch is up to date with remote  
./configure  
./build

> [@Question about dev branch of MRtrix3](https://community.mrtrix.org/t/question-about-dev-branch-of-mrtrix3/6274):
>
> Hello guys. I am trying to do the internship project but got stuck. In [ENH dwi2mask (dev): SynthStrip · Issue #2500 · MRtrix3/mrtrix3 · GitHub](https://github.com/MRtrix3/mrtrix3/issues/2500), how do I know if the dev branch of MRtrix3 is installed ? I installed MRtrix3 on MSL following the documentation but did not find anything related to the dev branch.

The master branch works fine, it is just an issue when switching over to the dev branch (similar problem to this post): [Build dev latest version](https://community.mrtrix.org/t/build-dev-latest-version/3492)

Thanks!  
Trina
