Matplotlib Animation for custom artist classes

Goal Hi, I am trying to animate a complex figure with several subplots and have started testing with the artist animation and the function animation methods. For now, my goal is to have the...

Nifti image into scikit learn

I wanted to use scikit-learn Machine learning variation to do data processing of my neuroimaging data, specifically, fMRI data in Nifti file type. Nilearn provides the platform. However, I don't...

Cannot import module in ipython

Hi I am having difficult importing nilearn in ipython I can see that the module is available in my conda environment but when I go into ipython and try and import it I get the import error: no...

How to generate a 3d ROI sphere in a specific location within a 3d file (python / nilearn)

My aim is to mask a 3D image at a given location with a 3d spherical mask. I want to extract all of the values of the image within this 3D mask I am currently using python's...

Cloning a package from github and use in spyder

I would like to create a copy of a package on github that I can edit and use in spyder. I currently use the anaconda package manager for my python packages. Here are the steps that I have taken...

SVC Classifier with 0% accuracy

I'm using SVC from Sklearn to discriminate between different matrices. The datas are 95 matrices of correlation, computed from IRM of patients with schizophrenia (50 matrices) and healty controls...

ImportError: No module named 'nilearn'

I'm trying to plot .nii data using nibabel and nilearn. I'm using python 3.5 and installed both packages successfully. But, when I'm trying to import the module, it's returning - ImportError: No...

Getting ValueError because of 4D numpy array? Sklearn and nilearn

I'm trying to load in some MRI grey matter map images as numpy arrays so they can be processed in sklearn. My code imports them and loads them using NiftiMasker (NiftiMasker applies a mask to the...

fsl.Merge() command not found (when using through nipype.interfaces)

I have already installed these: conda install -c conda-forge nipype conda install -c conda-forge nitime conda install -c conda-forge nibabel conda install -c conda-forge nilearn Sample...

"ImportError: DLL load failed while importing _openmp_helpers"?

I tried to import resample_img from nilearn.image to use in resampling some medical image. import nibabel as nib import nibabel.processing from nilearn.image import resample_img img =...

ModuleNotFoundError: No module named 'dicom' in a python env (tensorflow issue ?)

That's my first question here, but that won't be the first time Stack Overflow save me ! I am using conda on a windows10 machine and created my env with tensorflow 2.0 When I tried to add pydicom...

ImageFileError: Cannot work out file type of ".nii"

When I try to load my .NII file as a 4D Niimg-like object (I've tried both nilearn and nibabel), I get the below error Error: ImageFileError: Cannot work out file type...

conda update InvalidSpecError

I am trying to update a conda environment: conda update --all but get the following Fetching package metadata ............. InvalidSpecError: Invalid spec: =20190808 output of conda list is as...

Plot PCA components derived from sklearn.decomposition.PCA separately in three dimensional space

For my project, I work with three dimensional MRI data, where the fourth dimension represents different subjects (I use the package nilearn for this). I am using sklearn.decomposition.PCA to...

Swap axes of a 3D image in nilearn/numpy

I am working with some neuroimaging data and my dimensions for a scan is (100, 150, 100). I am currently working with the nibabel formatted file. Is there a nice way to swap the axes? For example,...

3D Image visualisation with nilearn

I used plot_glass_brain to visualize 3D image (Nifti) with nilearn but it is displayed incorrectly. see code and pictures below The 2_1_t2.nii file is available on this link :...

Reorder Nifti file axes

I have some 3D nifti files of dimension (50, 100, 50). I would like to flip the the y and z axes so that the dimension will be (50, 50, 100). What is the best way to go about doing this and how...

How to plot multiple slices of a 3D brain image with nilearn and matplotlib subplots

I'm new to coding, so if I'm completely wrong just tell me. I want to plot 25 slices of a brain scan using nilearn. These 25 slices should go along the z axis in steps of value=2. I want to use...