nilearn / nistats

Modeling and statistical inference on fMRI data in Python
BSD 3-Clause "New" or "Revised" License
95 stars 55 forks source link

String value not accepted for the 'contrasts' parameter in make_glm_report for second level reports #405

Closed swaythe closed 5 years ago

swaythe commented 5 years ago

I was trying to generate reports using make_glm_report() with nistats 0.0.1b for a second level analysis (one sample t-test). The docstring says that the contrasts parameter can take string values, but when I pass it one, I get a KeyError. E.g. if contrasts = 'xyz', I get KeyError: 'xyz' and also UndefinedVariableError: name 'xyz' is not defined

The 'contrasts' parameter has no special meaning in this case, so it seems like I should be able to provide any string. I can make the function work if I set contrasts = [1].

jeromedockes commented 5 years ago

Thanks! could you share a small script to reproduce the error?

The 'contrasts' parameter has no special meaning in this case, so it seems like I should be able to provide any string. I can make the function work if I set contrasts = [1].

I am not sure what you mean. if it is a string 'contrasts' should describe a linear combination of the columns of the design matrix. for example if my design matrix is a pandas dataframe with columns ["left_hand", "righ_hand", ...], "contrasts" could be for example "left_hand", or "left_hand - right_hand".

kchawla-pi commented 5 years ago

@swaythe If you are working with Private data or scripts, you should check tih @bthirion what you can share before posting it here.

swaythe commented 5 years ago

Sorry, that was a premature filing. It's not an issue - I was not providing the correct string to 'contrasts'.

kchawla-pi commented 5 years ago

If you were not providing the column names from the design matrix, then this might be an opportunity for improving the documentation and the error message in GLM Reporter.