Variable radius parameter for NiftiSpheresMasker

Hello!

I have proposition regarding implementation of NiftiSpheresMasker (https://nilearn.github.io/modules/generated/nilearn.input_data.NiftiSpheresMasker.html#nilearn.input_data.NiftiSpheresMasker). It currently supports single value for radius parameter assuming that all ROIs have equal size. However, I am currently using 300 ROI Set (https://wustl.app.box.com/s/twpyb1pflj6vrlxgh3rohyqanxbdpelw) with different radii values for ROIs (4mm and 5mm). To extract all timeseries I have to loop over these values, filter my seeds list and change NiftiSpheresMasker instance.

Question for nilearn developers: what are your thoughts about making this class more generic and allow passing an iterable to account for variable radii values? I could implement that and submit PR.

I think a similar request was discussed in this issue:

the conclusion seems to be that this probably won’t be implemented, but
feel free to post additional details in that issue.
as noted there, a possible workaround may be to build an atlas and use
the LabelsMasker instead.

Thank you! I did not find that issue, sorry :slight_smile: