poldracklab / pydeface

defacing utility for MRI images
MIT License
110 stars 42 forks source link

FSL dependency check requires the complete FSL installation #54

Closed mateuszpawlik closed 7 months ago

mateuszpawlik commented 1 year ago

I'm working on a Docker image for one of our pipelines. Pydeface is one of the tools in the chain. It depends on FSL. The complete FSL installation is time consuming and the resulting image is large. Pydeface seems to use only FLIRT binary out of many FSL tools. I managed to compile FLIRT from sources in my Docker image. The FLIRT binary is only 1MB large + its dependencies.

Unfortunately, pydeface is looking for the fsl binary and not flirt and I fail to execute it. Are there more dependencies than FLIRT from the FSL tools? Could the check be simply substituted with flirt?

According to the documentation, fsl binary is just a menu:

To bring up a simple GUI which is just a menu of the main individual FSL GUI tools, just type fsl.

The following lines allowed me to successfully install and execute pydeface with only flirt binary.

RUN pipx install pydeface
RUN sed -i "s/shutil.which('fsl')/shutil.which('flirt')/g" /root/.local/pipx/venvs/pydeface/lib/python3.11/site-packages/pydeface/utils.py
effigies commented 11 months ago

Agree, it makes sense to switch to calling which('flirt')

ofgulban commented 7 months ago

Merged the PR now, closing.