BenGutierrez / Meica_Report

in progress report form for meica.py from https://bitbucket.org/prantikk/me-ica
6 stars 3 forks source link

Sphinx error and output issues #1

Closed SaraRaf closed 7 years ago

SaraRaf commented 7 years ago

Hi, I'm attempting to run meica_report.py, but I get incomplete output files and the following errors:

/bin/sh: convert: command not found Sphinx error: Unable to generate Bokeh plot at /SJ/ME-ICA/meica.SJ_rest_E00/meica.Report/Dynamic.rst:52:list index out of range Makefile:53: recipe for target 'html' failed make: *** [html] Error 1 sphinx-build -b latex -d _build/doctrees . _build/latex

Any ideas what is causing these errors? I have attached the report. Many thanks,

Sara

Terminal Saved Output.pdf

BenGutierrez commented 7 years ago

Hi Sara,

It looks like you need the package ImageMagick installed in order to use the Convert command which is included in the Bokeh plot script. Im sorry I didn't mention it in the requirements page, I downloaded it a long time ago and forgot it wasn't a bash included command. I will update the requirements page. You can go to this page in order to get instruction on how to download the package:

http://www.howtogeek.com/109369/how-to-quickly-resize-convert-modify-images-from-the-linux-terminal/

If you encounter any other issues, just let me know and I'll be happy to try and help!

Best, Ben

SaraRaf commented 7 years ago

Hi Ben,

Many thanks for the prompt response. I think it all seems to have worked fine now. I am struggling to make sense of it all though. I was wondering if there are any sources you might suggest to help me understand the results?

Thanks again,

Sara

On 23 December 2016 at 19:54, BenGutierrez notifications@github.com wrote:

Hi Sara,

It looks like you need the package ImageMagick installed in order to use the Convert command which is included in the Bokeh plot script. Im sorry I didn't mention it in the requirements page, I downloaded it a long time ago and forgot it wasn't a bash included command. I will update the requirements page. You can go to this page in order to get instruction on how to download the package:

http://www.howtogeek.com/109369/how-to-quickly-resize- convert-modify-images-from-the-linux-terminal/

If you encounter any other issues, just let me know and I'll be happy to try and help!

Best, Ben

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BenGutierrez/Meica_Report/issues/1#issuecomment-269061142, or mute the thread https://github.com/notifications/unsubscribe-auth/AXl5a7Ip6bG5XwtwNXAIOWZLOGmL9UPVks5rLG1KgaJpZM4LVH7j .

BenGutierrez commented 7 years ago

Hi Sara,

Unfortunately I don't have a good one stop shop source for interpreting the results. This code was written by me for more in house use at the NIMH section on functional imaging methods with the purpose to try to understand how ME-ICA affects the data. The way we used it mostly was to examine the Kappa (TE dependent or BOLD related signal) and Rho (TE independent or non-BOLD related signal) to look if components that seemed more BOLD related were being rejected (which in some cases they were) and try to figure out exactly why that is. If I had a clearer idea of exactly what you were trying to use the report form I could try to direct you better. Also please understand that my understanding of these concepts is a drop in the bucket compared to the people over at functional imaging methods. They can be found at https://fim.nimh.nih.gov/people They also have some poster presentations which might be helpful in understanding how one goes about analyzing Multi-Echo data sets https://fim.nimh.nih.gov/projects/multi-echo-fmri

If I can help with anything else, please don't hesitate to ask!

Ben

SaraRaf commented 7 years ago

Hi Ben,

I am also just trying to understand why some of the rejected components that appear to have neural signal are being rejected. Thanks for the links, the poster presentation link is very helpful.

Best,

Sara

On 8 January 2017 at 12:04, BenGutierrez notifications@github.com wrote:

Hi Sara,

Unfortunately I don't have a good one stop shop source for interpreting the results. This code was written by me for more in house use at the NIMH section on functional imaging methods with the purpose to try to understand how ME-ICA affects the data. The way we used it mostly was to examine the Kappa (TE dependent or BOLD related signal) and Rho (TE independent or non-BOLD related signal) to look if components that seemed more BOLD related were being rejected (which in some cases they were) and try to figure out exactly why that is. If I had a clearer idea of exactly what you were trying to use the report form I could try to direct you better. Also please understand that my understanding of these concepts is a drop in the bucket compared to the people over at functional imaging methods. They can be found at https://fim.nimh.nih.gov/people They also have some poster presentations which might be helpful in understanding how one goes about analyzing Multi-Echo data sets https://fim.nimh.nih.gov/projects/multi-echo-fmri

If I can help with anything else, please don't hesitate to ask!

Ben

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BenGutierrez/Meica_Report/issues/1#issuecomment-271163801, or mute the thread https://github.com/notifications/unsubscribe-auth/AXl5a-G8yXeK36KxVeA-FB4EvOfG7PsTks5rQRcUgaJpZM4LVH7j .

BenGutierrez commented 7 years ago

Sara,

Im glad I can help. Another tool that might be helpful for debugging is a fork of the original me-ica i made. While I was at the NIH I made a branch of ME-ICA v2.5 beta11 which was designed to be more lenient in selecting components. https://bitbucket.org/BenGutierrez/me-ica. It was made with the idea that once this version was run, it contains a file called selcomp.py to be run after which can compare the results of the original me-ica and the more lenient version I made using output files that the new version makes. It will tell you what components are placed in each category for each version of the code. This version of me-ica was used in some of the posters I linked to earlier.

Good luck! Ben

handwerkerd commented 7 years ago

Adding to what Ben wrote, the current meica algorithm is not perfect. One reason for Ben's writing Meica_Report was to make it easier to look at the results and identify mis-classified components or other issues. I can't comment on why a specific component was mis-classified without more information, but the algorithm uses several selection criteria and sometimes runs into problems. For example, one of the original criteria was to weight against very high temporal variance components since those are often noise. For one of our studies, we discovered that this sometimes meant the large V1 response to a flashing checkerboard was rejected. The fork of me-ica that Ben referenced above should always keep more components. That means it's less likely for a truly neural component to be rejected, but some edge cases that should have been rejected are kept. On balance, I prefer keeping some unnecessary noise to removing the effect of interest.

Best,

Dan

SaraRaf commented 7 years ago

Hi Ben and Dan,

Apologies for my delayed response. Thank you both for the insight, it definitely cleared things up for me and I do appreciate it..

Ben, I'm trying to run select_model.py, but I have a feeling my inputs are incorrect. I initially got an error (sorry, can't remember what it was) and when I re-run it, it runs for some time but is not doing anything it seems. Would you mind clarifying the usage for the command?

Many thanks,

Sara

On 12 January 2017 at 16:03, handwerkerd notifications@github.com wrote:

Adding to what Ben wrote, the current meica algorithm is not perfect. One reason for Ben's writing Meica_Report was to make it easier to look at the results and identify mis-classified components or other issues. I can't comment on why a specific component was mis-classified without more information, but the algorithm uses several selection criteria and sometimes runs into problems. For example, one of the original criteria was to weight against very high temporal variance components since those are often noise. For one of our studies, we discovered that this sometimes meant the large V1 response to a flashing checkerboard was rejected. The fork of me-ica that Ben referenced above should always keep more components. That means it's less likely for a truly neural component to be rejected, but some edge cases that should have been rejected are kept. On balance, I prefer keeping some unnecessary noise to removing the effect of interest.

Best,

Dan

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BenGutierrez/Meica_Report/issues/1#issuecomment-272282692, or mute the thread https://github.com/notifications/unsubscribe-auth/AXl5a-KVYyDasL6HCOIPAxILvPeO7NNgks5rRpUSgaJpZM4LVH7j .

SaraRaf commented 7 years ago

Sorry, one other thing. Is there a way to manually remove the components, say from the mefl file, that you would know of? I have attempted to go through the code for meica.py and tedana.py to understand where/how the components are being removed, but it really is beyond my knowledge.

I also tried to use FSL's fsl_regfilt with meica_mix.1D as the design matrix file containing the time courses. However, I get an error saying 'incompatible dimensions exception'. I then put the 1D file into the same format as FSL accepts, but continued to get the same error (I was hoping this would be an easy fix).

Thanks again.

On 12 January 2017 at 20:54, BenGutierrez notifications@github.com wrote:

Sara,

Im glad I can help. Another tool that might be helpful for debugging is a fork of the original me-ica i made. While I was at the NIH I made a branch of ME-ICA v2.5 beta11 which was designed to be more lenient in selecting components. https://bitbucket.org/BenGutierrez/me-ica. It was made with the idea that once this version was run, it contains a file called selcomp.py to be run after which can compare the results of the original me-ica and the more lenient version I made using output files that the new version makes. It will tell you what components are placed in each category for each version of the code. This version of me-ica was used in some of the posters I linked to earlier.

Good luck! Ben

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BenGutierrez/Meica_Report/issues/1#issuecomment-272280410, or mute the thread https://github.com/notifications/unsubscribe-auth/AXl5ayqZfSw-FMIfwDSXTQObFbL4HUqpks5rRpL3gaJpZM4LVH7j .

BenGutierrez commented 7 years ago

Hi Sara,

So, select_model.py is a file that comes with Prantik's standard me-ica program. The program I was talking about it selcomps.py which will be in the same directory as select_model.py if you are looking in the version of the code that I edited which I linked to in my previous post. To get all of the options for how to run this, you can run "python selcomps.py -h". This program should be run in the directory that your me-ica outputs files exist in. The files it uses to make this comparison do not get outputted in Prantik's version of the code, so you do have to run my version first.

The other point I was making about the mixing matrix is that if you don't want to rerun all of me-ica when running my version of the code, you can use the script that me-ica outputs, and where it calls tedana.py, use the options that are in the original me-ica script and also the --mix option to include the old mixing matrix, ensuring that you don't run ICA again making it impossible to compare the original version of me-ica to the version I made with your current data. If you do this with the version of tedana.py that I edited then you can use selcomps.py.

To answer your other questions, I do not no of an easy way to remove components from mixing matrix. In fact I think that it would be pretty difficult, unless Dan has some way to do it nicely. And I have no working knowledge of FSL so unfortunately I cannot help there. It may be helpful to open up the data in python or matlab and just looking at what the dimensions are so that you can better understand why FSl is having problems with the dimensions.

Hope this helps, Ben

SaraRaf commented 7 years ago

Hi Ben,

Thanks! (and for providing these scripts.)

When I run your version of meica.py, I get the following error (using the same usage I used for Prantik's version-I've attached the full output): Traceback (most recent call last): File "/Users/srafique/abin/meica.py", line 562, in (startdir,dsprefix(nlatnsmprage),prefix,almaster,qwfres,'NN')) TypeError: not all arguments converted during string formatting

When I try to run selcomp.py -h, I get the following error: import: unable to grab mouse ': Resource temporarily unavailable @ error/xwindow.c/XSelectWindow/9182. /Users/srafique/abin/selcomp.py: line 9: Tells you which components are in each bin of meica.py. : command not found /Users/srafique/abin/selcomp.py: line 10: syntax error near unexpected token(' /Users/srafique/abin/selcomp.py: line 10: `def selcomps(seldict,orig,ne,var,debug=False,olevel=2,oversion=99,knobargs=''):'

Secondly (and likely a very silly question), as I understand, using --MNI only puts the anatomical into MNI space. Is this the file ending in ns_atnl? Yet, when I compare it to an MNI template, the two images appear to be different sizes. And would I be correct in saying that the ICA components maps are not in MNI, unless I use --mask_mode=template?

Best,

Sara meica.py error.pdf

BenGutierrez commented 7 years ago

Hi Sara,

Unfortunately, we are reaching the end of my ability to help debug over email. There should be no difference between Prantik's version of the meica.py script and mine. I did not edit it, only select_model.py. So you should be able to jump straight to the part of the script that calls the program tedana.py.

As for why selcomp.py is not working, when I downloaded it and ran "python selcomps.py -h" it showed me the option menu (however I did realize that it wasn't python 3 compatible so thanks to you I was able to fix that). I think your shell is trying to run the program rather then python. Just put the word python in front of your command and it should start working.

To be frank I don't know the answer to your last question. I am not an expert by any means in the preprocessing that occurs in the meica.py part of the script. I mainly worked with the ICA part of the code. As you have figured out by now, the Me-ica code is inscrutable at times and I don't have the time to go through and figure out the answer. Perhaps getting in contact with Prantik could clear this up.

Best, Ben