diff --git a/nipype/interfaces/afni/utils.py b/nipype/interfaces/afni/utils.py
index 9f306c7b8..cb01ae4a2 100644
--- a/nipype/interfaces/afni/utils.py
+++ b/nipype/interfaces/afni/utils.py
@@ -564,8 +564,11 @@ class CatMatvecInputSpec(AFNICommandInputSpec):
         argstr="%s",
         position=-2)
     out_file = File(
-        desc="File to write concattenated matvecs to",
         argstr=" > %s",
+        name_template='%s_cat.aff12.1D',
+        name_source='in_file',
+        keep_extension=False,
+        desc="File to write concattenated matvecs to",
         position=-1,
         mandatory=True)
     matrix = traits.Bool(

AFNI CatMatvec: Caching fails and output file undefined
### Summary
AFNI CatMatvec  interface caching fails and output file is undefined
### How to replicate the behavior
```Python
from nipype.interfaces import afni
from nipype.caching import Memory
memory = Memory('/tmp/test_catmatvec/')
catmatvec = memory.cache(afni.CatMatvec)
out_catmatvec = catmatvec(in_file=[('/tmp/test_caching/allineate_affine.aff12.1D', 'ONELINE')], out_file='/tmp/test_catmatvec2.aff12.1D')
print(out_catmatvec.outputs)
```
gives `out_file = <undefined>`. Moreover, when launching the same code twice the computations are restarted
### Platform details:

{'nibabel_version': '2.2.1', 'sys_executable': '/home/salma/anaconda2/bin/python', 'networkx_version': '2.0', 'numpy_version': '1.13.3', 'sys_platform': 'linux2', 'sys_version': '2.7.14 |Anaconda custom (64-bit)| (default, Oct 16 2017, 17:29:19) \n[GCC 7.2.0]', 'commit_source': 'repository', 'commit_hash': 'e446466', 'pkg_path': '/home/salma/CODE/nipype/nipype', 'nipype_version': '1.0.3-dev+ge446466', 'traits_version': '4.6.0', 'scipy_version': '1.0.0'}
1.0.3-dev+ge446466

diff --git a/nipype/interfaces/afni/tests/test_auto_CatMatvec.py b/nipype/interfaces/afni/tests/test_auto_CatMatvec.py
index dc1c981bb..df0ac34e0 100644
--- a/nipype/interfaces/afni/tests/test_auto_CatMatvec.py
+++ b/nipype/interfaces/afni/tests/test_auto_CatMatvec.py
@@ -38,7 +38,10 @@ def test_CatMatvec_inputs():
         ),
         out_file=dict(
             argstr=' > %s',
+            keep_extension=False,
             mandatory=True,
+            name_source='in_file',
+            name_template='%s_cat.aff12.1D',
             position=-1,
         ),
         outputtype=dict(),

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y gcc
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
attrs==22.2.0
Babel==2.11.0
certifi==2021.5.30
charset-normalizer==2.0.12
click==8.0.4
codecov==2.1.13
configparser==5.2.0
coverage==6.2
cycler==0.11.0
decorator==4.4.2
docutils==0.18.1
execnet==1.9.0
funcsigs==1.0.2
future==1.0.0
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
iniconfig==1.1.1
isodate==0.6.1
Jinja2==3.0.3
kiwisolver==1.3.1
lxml==5.3.1
MarkupSafe==2.0.1
matplotlib==3.3.4
mock==5.2.0
networkx==2.5.1
nibabel==3.2.2
-e git+https://github.com/nipy/nipype.git@e446466290b9ccba5d5aa589971c97e744d9267b#egg=nipype
numpy==1.19.5
numpydoc==1.1.0
packaging==21.3
Pillow==8.4.0
pluggy==1.0.0
prov==1.5.0
py==1.11.0
pydot==1.4.2
pydotplus==2.0.2
Pygments==2.14.0
pyparsing==3.1.4
pytest==7.0.1
pytest-cov==4.0.0
pytest-env==0.6.2
pytest-xdist==3.0.2
python-dateutil==2.9.0.post0
pytz==2025.2
rdflib==5.0.0
requests==2.27.1
scipy==1.5.4
simplejson==3.20.1
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tomli==1.2.3
traits==6.4.1
typing_extensions==4.1.1
urllib3==1.26.20
yapf==0.32.0
zipp==3.6.0

name: nipype
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - attrs==22.2.0
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - click==8.0.4
      - codecov==2.1.13
      - configparser==5.2.0
      - coverage==6.2
      - cycler==0.11.0
      - decorator==4.4.2
      - docutils==0.18.1
      - execnet==1.9.0
      - funcsigs==1.0.2
      - future==1.0.0
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - isodate==0.6.1
      - jinja2==3.0.3
      - kiwisolver==1.3.1
      - lxml==5.3.1
      - markupsafe==2.0.1
      - matplotlib==3.3.4
      - mock==5.2.0
      - networkx==2.5.1
      - nibabel==3.2.2
      - numpy==1.19.5
      - numpydoc==1.1.0
      - packaging==21.3
      - pillow==8.4.0
      - pluggy==1.0.0
      - prov==1.5.0
      - py==1.11.0
      - pydot==1.4.2
      - pydotplus==2.0.2
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - pytest-env==0.6.2
      - pytest-xdist==3.0.2
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - rdflib==5.0.0
      - requests==2.27.1
      - scipy==1.5.4
      - simplejson==3.20.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - tomli==1.2.3
      - traits==6.4.1
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - yapf==0.32.0
      - zipp==3.6.0
prefix: /opt/conda/envs/nipype

nipype/interfaces/afni/tests/test_auto_CatMatvec.py::test_CatMatvec_inputs
nipype/interfaces/afni/tests/test_auto_CatMatvec.py::test_CatMatvec_outputs
nipype/interfaces/afni/utils.py
nipype/interfaces/afni/utils.py