Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MR_spectroS
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
AG_Henning
MR_spectroS
Commits
e823a650
Commit
e823a650
authored
4 years ago
by
Tamas Borbath
Browse files
Options
Downloads
Patches
Plain Diff
Added the export and fitting also of the MC water signals
parent
aad3d1bb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
createTestData/fittingLCModelWithTransfer.m
+10
-2
10 additions, 2 deletions
createTestData/fittingLCModelWithTransfer.m
createTestData/fitting_all_test_data_profit.m
+16
-0
16 additions, 0 deletions
createTestData/fitting_all_test_data_profit.m
with
26 additions
and
2 deletions
createTestData/fittingLCModelWithTransfer.m
+
10
−
2
View file @
e823a650
function
fittingLCModelWithTransfer
(
LCModelCallerInstance
,
localFilePath
,
filenameData
,
dataPath
,
...
filenameWater
,
waterPath
,
currentTEString
,
copyFiles
)
filenameWater
,
waterPath
,
currentTEString
,
copyFiles
,
fitWater
)
if
~
exist
(
'fitWater'
,
'var'
)
fitWater
=
false
;
end
extensionTable
=
'.table'
;
extensionCoord
=
'.coord'
;
defaultTE
=
'TE24'
;
...
...
@@ -9,7 +13,11 @@ defaultLCModelUser = 'tborbath';
defaultSpectraName
=
'XXXX'
;
defaultWaterRefName
=
'YYYY'
;
controlFilesBase
=
'fitsettings_'
;
controlFilesBaseSuffix
=
'_Metabolite.control'
;
if
fitWater
controlFilesBaseSuffix
=
'_MC_Water.control'
;
else
%normal case
controlFilesBaseSuffix
=
'_Metabolite.control'
;
end
%% file paths setup
controlFilesPathLocal
=
[
localFilePath
,
'LCModelConfig/'
];
...
...
This diff is collapsed.
Click to expand it.
createTestData/fitting_all_test_data_profit.m
+
16
−
0
View file @
e823a650
...
...
@@ -97,6 +97,7 @@ for indexSubj = 1:numberOfSubjects
concentrations
=
cell
(
numberOfTEs
,
length
(
namingSuffixesAve
));
concentrations_H2O
=
cell
(
numberOfTEs
,
length
(
namingSuffixesAve
));
concentrations_MC_H2O
=
cell
(
numberOfTEs
,
length
(
namingSuffixesAve
));
if
~
fitLCModel
FQNs
=
cell
(
numberOfTEs
,
length
(
namingSuffixesAve
));
FQNs2
=
cell
(
numberOfTEs
,
length
(
namingSuffixesAve
));
...
...
@@ -112,6 +113,10 @@ for indexSubj = 1:numberOfSubjects
filenameData
=
[
subjects
{
indexSubj
},
'_'
,
TE_string
namingSuffixAve
namingSuffixCoil
truncSuffix
];
dataExportPathTE
=
[
dataExportPath
{
indexSubj
},
'\\'
,
TE_string
,
'\\'
];
load
([
dataExportPathTE
,
filenameData
,
'.mat'
],
'a'
)
MC_mix
=
2
;
filenameData_MC_water
=
[
filenameData
,
'_MC_water'
];
a
.
ExportLcmRaw
(
dataExportPathTE
,
filenameData_MC_water
,
false
,
'No'
,
-
4.7
,
0.05
,
MC_mix
);
if
fitLCModel
if
use_water_references
try
...
...
@@ -120,6 +125,12 @@ for indexSubj = 1:numberOfSubjects
movefile
([
outputFilesPathLocal
filenameData
'.*'
],
dataExportPathTE
);
concentrations
{
indexTE
,
indexAverageDelete
,
indexCoilDelete
}
=
...
importConcentrationLCModelTable
([
filenameData
'.table'
],
dataExportPathTE
,
TE_string
,
'Met moiety'
);
%MC_water
% fittingLCModelWithTransfer(LCModelCallerInstance, pathBaseExportFiles, ...
% filenameData_MC_water, dataExportPathTE, filenameWater, waterPath, TE_string, copyFiles, true);
% movefile([outputFilesPathLocal filenameData_MC_water '.*'], dataExportPathTE);
% concentrations_MC_H2O{indexTE,indexAverageDelete, indexCoilDelete} = ...
% importConcentrationLCModelTable([filenameData_MC_water '.table'],dataExportPathTE, TE_string, 'Met moiety');
catch
concentrations
{
indexTE
,
indexAverageDelete
,
indexCoilDelete
}
=
{};
continue
;
...
...
@@ -132,6 +143,7 @@ for indexSubj = 1:numberOfSubjects
else
%TODO
if
use_water_references
fittingProFit
(
filenameData
,
dataExportPathTE
,
filenameWater
,
waterPath
,
TEs
(
indexTE
),
TR
,
dataExportPathTE
);
fitting_MC_water
(
filenameData_MC_water
,
dataExportPathTE
,
TEs
(
indexTE
),
TR
,
dataExportPathTE
)
else
fittingProFit
(
filenameData
,
dataExportPathTE
,
[],
[],
TEs
(
indexTE
),
TR
,
dataExportPathTE
);
end
...
...
@@ -139,6 +151,8 @@ for indexSubj = 1:numberOfSubjects
plot_ProFit_Metabolites_Fit
([
filenameData
,
'_profit.mat'
],
dataExportPathTE
,
'Met'
,
true
);
load
([
dataExportPathTE
,
filenameData
,
'_profit_H2O.mat'
],
'concH2O'
);
concentrations_H2O
{
indexTE
,
indexAverageDelete
,
indexCoilDelete
}
=
concH2O
;
load
([
dataExportPathTE
,
filenameData_MC_water
,
'_profit.mat'
],
'concH2O'
);
concentrations_MC_H2O
{
indexTE
,
indexAverageDelete
,
indexCoilDelete
}
=
concH2O
;
end
close
all
end
...
...
@@ -146,9 +160,11 @@ for indexSubj = 1:numberOfSubjects
end
if
fitLCModel
save
([
dataExportPath
{
indexSubj
},
'concentrations'
truncSuffix
'.mat'
],
'concentrations'
);
save
([
dataExportPath
{
indexSubj
},
'concentrations'
,
truncSuffix
'_MC_H2O.mat'
],
'concentrations_MC_H2O'
);
else
save
([
dataExportPath
{
indexSubj
},
'concentrations'
,
truncSuffix
'_profit.mat'
],
'concentrations'
,
'activeMetabolites'
,
'FQNs'
,
'FQNs2'
);
save
([
dataExportPath
{
indexSubj
},
'concentrations'
,
truncSuffix
'_H2O_profit.mat'
],
'concentrations_H2O'
);
save
([
dataExportPath
{
indexSubj
},
'concentrations'
,
truncSuffix
'_MC_H2O_profit.mat'
],
'concentrations_MC_H2O'
);
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment