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

Make class accept images instead of arrays #29

Closed tsalo closed 3 years ago

tsalo commented 3 years ago

Originally, we wanted to have the function operate on images and the class operate on arrays, in case we could get rid of the spatial elements of the algorithm (see #5). Since that's not possible anymore, the way we pass around a 3D shape tuple and a 1D mask vector is more than a little awkward. We can just move the image-related code from the function to the class and pass in a data image and a mask image to clean up the interface.

tsalo commented 3 years ago

@eurunuela and @notZaki, I have two questions:

  1. Can we switch to using nilearn's masking/unmasking functions now? I know that the results were different, but if we're consistent throughout the functions, it should be fine, right?
  2. Should we convert any image-like outputs (i.e., component maps) back to images when we fit/transform? I'm leaning toward yes, but want to know what you think.
eurunuela commented 3 years ago
  1. Can we switch to using nilearn's masking/unmasking functions now? I know that the results were different, but if we're consistent throughout the functions, it should be fine, right?

Yes, it should be fine. We would need to update the tests though.

  1. Should we convert any image-like outputs (i.e., component maps) back to images when we fit/transform? I'm leaning toward yes, but want to know what you think.

I think we should, yes. We could make the class hold both; e.g., x and x_nii.

notZaki commented 3 years ago

I'm in favour of using nilearn's functions.

I don't know enough to comment on the outputs, but it sounds ok to me---it certainly makes the types more symmetric between input-output