CAT12 gyrification index and sulcal depth import in brainstorm

Hi everyone, I'm computing segmentation with CAT12 directly with the SPM toolbox. It allows to compute other cortical measures like gyrification index, sulcal depth and cortical complexity. These file are stored in the same way of the thickness file, one for each hemisphere. Unfortunately, brainstorm does not automatically import also the sulcal depth and the gyrification index. The brainstorm function to import CAT 12 folder + thickness finds and imports the thickness with these code lines:

% Find thickness maps
if isExtraMaps
ThickLhFile = file_find(CatDir, 'lh.thickness.', 2);
ThickRhFile = file_find(CatDir, 'rh.thickness.
', 2);
end

%% ===== IMPORT THICKNESS MAPS =====
if isExtraMaps && ~isempty(CortexHiFile) && ~isempty(ThickLhFile) && ~isempty(ThickLhFile)
% Create a condition "CAT12"
iStudy = db_add_condition(iSubject, 'CAT12');
% Import cortical thickness
ThickFile = import_sources(iStudy, CortexHiFile, ThickLhFile, ThickRhFile, 'FS');
end

Considering that sulcal depth and gyrification index are stored in the same way of thickness, if I add some code lines like:
% Find gyridication index
if isExtraMaps
GyriLhFile = file_find(CatDir, 'lh.gyrification.', 2);
GyriRhFile = file_find(CatDir, 'rh.gyrification.
', 2);
end

and then I import the data in the same way of the thickness,
%% ===== IMPORT Gyrification index =====
if isExtraMaps && ~isempty(CortexHiFile) && ~isempty(GyriLhFile) && ~isempty(GyriLhFile)
% Create a condition "CAT12"
iStudy = db_add_condition(iSubject, 'CAT12');
% Import gyrification map
GyriFile = import_sources(iStudy, CortexHiFile, GyriLhFile, GyriRhFile, 'FS');
end

do you think it could work?
Thanks

1 Like

it sounds useful!

Yes, it could work.

It would be useful to add it in the option of the Brainstorm process that calls CAT12. This way you wouldn't have to run it separately.

What do we need to change in this SPM batch in order to compute these missing files?
https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/process/functions/process_segment_cat12.m#L253

@CGaser

Hi Francois, I have modified the import_anatomy_cat, and now it imports correctly gyrification index, sulcal depth and cortical complexity. Unfortunately I don't think my solution is formally correct in the code, I mean... it works but I'm sure it could be much better if you modify it. But, let me know and if you need I'll send you the modified import_anatomy_cat file
best
Gian

I'd be happy to review your modifications to import_anatomy_cat.m and consolidate them in the Brainstorm github repository. Please share your modified file here, or open a new PR on the Brainstorm Github repository (https://github.com/brainstorm-tools/brainstorm3).

However, for it to meaningful, we would also need to add an option to the CAT12 segmentation process in Brainstorm to compute these additional files.

How do you call CAT in order to obtain these files?
What do we need to change in this SPM batch in order to compute these missing files?

Hi Francois, I normally use CAT12 directly from SPM. In CAT12 the extraction of the additional surface indices (gyrification, sulcal depth and cortical complexity) is computed in a separated step, therefore I don't know how to call it directly from brainstorm. I use the surface tool of CAT12 after the segmentation, and I select 'Extract additional surface parameters'.
After that I import the surface in brainstorm with all the indices with the import_anatomy_cat that I modified a bit. I uploaded the revised fuction here.

import_anatomy_cat.m (23.5 KB)

Thanks!

@CGaser Is computing these files as simple as adding a few options to the script above?
Could you help me with this if you think this is something relevant to the Brainstorm interface?

The majority of functions in CAT12 can be called as batch and is therefore easily scriptable. However, the additional surface measures such as gyrification of cortical complexity are rather thought for analyzing folding.
Anyway, to extract these measures you can script that:
matlabbatch{1}.spm.tools.cat.stools.surfextract.data_surf = '';
matlabbatch{1}.spm.tools.cat.stools.surfextract.GI = 1;
matlabbatch{1}.spm.tools.cat.stools.surfextract.SD = 1;
matlabbatch{1}.spm.tools.cat.stools.surfextract.FD = 0;
matlabbatch{1}.spm.tools.cat.stools.surfextract.nproc = 0;

If you use several scripts in a SPM batch, the scripts (e.g. preprocessing, extracting) has to be numbered separately. Thus, the preprocessing would use:
matlabbatch{1}.spm.tools.cat.estwrite.data = 'your_file_here';
...
while the extraction script moves on with:
matlabbatch{2}.spm.tools.cat.stools.surfextract.data_surf(1) = cfg_dep('CAT12: Segmentation (current release): Left Central Surface', substruct('.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('()',{1}, '.','lhcentral', '()',{':'}));
matlabbatch{2}.spm.tools.cat.stools.surfextract.GI = 1;
matlabbatch{2}.spm.tools.cat.stools.surfextract.SD = 1;
matlabbatch{2}.spm.tools.cat.stools.surfextract.FD = 0;
matlabbatch{2}.spm.tools.cat.stools.surfextract.nproc = 0;

These batches allow to use dependencies, such as shown above with the use of the left central surface from the preprocessing as input for the value extraction. This can be tried in the batch editor in SPM12 where the dependencies are listed for all steps.

Best,

Christian

Thanks!

It's done, update Brainstorm to try it:
https://github.com/brainstorm-tools/brainstorm3/commit/5911ce6e440b03e208a8ffe591b0273f4bf89306

New option in the process "Segment MRI with CAT12": "Import additional cortical maps"
image

These new maps are computed and then loaded by a modified version of import_anatomy_cat.m.
@gianmarcoduma Your changes are now permanently integrated in Brainstorm.

(PS: I wrote this message while my test was running, I'm posting it without having the results... maybe wait until tomorrow to actually try it :slight_smile: )

1 Like

It's fantastic, thank you so much!!!