edickie / ciftify

The tools of the Human Connectome Project (HCP) adapted for working with non-HCP datasets
https://edickie.github.io/ciftify/
MIT License
116 stars 157 forks source link

Trouble with MSM #132

Open StephDocTUM opened 4 years ago

StephDocTUM commented 4 years ago

Hi,

I am having troubles with using MSM for ciftify (FS-Reg works) Do I have to install fsl from source code with that here FslInstallation/SourceCode - FslWiki It wont work if I run the installer normally?

When I run ciftify_recon_all, I always receive(with FSL installed with installer):

config = yaml.load(yaml_stream) Traceback (most recent call last): File "/Users/neurolab/opt/anaconda3/bin/ciftify_recon_all", line 8, in sys.exit(main()) File "/Users/neurolab/opt/anaconda3/lib/python3.7/site-packages/ciftify/bin/ciftify_recon_all.py", line 1422, in main settings = Settings(arguments) File "/Users/neurolab/opt/anaconda3/lib/python3.7/site-packages/ciftify/bin/ciftify_recon_all.py", line 192, in init self.reg_name = self.set_registration_mode(arguments) File "/Users/neurolab/opt/anaconda3/lib/python3.7/site-packages/ciftify/bin/ciftify_recon_all.py", line 209, in set_registration_mode verify_msm_available() File "/Users/neurolab/opt/anaconda3/lib/python3.7/site-packages/ciftify/bin/ciftify_recon_all.py", line 369, in verify_msm_available msm = ciftify.config.find_msm() File "/Users/neurolab/opt/anaconda3/lib/python3.7/site-packages/ciftify/config.py", line 68, in find_msm return msm.replace(os.linesep, '') AttributeError: 'NoneType' object has no attribute 'replace'

Best, Stephan

renxili commented 4 years ago

same problem!

edickie commented 4 years ago

So - from the error - it seems like it is not finding the MSM binary. MSM should be installed separately from FSL because (at least last time I checked) the version of MSM that ciftify (and the HCP pipelines) needs is newer than the one released with newer versions of FSL.

The compiled MSM files can be downloaded from here https://github.com/ecr05/MSM_HOCR/releases

StephDocTUM commented 4 years ago

Thank a lot for the reply. So I can just download msm_mac_v3 (in my case) and set the PATH to this file?

Best

edickie commented 4 years ago

Maybe? Actually, I think the ciftify workflow were last tested with the "initial release" of MSM (on github). I don't know if the more recent version 3 is backwards compatible with that one.But it should work?

Your correct that you should just need to download it and add this file to you PATH.

On Tue, Apr 7, 2020 at 2:13 AM stephanwu89 notifications@github.com wrote:

Thank a lot for the reply. So I can just download msm_mac_v3 (in my case) and set the PATH to this file?

Best

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/edickie/ciftify/issues/132#issuecomment-610195897, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEXT5V2GEPAIZPIYQNOVBTRLLABVANCNFSM4MCCNPXA .

StephDocTUM commented 4 years ago

@renxili which Computer, Python Version and OS are you using?

StephDocTUM commented 4 years ago

I tried with(without compiling anything): export PATH=$PATH:/../MSM/msm (older version linked on the ciftiy homepage) and PATH=$PATH:/../MSM/msm_mac_v3 but it didnt work.

I had a look into the code: ciftify_recon_all is calling verify_msm_available which calls
msm = ciftify.config.find_msm() which does msm = util.check_output("which msm") which receives from python subprocess: (called from util.check_output) "CalledProcessError: Command 'which msm' returned non-zero exit status 1." And msm is set to None, so NoneType which gives me the error.

msm = util.check_output("which msm") here the msm path should be updated

When I type which msn in the terminal nothing is found (in contrast to freesurfer or fsl) What am I doing wrong?

Best

renxili commented 4 years ago

I am using a Mac Os Catalina, python 3.8. I am also trying t figure out the way to add MSM to path!

StephDocTUM commented 4 years ago

yes, I am using also Catalina. what happens when you type in your terminal "which msm"? (when already set the PATH to your msm)

renxili commented 4 years ago

I think fsl 6 has pre-installed a MSM, or maybe try to rename this older version or move it to somewhere else?

StephDocTUM commented 4 years ago

yes, but does the command "which msm" finds the path of your msm?

renxili commented 4 years ago

Not yet for me. Did you go to /usr/local/fsl/src and then export the path as PATH=$PATH:/../MSM ?

edickie commented 4 years ago

For mac - you might need to remain the "msm_mac" file as msm?

On Wed, Apr 8, 2020 at 11:08 AM renxili notifications@github.com wrote:

Not yet for me. Did you go to /usr/local/fsl/src and then export the path as PATH=$PATH:/../MSM ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/edickie/ciftify/issues/132#issuecomment-611014017, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEXT5U3UBBG65YN757SXJLRLSHNLANCNFSM4MCCNPXA .

StephDocTUM commented 4 years ago

then I get: Running version of MSM does not match config /Users/neurolab/opt/anaconda3/lib/python3.7/site-packages/ciftify/data/hcp_config/MSMSulcStrainFinalconf

edickie commented 4 years ago

What happens for which msm? is it finding the version packaged with FSL? You might need to "prepend" the PATH (i.e. have the correct msm show up first in the PATH)

export PATH=/../MSM/msm:$PATH

On Wed, Apr 8, 2020 at 11:18 AM stephanwu89 notifications@github.com wrote:

then I get: Running version of MSM does not match config /Users/neurolab/opt/anaconda3/lib/python3.7/site-packages/ciftify/data/hcp_config/MSMSulcStrainFinalconf

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/edickie/ciftify/issues/132#issuecomment-611019662, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEXT5XTH2IJTBRHQJ4XT3DRLSISVANCNFSM4MCCNPXA .

StephDocTUM commented 4 years ago

okay now it works. I think I forgot to put the exec files together with the .cc files from MSM

renxili commented 4 years ago

@stephanwu89 Congrats! I still have trouble with adding msm_mac_v3 to the path. Would you mind giving me a recap?

StephDocTUM commented 4 years ago

sure. Get this version MSM_HOCR-3.0FSL and the compiled ones and put them in one folder.

StephDocTUM commented 4 years ago

I can also send you the compiled ones if you it doesnt work

mharms commented 4 years ago

I would think that you need to rename msm_mac_v3 to simply msm.

renxili commented 4 years ago

@stephanwu89 I have downloaded msm_mac_v3 from https://github.com/ecr05/MSM_HOCR/releases. But this does not seem to be compatible on my end. It would be nice if you could forward the your compiled files to me. I am reachable at rli296@wisc.edu

StephDocTUM commented 4 years ago

@mharms yes this could work as well!

andraderenew commented 1 year ago

I have a similar issue even if I add msm file to PATH environment variable I cannot make ciftifyreconall work. It says that there is a mismatch of versions. Also which msm shows always /usr/local/fsl/bin/msm even if I add # to fsl paths.

I also have an issue with which msm now. I had symlinked msm with the file downloaded from MSM repository but now I can't have which msm return /usr/local/fsl/bin/msm instead it returns msm not found. Even if I reinstall fsl.

edickie commented 1 year ago

If which MSM is finding the one in FSL you might need to "prepend" the PATH (i.e. have the correct msm show up first in the PATH)

export PATH=/../MSM/msm:$PATH

andraderenew commented 1 year ago

I don't understand what is to prepend the PATH but if it is to export to the variable PATH the route to msm I have done that and it doesn't seem to work.

edickie commented 1 year ago

what command are you using to export the variable to PATH - does the existing "PATH" come before or after the msm path?

You want to export PATH=/<path/to/msm:$PATH

instead of

export PATH=$PATH:/<path>/to/<msm>/

On Mon, Nov 28, 2022 at 11:44 AM andraderenew @.***> wrote:

I don't understand what is to prepend the PATH but if it is to export to the variable PATH the route to msm I have done that and it doesn't seem to work.

— Reply to this email directly, view it on GitHub https://github.com/edickie/ciftify/issues/132#issuecomment-1329413964, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEXT5WB4UW5WE45JI5LLNDWKTOPHANCNFSM4MCCNPXA . You are receiving this because you commented.Message ID: @.***>

andraderenew commented 1 year ago

I have done both and none seems to work. I have closed and opened terminal and restarted the mac also but nothing seems to change. Although that was before linking to msm path on the one downloaded now it just says

msm not found

andraderenew commented 1 year ago

I have tried both. Believe me I don0t understand it.

On 28 Nov 2022, at 17:51, Erin W Dickie @.***> wrote:

what command are you using to export the variable to PATH - does the existing "PATH" come before or after the msm path?

You want to export PATH=/<path/to/msm:$PATH

instead of

export PATH=$PATH:/<path>/to/<msm>/

On Mon, Nov 28, 2022 at 11:44 AM andraderenew @.***> wrote:

I don't understand what is to prepend the PATH but if it is to export to the variable PATH the route to msm I have done that and it doesn't seem to work.

— Reply to this email directly, view it on GitHub https://github.com/edickie/ciftify/issues/132#issuecomment-1329413964, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEXT5WB4UW5WE45JI5LLNDWKTOPHANCNFSM4MCCNPXA . You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/edickie/ciftify/issues/132#issuecomment-1329424151, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHRDBMOKDXC6LETRIBXMVHLWKTPJNANCNFSM4MCCNPXA. You are receiving this because you commented.

renxili commented 1 year ago

Hi,

If I remember correctly from two years ago, there is a bug with the fsl installation package. I asked the fsl guys and they sent me a new python package to fix the bug.

Best, Renxi

On Nov 28, 2022, at 1:35 PM, andraderenew @.**@.>> wrote:

I have tried both. Believe me I don0t understand it.

On 28 Nov 2022, at 17:51, Erin W Dickie @.***> wrote:

what command are you using to export the variable to PATH - does the existing "PATH" come before or after the msm path?

You want to export PATH=/<path/to/msm:$PATH

instead of

export PATH=$PATH:/<path>/to/<msm>/

On Mon, Nov 28, 2022 at 11:44 AM andraderenew @.***> wrote:

I don't understand what is to prepend the PATH but if it is to export to the variable PATH the route to msm I have done that and it doesn't seem to work.

— Reply to this email directly, view it on GitHub https://github.com/edickie/ciftify/issues/132#issuecomment-1329413964, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEXT5WB4UW5WE45JI5LLNDWKTOPHANCNFSM4MCCNPXA . You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/edickie/ciftify/issues/132#issuecomment-1329424151, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHRDBMOKDXC6LETRIBXMVHLWKTPJNANCNFSM4MCCNPXA. You are receiving this because you commented.

— Reply to this email directly, view it on GitHubhttps://github.com/edickie/ciftify/issues/132#issuecomment-1329564040, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APCIEPGYZ72IGV7M2CUVSS3WKT3QBANCNFSM4MCCNPXA. You are receiving this because you were mentioned.Message ID: @.***>

andraderenew commented 1 year ago

Hi, If I remember correctly from two years ago, there is a bug with the fsl installation package. I asked the fsl guys and they sent me a new python package to fix the bug. Best, Renxi On Nov 28, 2022, at 1:35 PM, andraderenew @.**@.>> wrote: I have tried both. Believe me I don0t understand it. On 28 Nov 2022, at 17:51, Erin W Dickie @.> wrote: what command are you using to export the variable to PATH - does the existing "PATH" come before or after the msm path? You want to export PATH=/<path/to/msm:$PATH instead of export PATH=$PATH:/<path>/to/<msm>/ On Mon, Nov 28, 2022 at 11:44 AM andraderenew @.> wrote: > I don't understand what is to prepend the PATH but if it is to export to > the variable PATH the route to msm I have done that and it doesn't seem to > work. > > — > Reply to this email directly, view it on GitHub > <#132 (comment)>, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/ADEXT5WB4UW5WE45JI5LLNDWKTOPHANCNFSM4MCCNPXA > . > You are receiving this because you commented.Message ID: > @.> > — Reply to this email directly, view it on GitHub <#132 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHRDBMOKDXC6LETRIBXMVHLWKTPJNANCNFSM4MCCNPXA. You are receiving this because you commented. — Reply to this email directly, view it on GitHub<#132 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APCIEPGYZ72IGV7M2CUVSS3WKT3QBANCNFSM4MCCNPXA. You are receiving this because you were mentioned.Message ID: @.>

I wonder if their new version has not fixed this bug.

Hnigo commented 3 months ago

I think putting the new msm back under fsl/bin/ is valid, you need to check if the msm is executable. If the "which msm" is working then it's working, but of course you must need to rename it, hope this helps!