ME-ICA / mapca

A Python implementation of the moving average principal components analysis methods from GIFT
GNU General Public License v2.0
6 stars 8 forks source link

Operate on images in subsampling function #31

Open tsalo opened 3 years ago

tsalo commented 3 years ago

If the subsampling function operates on images, it will be easier to use nilearn's functions for masking/unmasking the data. See #32.

Original post:

How do you all feel about using nilearn.image.resample_img() for utils.subsampling()? I am working on #29, and I think it would be easier have a function that downsamples and returns images instead of arrays.

tsalo commented 3 years ago

Actually, downsampling and subsampling may be different tasks. We can still make the subsampling function work on images though.

eurunuela commented 3 years ago

How do you all feel about using nilearn.image.resample_img() for utils.subsampling()? I am working on #29, and I think it would be easier have a function that downsamples and returns images instead of arrays.

I don't think nilearn.image.resample_img() is what we're looking for.

Actually, downsampling and subsampling may be different tasks. We can still make the subsampling function work on images though.

I don't see why we would need to do this. The subsampling happens inside the fitting function, where images are already in matrix format. Is there any other case where we would want to subsample images?

tsalo commented 3 years ago

Agreed that resample_img is not the right tool. However, I will say that having subsampling operate on images will make it easier to stick with nilearn's masking and unmasking functions internally. At that point, though, the results will be the same and the changes will be buried deep in the code, so it's not the big change that using resample_img would be.