fsl.Merge() command not found (when using through nipype.interfaces)

366 views Asked by At

I have already installed these:

conda install -c conda-forge nipype
conda install -c conda-forge nitime
conda install -c conda-forge nibabel 
conda install -c conda-forge nilearn 

Sample code:

from nipype.interfaces import fsl
import os
import numpy as np
import nitime
from nitime.timeseries import TimeSeries
from nitime.analysis import CorrelationAnalyzer, CoherenceAnalyzer
from nitime.utils import percent_change
import nibabel as nib
import nilearn
from nilearn import datasets, input_data
from nilearn.connectome import ConnectivityMeasure


m = fsl.Merge()
m.inputs.in_files = volumes
...
m.run()

It gives error:

OSError: No command "fslmerge" found on host. Please check that the corresponding package is installed.

Can you please help me?

1

There are 1 answers

0
Robert jirsaraie On

I just ran into the same problem, which had me stumped for over an hour. I realized that the fsl.Merge command in python is only wrapping around the fsl command: fslmerge. So it is required to load the latest version of fsl before executing your python script. Should be an easy fix:

module purge ; module load anaconda/2.7-4.3.1 fsl/6.0.1
source ~/Settings/MyCondaEnv.sh
conda activate local

python ~FSLMERGE.py