How to Get Grey Matter Volume of Specific Brain Regions in SPM/MATLAB?

36 visualizaciones (últimos 30 días)
I want to extract grey matter volume for specific regions (e.g., prefrontal cortex, amygdala) from MRI data that has been preprocessed. My lab gave me a code (see below) for calculating global grey matter volume (and white matter volume and CSF), but I am not sure whether I can adapt this script to also extract regional grey matter volume. Would appreciate help!
% Get total volumes in mm3
grey_totals(i) = get_totals ([data_path num2str(subnum) '/c1' num2str(subnum) '.nii']);
white_totals(i) = get_totals ([data_path num2str(subnum) '/c2' num2str(subnum) '.nii']);
csf_totals(i) = get_totals ([data_path num2str(subnum) '/c3' num2str(subnum) '.nii']);
end
  12 comentarios
Karl
Karl el 19 de Feb. de 2024
You're welcome! If you're unable to get the looping to work, please do submit another question, ideally including code and files for reproducing the problem (as you did in the comments here). Hopefully I, or someone else, will be able to help!
Arjun
Arjun el 20 de Feb. de 2024
Thank you so much! I definitely will.

Iniciar sesión para comentar.

Respuesta aceptada

Karl
Karl el 18 de Feb. de 2024
Summarising from the comments, if 'roi.nii' is a NIfTI file containing a binary mask representing a region of interest (ROI), and the Statistical Parametric Mapping (SPM12) package is on the MATLAB path, the ROI volume can be calculated using the get_totals() function written by Ged Ridgway:
% Calculate ROI volume using SPM12.
roi_volume = get_totals('roi.nii');
The ROI volume can also be calculated without having SPM12 installed:
% Write example ROI (cuboid) in NIfTI format.
mask = zeros(100,100,100);
[x1, y1, z1] = deal(31, 41, 11);
[dx, dy, dz] = deal(40, 20, 80);
mask(x1:x1+dx-1,y1:y1+dy-1,z1:z1+dz-1) = 1;
niftiwrite(mask,'roi.nii')
% Read ROI from NIfTI file, and calculate its volume.
roi_info = niftiinfo('roi.nii');
roi = niftiread(roi_info);
roi_volume = sum(roi(:)) * prod(roi_info.PixelDimensions)
roi_volume = 64000
% Check that the calculated volume is as expected from the cuboid dimensions.
assert(roi_volume == dx * dy * dz)
Whichever method is used, the volume units should be checked.
  1 comentario
Arjun
Arjun el 25 de Mzo. de 2024
Just wanted to add on for future users that the CAT12 toolbox in SPM also provides estimates for each ROI based on selected atlases. This made it very easy for me to extract ROI values for both grey matter volume and cortical thickness!
You can read more in the CAT12 manual available here: https://neuro-jena.github.io/cat12-help/

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Get Started with Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by