Neuro Imagin with Machine Learning
What is nilearn 1.0 ?¶
-
nilearnis a python way of doing work (statistical analysis) with Neuro Imaging in Python using machine learning. It uses scikit-learn Python toolbox. - It is a subset of a family of work done in python language related with Neuro Imaging.
- It is not a new technique or new science but provides modern pythonic way of dealing with old analysis done on neuro imaging data such as
MVPA, decoding, predictive modelling, functional connectivity, brain parcellations, connectomes. - It can also be used on different modalaties of
fMRIsuch astask fMRI, resting fMRI, or VBM data -
nilearnmakes the work of neuro imaging with machine learning a specific domain, orfeature engineeringconstruction.
Installation 1.1¶
- Use
pip install -U nilearnor use existing conda environment to installnilearn
Check installation 1.2¶
- Following line will check its installaiton.
In [1]:
import nilearn as ni
In [3]:
ni.version
Out[3]:
In [4]:
from nilearn import plotting
In [5]:
# Plotting glass brain
plotting.plot_glass_brain("data/sample-nifiti-file.nii")
Out[5]:
In [6]:
# plotting anatomical brain.
plotting.plot_anat("data/sample-nifiti-file.nii")
Out[6]:
In [7]:
# plotting
plotting.plot_epi("data/sample-nifiti-file.nii")
Out[7]:
In [9]:
# Using plot_img
plotting.plot_img("data/sample-nifiti-file.nii")
Out[9]:
In [26]:
# To read dicom daga
import pydicom as pd
import pydicom.data
# To plot it
import matplotlib.pyplot as plot
base = "data/"
pass_dicom = "IM-0001-0001.dcm"
fn = pd.data.data_manager.get_files(base,pass_dicom)[0]
ds = pd.dcmread(fn)
# To view read image
plot.imshow(ds.pixel_array, cmap=plot.cm.bone)
Out[26]:
In [ ]:
Comments