FSL through Slicer

Hello everybody,

I am trying to use an external library (fsl) in my module. My problem is exactly this : http://massmail.spl.harvard.edu/public-archives/slicer-users/2016/010173.html . I am wondering weather in the meanwhile a more straightforward solution has been implemented.

I was thinking a (not really elegant) way to do it :

  1. creating a function in matlab which call ‘fsl’ using a shell command
  2. call the function through the matlab bridge extension.

Does it make sense? if yes, how can I call the function from the python script of my module?

thank you very much

If you are on Linux or Mac, I would suggest to first try installing nipype with Slicer’s pip (it probably won’t work on Windows). See this post for instructions. Slicer compatibility with the rest of the Python world is still in limbo. Hopefully once we move to Python3 and Visual Studio 2015, we can consider building against miniconda by default.

If you are willing to write your own shell-out routine, there’s no need to introduce a Matlab dependency, Python can do it directly: https://docs.python.org/2/library/subprocess.html

1 Like

thank you for your help :slight_smile: