Hello,
I would like to apply dictionary learning approach for clustering multi subject structural MRI into components. I am naive in nilearn so went through the tutorial. I have tried dictionary learning for resting state fmri (described in example). How I could use the same method for finding components based on group sMRI clustering?
Many thanks and best regards :)
How I could use the same method for finding components based on group sMRI clustering?
It should be the same as told in the tutorial/example you have seen. Make sure you tune the parameters in the Dictionary Learning object. Most parameters are tuned to fMRI. Input you are giving such as Nifti images/subjects should be in a list.
Dict learning should work on a list of 3D images.
Thanks a lot to both of you. Yes it worked finally after tuning some parameter for dictionary learning as well as canICA. However I would like to save each component image as nifti format to display it in spm.
"components_imgs.append(components_img)"
I am bit struggling to find the exact data structure to store it in suitable nifti format.
Again I am really sorry for the simple and trivial question regarding the data structure of the component images.
However I would like to save each component image as nifti format to display it in spm.
The function that you are looking for is nilearn.image.iter_img, to break
up the 4D image in a set of 3D images, like in:
http://nilearn.github.io/auto_examples/03_connectivity/plot_canica_resting_state.html#finally-we-plot-the-map-for-each-ica-component-separately
from nilearn import image
for i, img in enumerate(image.iter_img(component_imgs)):
img.to_filename('canica_%02i.nii' % i)
My comment assumes that you have components image in 4D components_img and last dimension represents the number of components.
Then, you can follow section 8.4.1.4. Finally, we plot the map for each ICA component separately in this example
It tries to explain how to plot each map using function available in Nilearn iter_img. Just replace plotting step with saving.
Thanks a lot to both of you. You guys really made my day. Yes now I could able to save each component separately in .nii format by using dictionary learning as well as canonical ICA approaches.
Thanks @nilover . Closing this one then.