ciftify icon indicating copy to clipboard operation
ciftify copied to clipboard

Trouble with MSM

Open StephDocTUM opened this issue 4 years ago • 32 comments

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

StephDocTUM avatar Apr 06 '20 08:04 StephDocTUM

same problem!

renxili avatar Apr 07 '20 01:04 renxili

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

edickie avatar Apr 07 '20 03:04 edickie

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

StephDocTUM avatar Apr 07 '20 06:04 StephDocTUM

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 [email protected] 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 .

edickie avatar Apr 07 '20 14:04 edickie

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

StephDocTUM avatar Apr 08 '20 10:04 StephDocTUM

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

StephDocTUM avatar Apr 08 '20 11:04 StephDocTUM

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

renxili avatar Apr 08 '20 14:04 renxili

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

StephDocTUM avatar Apr 08 '20 14:04 StephDocTUM

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

renxili avatar Apr 08 '20 14:04 renxili

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

StephDocTUM avatar Apr 08 '20 15:04 StephDocTUM

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

renxili avatar Apr 08 '20 15:04 renxili

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

On Wed, Apr 8, 2020 at 11:08 AM renxili [email protected] 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 .

edickie avatar Apr 08 '20 15:04 edickie

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

StephDocTUM avatar Apr 08 '20 15:04 StephDocTUM

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 [email protected] 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 .

edickie avatar Apr 08 '20 15:04 edickie

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

StephDocTUM avatar Apr 08 '20 15:04 StephDocTUM

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

renxili avatar Apr 08 '20 15:04 renxili

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

StephDocTUM avatar Apr 08 '20 16:04 StephDocTUM

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

StephDocTUM avatar Apr 08 '20 16:04 StephDocTUM

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

mharms avatar Apr 08 '20 16:04 mharms

@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 [email protected]

renxili avatar Apr 08 '20 16:04 renxili

@mharms yes this could work as well!

StephDocTUM avatar Apr 09 '20 07:04 StephDocTUM

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.

andraderenew avatar Nov 27 '22 07:11 andraderenew

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

edickie avatar Nov 28 '22 14:11 edickie

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.

andraderenew avatar Nov 28 '22 16:11 andraderenew

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: @.***>

edickie avatar Nov 28 '22 16:11 edickie

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 avatar Nov 28 '22 16:11 andraderenew

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.

andraderenew avatar Nov 28 '22 18:11 andraderenew

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: @.***>

renxili avatar Nov 28 '22 19:11 renxili

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.

andraderenew avatar Nov 29 '22 12:11 andraderenew

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!

Hnigo avatar Jul 31 '24 07:07 Hnigo