forked from stabinska/IDEAL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIDEAL_Script.m
64 lines (60 loc) · 2.96 KB
/
IDEAL_Script.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
60
61
62
63
64
%% IDEAL Script
%
% Define the parameters for IDEAL fitting
%
%
%% Struct with settings
% NLLS fit settings
P.op.Display = 'Off';
P.op.Algorithm = 'Trust-Region';
P.op.MaxIter = 600;
P.Model = 'Biexp';
% Start parameter, upper and lower points, and tolerance level during the
% IDEAL resampling. The tolerance level for step n + 1 is given in percent of the
% paramter estimated during the resampling step n, e.g.,
% finterm_step_n +- 0.2*finterm_step_n is the startpoint and lower/upper
% limit for step n + 1.
switch P.Model
case {"biexp","Biexp"}
% f_fast D_slow D_fast S_0
P.op.Lower = [0.01 0.0011 0.003 10];
P.op.StartPoint = [0.1 0.0015 0.005 210];
P.op.Upper = [0.7 0.003 0.01 1000];
case {"triexp","Triexp"}
% finterm ffast Dslow Dinterm Dfast S0 Triexp
P.op.Lower = [0.1 0.01 0.0011 0.003 0.01 10];
P.op.StartPoint = [0.2 0.1 0.0015 0.005 0.1 210];
P.op.Upper = [0.7 0.7 0.003 0.01 0.5 1000];
end
P.Tol = [0.2 0.1 0.5];
% Size of the image matrix for each resampling step. Should end with the
% original image matrix size
P.Dims_steps = [1 1;
2 2;
4 4;
8 8;
16 16;
32 32;
64 64;
96 96;
128 128;
152 152;
176 176];
% b-vlaues set during the acquisition
P.b_values = [0,10,20,30,50,70,100,150,200,250,300,350,450,550,650,750];
P.slice = 1;
% Output folder for the plots (will be created automatically)
P.outputFolder = 'E:\home\Thomas\Sciebo\Projekte\Kidney_IDEAL\test_data_julia\output_exp';
% P.outputFolder = '/mnt/SharedData/home/thomas/Sciebo/Projekte/Kidney_IDEAL/test_data_julia/output_tt';
P.plot = 1; %Plot flag
%% Call IDEAL fit
% Include path to 3D DWI nifti file, parameter struct, nifit mask, and a
% cell array of nifit ROIs for the statistics (optional)
%
Data = 'E:\home\Thomas\Sciebo\Projekte\Kidney_IDEAL\test_data_julia\20200804_164104DTIPGSETE71Delta20delta62s006a1001.nii'; %Path to data
MaskNii = 'E:\home\Thomas\Sciebo\Projekte\Kidney_IDEAL\test_data_julia\Delta_Niere06_sl1_niererechts.nii'; %Path to mask
ROIsNiiCell = {'E:\home\Thomas\Sciebo\Projekte\Kidney_IDEAL\test_data_julia\Delta_Niere06_sl1_cortexrechts.nii'}; %Cell with paths to ROIs
% Data = '/mnt/SharedData/home/thomas/Sciebo/Projekte/Kidney_IDEAL/test_data_julia/20200804_164104DTIPGSETE71Delta20delta62s006a1001.nii'; %Path to data
% MaskNii = '/mnt/SharedData/home/thomas/Sciebo/Projekte/Kidney_IDEAL/test_data_julia/Delta_Niere06_sl1_niererechts.nii'; %Path to mask
% ROIsNiiCell = {'/mnt/SharedData/home/thomas/Sciebo/Projekte/Kidney_IDEAL/test_data_julia/Delta_Niere06_sl1_cortexrechts.nii'}; %Cell with paths to ROIs
[FitResults,FitQuality,P,ROIstat] = IDEALfitIVIM_exp(Data,P,MaskNii,ROIsNiiCell);