Delete ROIs with low signal in nilearn

Hello!

Unfortunately, fmri data we use is not so good and there are some areas with bad signal, so we exclude these areas using brain mask. Further, we want to exclude ROIs, which contain too many zeroed voxels.

The question is: Is there any way to delete ROIs with low signal while extracting time-series in nilearn?
Now we use NiftiLabelsMasker to extract time series from ROIs.

This is something we were concerned about in XCP-D, so we have an interface that does what you’re talking about. Here’s the code, wrapped in a Nipype interface. It will need to be modified to work as a function: xcp_d/xcp_d/interfaces/connectivity.py at 895da8f728efb43bb594ac93c24c2a0ef8520264 · PennLINC/xcp_d · GitHub

1 Like

thank you so much! the code how to calculate this is truely brilliant