Hi, thank you for the new features!
I am using 1st and 2nd level models, which are working pretty well with SurfaceImages.
But I could not apply statistical thresholds on them.
It seems that non_parametric_inference is already accepting SurfaceImage as input, but I am getting the error message:
TypeError: Data given cannot be loaded because it is not compatible with nibabel format:
<SurfaceImage (204…
My input is a list of SurfaceImage, which worked well in the SecondLevelModel.
Am I doing something wrong?
Best,
Thx for reporting. Indeed 1st and second level model on the surface are pretty recent, and you are pointing to some not yet implemented part. We’re going to add it in the next release.
Sorry for the inconvenience.
Best,
Bertrand
To be clear you specifically want the non_parametric_inference approach?
At the moment the thresholding we have of surfaces is done at plot time :
Am currently working on adapting threshol_img to accept SurfaceImage
nilearn:main
← Remi-Gau:enh/surf_thres
opened 07:25AM - 30 Dec 24 UTC
<!---
This is a suggested pull request template for nilearn.
It's designed to … capture information we've found to be useful in reviewing pull requests.
If there is other information that would be helpful to include, please don't hesitate to add it!
Please make sure your pull request also follows the
[contribution guidelines](https://nilearn.github.io/stable/development.html#contribution-guidelines) that
will be enforced during the review process.
-->
<!-- Please indicate after the # which issue you're closing with this PR.
This is helpful for the maintainers AND will magically close the issue when this
pull request is merged!
If the PR closes multiple issues, includes "closes" before each one is listed.
https://help.github.com/articles/closing-issues-using-keywords -->
- Closes to #2747
- Relates to #4879
<!-- Please give a brief overview of what has changed in the PR.
If you're not sure what to write, consider it a note to the maintainers to indicate
what they should be looking for when they review the pull request. -->
Changes proposed in this pull request:
- Extend nilearn.image.threshold_img and nilearn.masking.load_mask_img to work with nilearn.surface.SurfaceImage
## TODO
- [x] add more specific test to make sure image are properly thresholded (check output)
- [ ] extend support to 2D surface image
I suspect that threshold_stats_img would be next.
I think cluster level inference will come much later as it not as easy to implement.
I understand that cluster level inference might take more time to be implemented.
However, any kind of statistical thresholding for surface (for example threshold_stats_img that you mentioned) would be of great value.
Looking forward to the these updates.
best,