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

32 ビュー (過去 30 日間)
Arjun
Arjun 2024 年 2 月 11 日
コメント済み: Arjun 2024 年 3 月 25 日
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 件のコメント
Karl
Karl 2024 年 2 月 19 日
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 2024 年 2 月 20 日
Thank you so much! I definitely will.

サインインしてコメントする。

採用された回答

Karl
Karl 2024 年 2 月 18 日
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 件のコメント
Arjun
Arjun 2024 年 3 月 25 日
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/

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Image Processing Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by