-
Notifications
You must be signed in to change notification settings - Fork 0
/
DSC_main_demo_v2.m
59 lines (45 loc) · 2.33 KB
/
DSC_main_demo_v2.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
% DSC_mri_toolbox demo
% ------ Load the dataset to be analyzed ---------------------------------
DSC_info = niftiinfo(fullfile('demo-data','GRE_DSC1.nii.gz'));
DSC_volume = niftiread(DSC_info);
% ------ Set minimum acquistion parameters -------------------------------
TE = 0.025; % 25ms
TR = 1.55; % 1.55s
% ------ Perform quantification ------------------------------------------
% Input DSC_volume (4D matrix with raw GRE-DSC acquisition)
% TE (Echo time)
% TR (Repetition time)
% Output cbv (3D matrix with standard rCBV values)
% cbf (struct with 3D matrices of rCBF values for each method selected)
% mtt (struct with 3D matrices of MTT values for each method selected)
% cbv_lc (3D matrix with leackage corrected rCBV values)
% ttp (3D matrix with leackage corrected Time to Peak values)
% mask (3D matrix with computed mask)
% aif (struct with AIF extracted with clustering algorithm)
% conc (4D matrix with pseudo-concentration values)
% s0 (3D matrix with S0 estimates from pre-contrast images)
[cbv,cbf,mtt,cbv_lc,ttp,mask,aif,conc,s0]=DSC_mri_core(DSC_volume,TE,TR);
% ------ View Results ----------------------------------------------------
DSC_mri_show_results(cbv_lc,cbf,mtt,ttp,mask,aif,conc,s0);
% ------ Save Results in NIFTI format ------------------------------------
% ------ use header information of the original DSC-MRI sequence ---------
% Code Modified By Shreya Jain
% Dated- 3rd May, 2023
nifti_template = DSC_info;
nifti_template.Datatype= 'double';
nifti_template.BitsPerPixel= 64;
nifti_template.PixelDimensions=nifti_template.PixelDimensions(1:3);
var_outDirName = 'demo-data';
var_outParams = [cbv, cbf, mtt, cbv_lc];
var_outparamsStr = ["cbv_","cbf_","mtt_","cbv_lc_"];
for param=var_outParams
for str=var_outparamsStr
var_fieldnames = fieldnames(param);
var_arr_outFileNames=cell(length(var_fieldnames),1);
for fn=1:length(var_fieldnames)
var_arr_outFileNames{fn}=str+var_fieldnames{fn,1}+".nii";
disp(var_arr_outFileNames{fn,1})
end
func_niftiwrite (nifti_template, param, var_arr_outFileNames, var_outDirName,str);
end
end