Repository: nipy/nipype

Issue:
[ENH] Enhance implementation of 5ttgen
### Summary
Current implementation lacks some inputs that are available through the original command ([MRTrix3's `5ttgen`](https://mrtrix.readthedocs.io/en/dev/reference/commands/5ttgen.html))
### Actual behavior
Currently only `in_file`, `algorithm` and `out_file` are available as inputs.
### Expected behavior
It'd be great to pass some other available inputs through the original algorithm...

### Platform details:

```
{'commit_hash': '4d1352ade',
 'commit_source': 'repository',
 'networkx_version': '3.3',
 'nibabel_version': '5.2.1',
 'nipype_version': '1.8.7.dev0',
 'numpy_version': '2.0.0',
 'pkg_path': '/home/galkepler/Projects/nipype/nipype',
 'scipy_version': '1.14.0',
 'sys_executable': '/home/galkepler/Projects/nipype/venv/bin/python',
 'sys_platform': 'linux',
 'sys_version': '3.11.8 | packaged by conda-forge | (main, Feb 16 2024, '
                '20:53:32) [GCC 12.3.0]',
 'traits_version': '6.3.2'}
```

### Execution environment
- My python environment outside container


Discussion:
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/nipy/nipype/pull/3658?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nipy) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 39.50%. Comparing base [(`4d1352a`)](https://app.codecov.io/gh/nipy/nipype/commit/4d1352ade7171fd5f55eff62cee4c99a4f9cfed1?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nipy) to head [(`e1da594`)](https://app.codecov.io/gh/nipy/nipype/commit/e1da594a7aba5bebc53d419bf42451761e1c3c8e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nipy).

> :exclamation:  There is a different number of reports uploaded between BASE (4d1352a) and HEAD (e1da594). Click for more details.
> 
> <details><summary>HEAD has 34 uploads less than BASE</summary>
>
>| Flag | BASE (4d1352a) | HEAD (e1da594) |
>|------|------|------|
>||37|3|
></details>

<details><summary>Additional details and impacted files</summary>


```diff
@@             Coverage Diff             @@
##           master    #3658       +/-   ##
===========================================
- Coverage   70.83%   39.50%   -31.33%     
===========================================
  Files        1276     1276               
  Lines       59314    59323        +9     
  Branches     9824     9824               
===========================================
- Hits        42013    23436    -18577     
- Misses      16125    35744    +19619     
+ Partials     1176      143     -1033     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/nipy/nipype/pull/3658?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nipy).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nipy).


Patch:
diff --git a/nipype/interfaces/mrtrix3/utils.py b/nipype/interfaces/mrtrix3/utils.py
index 7e25288d1..8a69232ec 100644
--- a/nipype/interfaces/mrtrix3/utils.py
+++ b/nipype/interfaces/mrtrix3/utils.py
@@ -241,6 +241,49 @@ class Generate5ttInputSpec(MRTrix3BaseInputSpec):
         desc="input image / directory",
     )
     out_file = File(argstr="%s", mandatory=True, position=-1, desc="output image")
+    t2_image = File(
+        exists=True,
+        argstr="-t2 %s",
+        desc="Provide a T2-weighted image in addition to the default T1-weighted image. (Only for 'fsl' algorithm)",
+    )
+    mask_file = File(
+        exists=True,
+        argstr="-mask %s",
+        desc="Provide a brain mask image. (Only for 'fsl' algorithm)",
+    )
+    premasked = traits.Bool(
+        argstr="-premasked",
+        desc="Assume that the input image is already brain-masked. (Only for 'fsl' algorithm)",
+    )
+    nocrop = traits.Bool(
+        argstr="-nocrop",
+        desc="Do not crop the image to the region of interest.",
+    )
+    sgm_amyg_hipp = traits.Bool(
+        argstr="-sgm_amyg_hipp",
+        desc="Include the amygdala and hippocampus in the subcortical grey matter segment.",
+    )
+    template = File(
+        exists=True,
+        argstr="-template %s",
+        desc="Provide an image that will form the template for the generated 5TT image. (Only for 'hsvs' algorithm)",
+    )
+    hippocampi = traits.Enum(
+        "subfields",
+        "first",
+        "aseg",
+        argstr="-hippocampi %s",
+        desc="Choose the method used to segment the hippocampi. (Only for 'freesurfer' algorithm)",
+    )
+    white_stem = traits.Bool(
+        argstr="-white_stem",
+        desc="Classify the brainstem as white matter. (Only for 'hsvs' algorithm)",
+    )
+    lut_file = File(
+        exists=True,
+        argstr="-lut %s",
+        desc="Manually provide path to the lookup table on which the input parcellation image is based. (Only for 'freesurfer' algorithm)",
+    )
 
 
 class Generate5ttOutputSpec(TraitedSpec):


Test patch:
diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt.py b/nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt.py
index 949fa2628..d8f6e5336 100644
--- a/nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt.py
+++ b/nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt.py
@@ -28,6 +28,9 @@ def test_Generate5tt_inputs():
             argstr="-fslgrad %s %s",
             xor=["grad_file"],
         ),
+        hippocampi=dict(
+            argstr="-hippocampi %s",
+        ),
         in_bval=dict(
             extensions=None,
         ),
@@ -40,6 +43,17 @@ def test_Generate5tt_inputs():
             mandatory=True,
             position=-2,
         ),
+        lut_file=dict(
+            argstr="-lut %s",
+            extensions=None,
+        ),
+        mask_file=dict(
+            argstr="-mask %s",
+            extensions=None,
+        ),
+        nocrop=dict(
+            argstr="-nocrop",
+        ),
         nthreads=dict(
             argstr="-nthreads %d",
             nohash=True,
@@ -57,6 +71,23 @@ def test_Generate5tt_inputs():
             mandatory=True,
             position=-1,
         ),
+        premasked=dict(
+            argstr="-premasked",
+        ),
+        sgm_amyg_hipp=dict(
+            argstr="-sgm_amyg_hipp",
+        ),
+        t2_image=dict(
+            argstr="-t2 %s",
+            extensions=None,
+        ),
+        template=dict(
+            argstr="-template %s",
+            extensions=None,
+        ),
+        white_stem=dict(
+            argstr="-white_stem",
+        ),
     )
     inputs = Generate5tt.input_spec()