Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using demo_LiFE.m #98

Open
sarwart opened this issue Jan 11, 2021 · 10 comments
Open

Error using demo_LiFE.m #98

sarwart opened this issue Jan 11, 2021 · 10 comments

Comments

@sarwart
Copy link

sarwart commented Jan 11, 2021

Hi!

I downloaded the recommended dataset and ran demo_LiFE.m without making any change to the code or dataset. But I have received the following error

Error using histc
Edge vector must be monotonically non-decreasing.

Error in hist (line 126)
    nn = histc(y,edgesc,1);

Error in feComputeEvidence (line 25)
[se.lesion.hist,   se.lesion.xhist]   = hist(se.lesion.rmse.all,  se.bins);

Error in demo_LiFE (line 252)
se = feComputeEvidence(prob.rmse,det.rmse); 

When I checked the values of "y" and "edgesc", both contained NaNs. Can you please guide what am I doing wrong? I am using MATLAB 2018a on Windows OS. "rmse", "rmsexv", "rrmse" and "w" all are also NaNs.

@sarwart
Copy link
Author

sarwart commented Feb 2, 2021

Hi!

I downloaded the recommended dataset and ran demo_LiFE.m without making any change to the code or dataset. But I have received the following error

Error using histc
Edge vector must be monotonically non-decreasing.

Error in hist (line 126)
    nn = histc(y,edgesc,1);

Error in feComputeEvidence (line 25)
[se.lesion.hist,   se.lesion.xhist]   = hist(se.lesion.rmse.all,  se.bins);

Error in demo_LiFE (line 252)
se = feComputeEvidence(prob.rmse,det.rmse); 

When I checked the values of "y" and "edgesc", both contained NaNs. Can you please guide what am I doing wrong? I am using MATLAB 2018a on Windows OS.

Can anyone help me with this?

@francopestilli
Copy link
Contributor

dear @sarwart unfortunately i am back from medical leave only now. The routines that do the groundwork are not compiled for Windows. The code should work on Mac OSX and Linux (Ubuntu/Fedora).

If you are interested, it would be great if you wanted to try to compile them for Windows systems and make a pull request. You can find the files in this folder: https://github.com/brain-life/encode/tree/master/mexfiles

@bcmcpher

@francopestilli
Copy link
Contributor

@sarwart one option for you could be to try the containerized version of the code:
https://doi.org/10.25663/bl.app.1
or
https://doi.org/10.25663/bl.app.104

@sarwart
Copy link
Author

sarwart commented Feb 2, 2021

dear @sarwart unfortunately i am back from medical leave only now. The routines that do the groundwork are not compiled for Windows. The code should work on Mac OSX and Linux (Ubuntu/Fedora).

If you are interested, it would be great if you wanted to try to compile them for Windows systems and make a pull request. You can find the files in this folder: https://github.com/brain-life/encode/tree/master/mexfiles

@bcmcpher

Thanks @francopestilli , I will run this on Linux platform and may try to run the containerized version too.

@sarwart
Copy link
Author

sarwart commented Feb 5, 2021

I tried to run the code on HPC system (high performance computing) but it ended up with the same error (linux based system). I simply tried running demo_LiFE.m. I tried using the Matlab 2019 and 2020 (the only available options on the HPC system)

Do I need to perform any preprocessing which I have missed?

@sarwart
Copy link
Author

sarwart commented Feb 13, 2021

I also compiled the files for windows but it didn't work. Currently, I have successfully used the containerized version but there are some 'NaN' weights for the streamlines e.g.

0
0.000883973242981022
0
NaN
0
0.000146038590699469
0
0
3.41404364868276e-05
0

I have used the demo dataset (dwi and tracks only- without t1). Why are there 'NaN' for the streamline weights? Can I consider them as zero weights?

@bcmcpher
Copy link
Collaborator

Hi @sarwart

Are you still having issues? I didn't produce any nan weights when I checked the tutorial data. Is this still the unmodified script?

Was this result with encode cloned from github or the container?

@sarwart
Copy link
Author

sarwart commented Feb 23, 2021

Hi @sarwart

Are you still having issues? I didn't produce any nan weights when I checked the tutorial data. Is this still the unmodified script?

Was this result with encode cloned from github or the container?

The result was from the container (https://doi.org/10.25663/bl.app.104)

@bcmcpher
Copy link
Collaborator

So I was able to run the Stanford tutorial data with MATLAB 2020a and the container (compiled from MATLAB 2019a) in Linux with no errors and I didn't get any NaN weights. This most likely means something is different in your overall MATLAB environment.

Can you give some more details about how you're set up? You said you were running in Windows, correct?

@sarwart
Copy link
Author

sarwart commented Mar 1, 2021

For Linux, I used HPC for running the code so I don't have any control on the overall setting of the environment. I loaded the MATLAB module, added the specified folder and dataset to the current path and executed the demo_LiFE.m scripts. For this I received NaN weights

For windows, I generated the mex files and repeated the above process but still I received the same NaN weights

mex -v Mtransp_times_b.c  Mtransp_times_b_sub.c
mex -v compute_diag.c compute_diag_sub
mex -v M_times_w.c M_times_w_sub.c

Using the containerised version, some of the streamlines had 'NaN' weights but not all of them like the previous cases. This was for the dataset provided for the demo. When I checked it with another HCP data, I didn't receive any NaNs for the weights

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants