Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MRS-GABA-NMM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GIGA-CRC Human Imaging
Public
FASST
MRS-GABA-NMM
Merge requests
!1
Main
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Main
ipaparella/mrs-gaba-nmm:main
into
main
Overview
0
Commits
4
Pipelines
0
Changes
6
Open
Paparella Ilenia
requested to merge
ipaparella/mrs-gaba-nmm:main
into
main
1 month ago
Overview
0
Commits
4
Pipelines
0
Changes
6
Expand
0
0
Merge request reports
Viewing commit
b877c106
Prev
Next
Show latest version
6 files
+
452
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
b877c106
Update Create_GCMs.m, MRS_QC.m, and 4 more files...
· b877c106
Paparella Ilenia
authored
1 month ago
Codes/Create_GCMs.m
0 → 100755
+
59
−
0
Options
%% CODE TO CREATE GCM - GIT
% This code needs the usual your_paths.txt file.
% Once the NMM model is run, this code
% will create a GCM file to input in the PEB analysis.
%-----------------------------------------------------------------------
% Written by I. Paparella
% Cyclotron Research Centre, University of Liege, Belgium
% 14th December 2023
function
Create_GCMs
%% Path info
paths_txt
=
fileread
(
'your_paths.txt'
)
;
paths_txt
=
char
(
strsplit
(
paths_txt
,
'\n'
))
;
pathtodata
=
(
strtrim
(
paths_txt
(
2
,:)));
%% Pre define variables
GCM
=
[];
%% Select the subject to analyse
cd
(
pathtodata
);
[
subdir
]
=
spm_select
(
Inf
,
'dir'
,
'Select subject_ID directory'
);
IDs
=
str2num
(
subdir
(:,
end
-
2
:
end
));
%% Loop across subjects
for
isub
=
1
:
size
(
subdir
,
1
)
subject_ID
=
sprintf
(
'sub-%03d'
,
IDs
(
isub
));
subject_Path
=
strcat
(
pathtodata
,
'/'
,
subject_ID
,
'/TMS_EEG'
);
% Go in the session folder and load DCM
DCMfile_sess
=
spm_select
(
'List'
,
subject_Path
,
'DCM_DefaultCodes_.*.mat$'
);
if
isempty
(
DCMfile_sess
)
warning
(
'No DCM for subject %s, session %s was found. Please check the subjects you selected'
,
subject_ID
,
session
)
return
end
Loaded_DCMfile_sess
=
load
(
strcat
(
subject_Path
,
'/'
,
DCMfile_sess
));
% Fill the GCM according to the session with all subjects together
GCM
=
[
GCM
;
{
Loaded_DCMfile_sess
.
DCM
}];
end
% Make PEB directory
mkdir
(
strcat
(
pathtodata
,
'/PEB'
));
% Save GCM with the correct naming
nameTosav
=
'allFemale'
;
GCM
=
GCM
;
save
(
strcat
(
pathtodata
,
'/PEB/'
,
sprintf
(
'GCM_%s_%s'
,
session
,
nameTosav
)),
'GCM'
)
fprintf
(
'GCM has been created. \n'
)
end
\ No newline at end of file
Loading