Questions tagged [nilearn]

Nilearn is a Python module for fast and easy statistical learning on NeuroImaging data. It leverages the scikit-learn Python toolbox for multivariate statistics with applications such as predictive modelling, classification, decoding, or connectivity analysis.

Nilearn is a Python module for fast and easy statistical learning on NeuroImaging data.

It leverages the scikit-learn Python toolbox for multivariate statistics with applications such as predictive modelling, classification, decoding, or connectivity analysis.

Resources

Nilearn

17 questions
2
votes
2 answers

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, I want my image to be (100, 100, 150). I would…
intl
  • 2,753
  • 9
  • 45
  • 71
2
votes
2 answers

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 of "/Users/audreyphan/Documents/Spring2020/DESPO/res4d/1/res4d_anat.nii" Here…
audreyphan
  • 21
  • 1
  • 2
1
vote
1 answer

How can I batch process creating masks from the color thresholder function?

I created a mask function using the color thresholder app. I would like to run multiple images through the function instead of each image individually. For example, 'Control_1 Negative P001(30).png', 'Control_1 Positive P001(30).png', etc until…
1
vote
1 answer

Removing/Hiding empty subplots in matplotlib, when plotting a flexible grid

I am using nilearn to plot a range of cuts along a axis through a 3D image file of a brain. My goal is to make a flexible function, in which I can change the number of rows, cols and coordinate range of the cuts as I please. The reason for this, is…
Lightnjer
  • 27
  • 5
1
vote
1 answer

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 subplots to present them using subplots. Here is what I…
Lightnjer
  • 27
  • 5
1
vote
1 answer

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 would I modify the associated affine with the…
intl
  • 2,753
  • 9
  • 45
  • 71
1
vote
0 answers

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 :…
Hela Yahyaoui
  • 29
  • 1
  • 6
1
vote
1 answer

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 extract a given number of principal components from my…
Johannes Wiesner
  • 1,006
  • 12
  • 33
1
vote
0 answers

How to create a pipeline with multiple inputs?

I want to apply feature selection by using a binary mask. The binary mask is created by using a template file and a threshold so that ones and zeros in the mask file correspond with values in the template object above or below that threshold. In the…
Johannes Wiesner
  • 1,006
  • 12
  • 33
1
vote
0 answers

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 image to extract a time series, which is what I…
cqferrier
  • 23
  • 3
1
vote
4 answers

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 module named 'nilearn'. What am I missing here ??
MD. Khairul Basar
  • 4,976
  • 14
  • 41
  • 59
0
votes
3 answers

Why it shows module 'nilearn' has no attribute 'plotting'?

When I run nilearn.plotting.plot_connectome() it shows me that module 'nilearn' has no attribute 'plotting', how is it possible? I have reinstalled the nilearn library many times and ran the code on a different computer, but it didn't work. Does…
Shawn
  • 1
0
votes
0 answers

FSLOUTPUTTYPE is not set

I am working on juptyter notebook in my VSCODE and when I try to run a command line in a cell as the following: !'directory of fsl software' -I 'path of the mask in the MNI space' -o 'path of output file -w 'path of transformation from MNI to…
0
votes
0 answers

How could I use multiple atlas for fmri classification using python

I am trying to do classification on autism fmri data by using multiple atlas. I have applied a python code for classification that is working well but now I want to do same thing by comparing multiple brain atlas. Like AAL, HO.
0
votes
0 answers

How to use numpy/nilearn with nifti files to do mask operations?

I have a large dataset of nifti scans, and each scan has a corresponding tumor segmentation mask also as a nifti file. There is also a brain stripping mask which is for the entire dataset. How can I use numpy or nilearn to use the brain stripping…
67705151
  • 1
  • 3
1
2