jimmyshen007 / NeMo

NeMo brain tractograms tool
BSD 2-Clause "Simplified" License
13 stars 8 forks source link

Error trying to run NeMo #2

Open tfunck opened 7 years ago

tfunck commented 7 years ago

I tried to run NeMo with a white matter alteration mask in MNI space (with 181 x 218 x 181 dimensions), but got the following problem. My alteration mask is a binary mask (1 where there is WM damage, 0 elsewhere), but I'm not sure if this is correct.

Calculating ChaCo for patient 1 of 2 Error using intersect>intersectR2012a (line 228) Inputs A and B must be matrices with the same number of columns in the 'rows' case.

Error in intersect (line 137) [varargout{1:nlhs}] = intersectR2012a(varargin{1:2},logical(flaginds(1:3)));

Error in ChaCoCalc>PathDisruption (line 307) intvox = intersect(path_floor',[WMi,WMj,WMk],'rows');

Error in ChaCoCalc (line 177) [AZ_file,~] = PathDisruption(Damage,ROI_num_filename,OutPathFileName,PathsByRegion);

Error in NeMo_GUI>pushbutton1_Callback (line 156) ChaCoCalc(damagefile, coregMNI, 'MNI', atlas, saveFolder, 1, 0, 0);

Error in gui_mainfcn (line 95) feval(varargin{:});

Error in NeMo_GUI (line 43) gui_mainfcn(gui_State, varargin{:});

Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)NeMo_GUI('pushbutton1_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating UIControl Callback

ghost commented 4 years ago

Hi, I get the same error trying to run NeMo tool. Any solution?

amykuceyeski commented 4 years ago

I believe this is related to the error when you have NaNs in your input lesion mask. Please check if there are any, remove them and let me know if that solves it. Thanks!

Sent from my iPhone

On Jan 28, 2020, at 5:45 PM, Giuseppe1988 notifications@github.com wrote:

 Hi, I get the same error trying to run NeMo tool. Any solution?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ghost commented 4 years ago

Dear Amy, no NaNs in the input mask, only lesions as 1 and background as zero. Anyway, I think I have a deeper problem since I can't manage to get everything I wanted for my analysis from the example mask provided with the tool either. I have Matlab R2019b with spm12. I just added the NeMo folder to Matlab's path and launched the NeMo_GUI, do I have to setup some variables first? Right now I just manage to get the ChaCo scores (in .mat or as csv), no graphs or network metrics. My aim is to get the ChaCo scores, as long as local and global network properties and relative plots, from a large number of lesion masks in the MNI space. Is there a way to batch the whole procedure? Do you suggest running the processes from the command line (any example code?)?

Thanks you so much for your help!

Il giorno mer 29 gen 2020 alle ore 01:55 amykuceyeski < notifications@github.com> ha scritto:

I believe this is related to the error when you have NaNs in your input lesion mask. Please check if there are any, remove them and let me know if that solves it. Thanks!

Sent from my iPhone

On Jan 28, 2020, at 5:45 PM, Giuseppe1988 notifications@github.com wrote:

 Hi, I get the same error trying to run NeMo tool. Any solution?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jimmyshen007/NeMo/issues/2?email_source=notifications&email_token=ADKJKHLNM7VZ6QULM3T4CKDRADHW7A5CNFSM4DBDXZVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKFSIJA#issuecomment-579544100, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKJKHJRTLBGUHYCPBOYTFLRADHW7ANCNFSM4DBDXZVA .

-- Giuseppe Pontillo, MD Neuroradiologist Department of Advanced Biomedical Sciences University "Federico II" Via Pansini, 5 80131 - Naples - ITALY Tel: +39 0817462560 MP: +39 328 1286786

ghost commented 4 years ago

Dear Amy, it was a Matlab version problem. I ran the analysis with MatlabR2011 (after setting the right paths for the different tools). I managed to batch the process using the ChaCoCalc.m script and got the corresponding .csv files with writeExcel.m, obtaining the "Regions" file with the change in connectivity score for all GM parcels. Now I have some questions:

Thanks in advance for your help!

Regards, Giuseppe

Il giorno dom 2 feb 2020 alle ore 20:00 Giuseppe Pontillo < giuseppe.pon@gmail.com> ha scritto:

Dear Amy, no NaNs in the input mask, only lesions as 1 and background as zero. Anyway, I think I have a deeper problem since I can't manage to get everything I wanted for my analysis from the example mask provided with the tool either. I have Matlab R2019b with spm12. I just added the NeMo folder to Matlab's path and launched the NeMo_GUI, do I have to setup some variables first? Right now I just manage to get the ChaCo scores (in .mat or as csv), no graphs or network metrics. My aim is to get the ChaCo scores, as long as local and global network properties and relative plots, from a large number of lesion masks in the MNI space. Is there a way to batch the whole procedure? Do you suggest running the processes from the command line (any example code?)?

Thanks you so much for your help!

Il giorno mer 29 gen 2020 alle ore 01:55 amykuceyeski < notifications@github.com> ha scritto:

I believe this is related to the error when you have NaNs in your input lesion mask. Please check if there are any, remove them and let me know if that solves it. Thanks!

Sent from my iPhone

On Jan 28, 2020, at 5:45 PM, Giuseppe1988 notifications@github.com wrote:

 Hi, I get the same error trying to run NeMo tool. Any solution?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jimmyshen007/NeMo/issues/2?email_source=notifications&email_token=ADKJKHLNM7VZ6QULM3T4CKDRADHW7A5CNFSM4DBDXZVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKFSIJA#issuecomment-579544100, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKJKHJRTLBGUHYCPBOYTFLRADHW7ANCNFSM4DBDXZVA .

-- Giuseppe Pontillo, MD Neuroradiologist Department of Advanced Biomedical Sciences University "Federico II" Via Pansini, 5 80131 - Naples - ITALY Tel: +39 0817462560 MP: +39 328 1286786

-- Giuseppe Pontillo, MD Neuroradiologist Department of Advanced Biomedical Sciences University "Federico II" Via Pansini, 5 80131 - Naples - ITALY Tel: +39 0817462560 MP: +39 328 1286786

amykuceyeski commented 4 years ago

Hi Giuseppe -

One very important point, if you are trying to investigate lesions that represent injury/damage to WM then you will need to put in a mask of negative values (e.g. -1) NOT positive values. I created the tool to be able to handle both injury to WM and increases in WM integrity measures. You may need to rerun the analyses after making your masks negative. One way to check this is that the ChaCo scores (main outcome of the NeMo tool that is the percent of WM streamlines connecting to each GM region that pass through the lesion mask) are negative, indicating losses in connectivity. The ChaCo scores can be found in the struct/element ChaCoResults(1).Regions loaded in from the ChaCo_MNI.mat file. ChaCoResults(1).ConMatMetrics are the graph theoretical measures (characteristic path length, efficiency, radius and diameter) for the matrix (averaged over the 73 controls in the tool) that resulted from removing the streamlines that passed through your lesion mask. I would recommend launching the GUI for the plotting tools or you can download the separate visualizer on GitHub (Brainography).

Let me know if you have any other questions, thanks! Amy

On Feb 5, 2020, at 6:51 AM, Giuseppe1988 notifications@github.com wrote:

Dear Amy, it was a Matlab version problem. I ran the analysis with MatlabR2011 (after setting the right paths for the different tools). I managed to batch the process using the ChaCoCalc.m script and got the corresponding .csv files with writeExcel.m, obtaining the "Regions" file with the change in connectivity score for all GM parcels. Now I have some questions:

  • What do the metrics in the "ConMatMetrics" file represent (global network metrics?)?
  • How do I get local network metrics for each GM parcel?
  • How do I get plots of the results? I'm trying with the PlotChaCoResults.m script fed with the ChaCo_MNI.mat results' file but I'm having some troubles. Do you have some example code of how to run the command?

Thanks in advance for your help!

Regards, Giuseppe

Il giorno dom 2 feb 2020 alle ore 20:00 Giuseppe Pontillo < giuseppe.pon@gmail.com> ha scritto:

Dear Amy, no NaNs in the input mask, only lesions as 1 and background as zero. Anyway, I think I have a deeper problem since I can't manage to get everything I wanted for my analysis from the example mask provided with the tool either. I have Matlab R2019b with spm12. I just added the NeMo folder to Matlab's path and launched the NeMo_GUI, do I have to setup some variables first? Right now I just manage to get the ChaCo scores (in .mat or as csv), no graphs or network metrics. My aim is to get the ChaCo scores, as long as local and global network properties and relative plots, from a large number of lesion masks in the MNI space. Is there a way to batch the whole procedure? Do you suggest running the processes from the command line (any example code?)?

Thanks you so much for your help!

Il giorno mer 29 gen 2020 alle ore 01:55 amykuceyeski < notifications@github.com> ha scritto:

I believe this is related to the error when you have NaNs in your input lesion mask. Please check if there are any, remove them and let me know if that solves it. Thanks!

Sent from my iPhone

On Jan 28, 2020, at 5:45 PM, Giuseppe1988 notifications@github.com wrote:

 Hi, I get the same error trying to run NeMo tool. Any solution?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jimmyshen007/NeMo/issues/2?email_source=notifications&email_token=ADKJKHLNM7VZ6QULM3T4CKDRADHW7A5CNFSM4DBDXZVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKFSIJA#issuecomment-579544100, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKJKHJRTLBGUHYCPBOYTFLRADHW7ANCNFSM4DBDXZVA .

-- Giuseppe Pontillo, MD Neuroradiologist Department of Advanced Biomedical Sciences University "Federico II" Via Pansini, 5 80131 - Naples - ITALY Tel: +39 0817462560 MP: +39 328 1286786

-- Giuseppe Pontillo, MD Neuroradiologist Department of Advanced Biomedical Sciences University "Federico II" Via Pansini, 5 80131 - Naples - ITALY Tel: +39 0817462560 MP: +39 328 1286786 — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jimmyshen007/NeMo/issues/2?email_source=notifications&email_token=ABELHR2MISXADDHZNHUQAJTRBKR3LA5CNFSM4DBDXZVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEK3EXSY#issuecomment-582372299, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABELHRY7NLILU634BMJVZ5LRBKR3LANCNFSM4DBDXZVA.

grigori-yourganov commented 4 years ago

This is indeed a Matlab version problem. For some reason, Matlab changed the way incomputed set intersections, sometime bertween versions 2011 and 2013. To make it run with newer versions of Matlab, you will need to change the line 307 of ChaCoCalc.m, from intvox = intersect(path_floor',[WMi,WMj,WMk],'rows'); to intvox = intersect(path_floor',[WMi,WMj,WMk],'rows', 'legacy');

I have successfully tested it in Matlab 2018b and 2019.