poldracklab / pydeface

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

FSL Not Found on Path for pydeface #53

Closed BWIEDOR closed 11 months ago

BWIEDOR commented 1 year ago

A user in my building has requested help with this issue. I must preface this by saying I have no experience in this matter and minimal Linux experience, however due to departmental downsizing and limitation, I am the one who was given this to investigate. Please be understanding.

This was their exact message to me:

In early May, we had FSL (FMRib Software Library, a neuroimaging analysis program) installed for use on the server in our lab. FSL did install successfully and can be accessed by using the command fsl5.0-fsl, and works perfectly when being used directly. However, since installation of FSL, when trying to use other tools which look for or attempt to use FSL, I've had some trouble; they seem not to be able to detect that FSL has been installed. I'm not sure if that's because they're trying to access it via, for example, a simpler command such as "fsl" by itself, or whether that's unrelated. Most recently this has been an issue with my attempt to use pydeface to anonymize MRI data for archiving on a public platform. Here is what happens when I try to run pydeface:

username@server:~/{data_path redacted}/Raw$ pydeface s103/003/003_t1_mprage_sag_ns_20180416115703_3.nii 
--------------
pydeface 2.0.2
--------------
Traceback (most recent call last):
  File "/home/username/.local/bin/pydeface", line 8, in <module>
    sys.exit(main())
  File "/home/username/.local/lib/python3.8/site-packages/pydeface/__main__.py", line 95, in main
    pdu.deface_image(**vars(args))
  File "/home/username/.local/lib/python3.8/site-packages/pydeface/utils.py", line 84, in deface_image
    raise EnvironmentError("fsl cannot be found on the path")
OSError: fsl cannot be found on the path

Is the issue with the path in my personal profile, or with the way FSL is accessed, or possibly elsewhere?"

I will provide whatever information is helpful or needed if anyone has some ideas what is going on here. The person in my department who had experience with these installations is no longer available for me to call upon.

Best, Brian

ofgulban commented 1 year ago

Hi @BWIEDOR Brian, Too bad that you do not have support, it can be frustrating to deal with these cases indeed. From the message you have posted it seems that FSL (https://fsl.fmrib.ox.ac.uk/fsl/fslwiki) is either not installed, or installed but not setup correctly for pydeface.

  1. Can you post what returns when you execute whereis fsl5.0-fsl in the terminal?
  2. Can you post what returns when you execute echo $FSLDIR in the terminal?
BWIEDOR commented 1 year ago

Certainly, below are the results for each command.

  • Can you post what returns when you execute whereis fsl5.0-fsl in the terminal?
    whereis fsl5.0-fsl
    fsl5: /usr/bin/fsl5.0-fsl_sub /usr/bin/fsl5.0-Possum /usr/bin/fsl5.0-convertwarp /usr/bin/fsl5.0-first /usr/bin/fsl5.0-pnm_stage1 /usr/bin/fsl5.0-new_invwarp /usr/bin/fsl5.0-applytopup /usr/bin/fsl5.0-tbss_3_postreg /usr/bin/fsl5.0-imrm /usr/bin/fsl5.0-fslecho /usr/bin/fsl5.0-ttoz /usr/bin/fsl5.0-old_betall /usr/bin/fsl5.0-fast /usr/bin/fsl5.0-fslanimate /usr/bin/fsl5.0-fslascii2img /usr/bin/fsl5.0-randomise /usr/bin/fsl5.0-mm /usr/bin/fsl5.0-applyxfm4D /usr/bin/fsl5.0-swap_subjectwise /usr/bin/fsl5.0-invwarp_exe /usr/bin/fsl5.0-feat /usr/bin/fsl5.0-flirt_average /usr/bin/fsl5.0-applywarp /usr/bin/fsl5.0-filmbabescript /usr/bin/fsl5.0-fsl_abspath /usr/bin/fsl5.0-ftoz /usr/bin/fsl5.0-cutoffcalc /usr/bin/fsl5.0-quasil /usr/bin/fsl5.0-fsl_gui /usr/bin/fsl5.0-fsl_boxplot /usr/bin/fsl5.0-gps /usr/bin/fsl5.0-possum_matrix /usr/bin/fsl5.0-Fsl_prepare_fieldmap /usr/bin/fsl5.0-signal2image /usr/bin/fsl5.0-betsurf /usr/bin/fsl5.0-viena_createpng /usr/bin/fsl5.0-bet /usr/bin/fsl5.0-fsl_anat /usr/bin/fsl5.0-Melodic /usr/bin/fsl5.0-fslcpgeom /usr/bin/fsl5.0-fslcorrecthd /usr/bin/fsl5.0-Vest2Text /usr/bin/fsl5.0-fslroi /usr/bin/fsl5.0-fslsize /usr/bin/fsl5.0-lesion_filling /usr/bin/fsl5.0-fslreorient2std /usr/bin/fsl5.0-fsl_glm /usr/bin/fsl5.0-midtrans /usr/bin/fsl5.0-perfusion_subtract /usr/bin/fsl5.0-create_lut /usr/bin/fsl5.0-siena /usr/bin/fsl5.0-ztop /usr/bin/fsl5.0-run_first /usr/bin/fsl5.0-drawmesh /usr/bin/fsl5.0-fslval /usr/bin/fsl5.0-updatefeatreg /usr/bin/fsl5.0-setFEAT /usr/bin/fsl5.0-feat_model /usr/bin/fsl5.0-fsl_reg /usr/bin/fsl5.0-fslvbm_3_proc /usr/bin/fsl5.0-tcalc /usr/bin/fsl5.0-first_boundary_corr /usr/bin/fsl5.0-fslvbm_2_template /usr/bin/fsl5.0-convert_xfm /usr/bin/fsl5.0-maskdyads /usr/bin/fsl5.0-slicer /usr/bin/fsl5.0-aff2rigid /usr/bin/fsl5.0-tsplot /usr/bin/fsl5.0-invfeatreg /usr/bin/fsl5.0-first_mult_bcorr /usr/bin/fsl5.0-tbss_4_prestats /usr/bin/fsl5.0-pvmfit /usr/bin/fsl5.0-wpng /usr/bin/fsl5.0-prelude /usr/bin/fsl5.0-xfibres /usr/bin/fsl5.0-fugue /usr/bin/fsl5.0-whirlgif /usr/bin/fsl5.0-sliceanimate /usr/bin/fsl5.0-morph_kernel /usr/bin/fsl5.0-eddy /usr/bin/fsl5.0-pnm_evs /usr/bin/fsl5.0-viena_quant /usr/bin/fsl5.0-extracttxt /usr/bin/fsl5.0-oxford_asl /usr/bin/fsl5.0-tbss_non_FA /usr/bin/fsl5.0-pointflirt /usr/bin/fsl5.0-fsl_mvlm /usr/bin/fsl5.0-imcp /usr/bin/fsl5.0-imln /usr/bin/fsl5.0-fslswapdim /usr/bin/fsl5.0-fslFixText /usr/bin/fsl5.0-label2surf /usr/bin/fsl5.0-prewhiten /usr/bin/fsl5.0-setup_masks /usr/bin/fsl5.0-fdr /usr/bin/fsl5.0-sigloss /usr/bin/fsl5.0-Featquery /usr/bin/fsl5.0-ConcatXFM /usr/bin/fsl5.0-basil_var /usr/bin/fsl5.0-checkFEAT /usr/bin/fsl5.0-avscale /usr/bin/fsl5.0-siena_diff /usr/bin/fsl5.0-bedpostx /usr/bin/fsl5.0-ccops /usr/bin/fsl5.0-fslfft /usr/bin/fsl5.0-mvntool /usr/bin/fsl5.0-InvertXFM /usr/bin/fsl5.0-ApplyXFM /usr/bin/fsl5.0-match_smoothing /usr/bin/fsl5.0-Renderhighres /usr/bin/fsl5.0-first_roi_slicesdir /usr/bin/fsl5.0-melodic /usr/bin/fsl5.0-generate_b0 /usr/bin/fsl5.0-run_first_all /usr/bin/fsl5.0-concat_bvars /usr/bin/fsl5.0-distancemap /usr/bin/fsl5.0-dtifit /usr/bin/fsl5.0-fslpspec /usr/bin/fsl5.0-topup /usr/bin/fsl5.0-slicesdir /usr/bin/fsl5.0-asl_calib /usr/bin/fsl5.0-Glm /usr/bin/fsl5.0-imtest /usr/bin/fsl5.0-Asl /usr/bin/fsl5.0-vecreg /usr/bin/fsl5.0-AnatomicalAverage /usr/bin/fsl5.0-flameo /usr/bin/fsl5.0-tbss_deproject /usr/bin/fsl5.0-susan /usr/bin/fsl5.0-fsladd /usr/bin/fsl5.0-generateConfounds /usr/bin/fsl5.0-generate_brain /usr/bin/fsl5.0-imglob /usr/bin/fsl5.0-filmbabe /usr/bin/fsl5.0-zeropad /usr/bin/fsl5.0-Flirt /usr/bin/fsl5.0-fnirt /usr/bin/fsl5.0-fsl_histogram /usr/bin/fsl5.0-fslmerge /usr/bin/fsl5.0-makerot /usr/bin/fsl5.0-dual_regression /usr/bin/fsl5.0-asl_mfree /usr/bin/fsl5.0-fsl2ascii /usr/bin/fsl5.0-fsl /usr/bin/fsl5.0-tmpnam /usr/bin/fsl5.0-rmsdiff /usr/bin/fsl5.0-fslerrorreport /usr/bin/fsl5.0-mainfeatreg /usr/bin/fsl5.0-contrast_mgr /usr/bin/fsl5.0-medianfilter /usr/bin/fsl5.0-halfcosbasis /usr/bin/fsl5.0-Nudge /usr/bin/fsl5.0-fslmodhd /usr/bin/fsl5.0-extractfidparams /usr/bin/fsl5.0-calc_grad_perc_dev /usr/bin/fsl5.0-fslinfo /usr/bin/fsl5.0-autoaq /usr/bin/fsl5.0-cluster /usr/bin/fsl5.0-design_ttest2 /usr/bin/fsl5.0-sienax /usr/bin/fsl5.0-fslcomplex /usr/bin/fsl5.0-proj_thresh /usr/bin/fsl5.0-img2imgcoord /usr/bin/fsl5.0-unconfound /usr/bin/fsl5.0-Susan /usr/bin/fsl5.0-Text2Vest /usr/bin/fsl5.0-fslnvols /usr/bin/fsl5.0-remove_ext /usr/bin/fsl5.0-fsledithd /usr/bin/fsl5.0-first_utils /usr/bin/fsl5.0-fabber /usr/bin/fsl5.0-pulse /usr/bin/fsl5.0-fslchfiletype /usr/bin/fsl5.0-fslslice /usr/bin/fsl5.0-film_gls /usr/bin/fsl5.0-qboot /usr/bin/fsl5.0-asl_reg /usr/bin/fsl5.0-fdt_rotate_bvecs /usr/bin/fsl5.0-easythresh /usr/bin/fsl5.0-b0calc /usr/bin/fsl5.0-find_the_biggest /usr/bin/fsl5.0-fnirtfileutils /usr/bin/fsl5.0-flirt /usr/bin/fsl5.0-eddy_correct /usr/bin/fsl5.0-probtrackx /usr/bin/fsl5.0-fsl_sbca /usr/bin/fsl5.0-fslstats /usr/bin/fsl5.0-fsl_schurprod /usr/bin/fsl5.0-bet2 /usr/bin/fsl5.0-fslinterleave /usr/bin/fsl5.0-Fast /usr/bin/fsl5.0-Fdt /usr/bin/fsl5.0-avw2fsl /usr/bin/fsl5.0-fslmeants /usr/bin/fsl5.0-run_mesh_utils /usr/bin/fsl5.0-systemnoise /usr/bin/fsl5.0-fslsmoothfill /usr/bin/fsl5.0-Make_flobs /usr/bin/fsl5.0-tbss_skeleton /usr/bin/fsl5.0-bedpost /usr/bin/fsl5.0-make_dyadic_vectors /usr/bin/fsl5.0-fslchfiletype_exe /usr/bin/fsl5.0-mccutup /usr/bin/fsl5.0-Bet /usr/bin/fsl5.0-mcflirt /usr/bin/fsl5.0-fsl_tsplot /usr/bin/fsl5.0-img2stdcoord /usr/bin/fsl5.0-slices_summary /usr/bin/fsl5.0-Renderstats /usr/bin/fsl5.0-cluster2html /usr/bin/fsl5.0-tbss_sym /usr/bin/fsl5.0-tbss_fill /usr/bin/fsl5.0-slicesmask /usr/bin/fsl5.0-possumX /usr/bin/fsl5.0-probtrackx2 /usr/bin/fsl5.0-randomise_parallel /usr/bin/fsl5.0-siena_flow2std /usr/bin/fsl5.0-surface_fdr /usr/bin/fsl5.0-first3Dview /usr/bin/fsl5.0-fslselectvols /usr/bin/fsl5.0-bedpostx_datacheck /usr/bin/fsl5.0-surf2volume /usr/bin/fsl5.0-immv /usr/bin/fsl5.0-epi_reg /usr/bin/fsl5.0-possum_sum /usr/bin/fsl5.0-baycest /usr/bin/fsl5.0-first_flirt /usr/bin/fsl5.0-standard_space_roi /usr/bin/fsl5.0-fsl_motion_outliers /usr/bin/fsl5.0-fabber_var /usr/bin/fsl5.0-popp /usr/bin/fsl5.0-pngappend /usr/bin/fsl5.0-connectedcomp /usr/bin/fsl5.0-std2imgcoord /usr/bin/fsl5.0-possum /usr/bin/fsl5.0-siena_cal /usr/bin/fsl5.0-generate_b0calc /usr/bin/fsl5.0-fslsplit /usr/bin/fsl5.0-basil /usr/bin/fsl5.0-tbss_x /usr/bin/fsl5.0-ttologp /usr/bin/fsl5.0-probtrack /usr/bin/fsl5.0-fslchpixdim /usr/bin/fsl5.0-spharm_rm /usr/bin/fsl5.0-fslmaths /usr/bin/fsl5.0-surf2surf /usr/bin/fsl5.0-renderhighres /usr/bin/fsl5.0-ptoz /usr/bin/fsl5.0-fslcreatehd /usr/bin/fsl5.0-fslvbm_1_bet /usr/bin/fsl5.0-featquery /usr/bin/fsl5.0-surf_proj /usr/bin/fsl5.0-pairreg /usr/bin/fsl5.0-selfintersection /usr/bin/fsl5.0-dtigen /usr/bin/fsl5.0-asl_file /usr/bin/fsl5.0-fslhd /usr/bin/fsl5.0-eddy_combine /usr/bin/fsl5.0-overlay /usr/bin/fsl5.0-feat_gm_prepare /usr/bin/fsl5.0-fsl_regfilt /usr/bin/fsl5.0-tbss_1_preproc /usr/bin/fsl5.0-swap_voxelwise /usr/bin/fsl5.0-invwarp /usr/bin/fsl5.0-slicetimer /usr/bin/fsl5.0-siena_flirt /usr/bin/fsl5.0-qboot_parallel /usr/bin/fsl5.0-fsl_prepare_fieldmap /usr/bin/fsl5.0-tbss_2_reg /usr/bin/fsl5.0-hist2prob /usr/bin/fsl5.0-robustfov /usr/bin/fsl5.0-fslswapdim_exe /usr/bin/fsl5.0-fslcc /usr/bin/fsl5.0-Pnm /usr/bin/fsl5.0-smoothest /usr/bin/fsl5.0-featregapply /usr/bin/fsl5.0-fslsurfacemaths /usr/bin/fsl5.0-mean /usr/bin/fsl5.0-slices /usr/bin/fsl5.0-estnoise /usr/bin/fsl5.0-fslorient /usr/bin/fsl5.0-Feat
  • Can you post what returns when you execute echo $FSLDIR in the terminal?

For my own login I am getting no return on the echo command. I have also reached out to the user to ask them to run these commands on their own login, as they insisted they can run FSL normally on its own.

BWIEDOR commented 1 year ago

I also wanted to add: The person who installed FSL did so directly from the Ubuntu 20.04 repo, via the apt-get install fsl command. So far as they can remember, they did not make any adjustments or changes, just ran that command as it was.

ofgulban commented 1 year ago

Thanks. Now, can you try executing lines below within the same terminal, and post what you get:

  1. FSLDIR=/usr/bin
  2. Execute a pydeface command.

If these does not work can you try again with below, and post the results:

  1. alias fsl="fsl5.0-fsl"
  2. Execute a pydeface command.