1 |
|
|
/* |
2 |
|
|
Teem: Tools to process and visualize scientific data and images . |
3 |
|
|
Copyright (C) 2013, 2012, 2011, 2010, 2009 University of Chicago |
4 |
|
|
Copyright (C) 2008, 2007, 2006, 2005 Gordon Kindlmann |
5 |
|
|
Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah |
6 |
|
|
|
7 |
|
|
This library is free software; you can redistribute it and/or |
8 |
|
|
modify it under the terms of the GNU Lesser General Public License |
9 |
|
|
(LGPL) as published by the Free Software Foundation; either |
10 |
|
|
version 2.1 of the License, or (at your option) any later version. |
11 |
|
|
The terms of redistributing and/or modifying this software also |
12 |
|
|
include exceptions to the LGPL that facilitate static linking. |
13 |
|
|
|
14 |
|
|
This library is distributed in the hope that it will be useful, |
15 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 |
|
|
Lesser General Public License for more details. |
18 |
|
|
|
19 |
|
|
You should have received a copy of the GNU Lesser General Public License |
20 |
|
|
along with this library; if not, write to Free Software Foundation, Inc., |
21 |
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
22 |
|
|
*/ |
23 |
|
|
|
24 |
|
|
#include "ten.h" |
25 |
|
|
#include "privateTen.h" |
26 |
|
|
|
27 |
|
|
#define PARM_NUM 1 |
28 |
|
|
static const tenModelParmDesc |
29 |
|
|
parmDesc[] = { |
30 |
|
|
/* 0 */ {"B0", 0.0, TEN_MODEL_B0_MAX, AIR_FALSE, AIR_FALSE, 0}, |
31 |
|
|
}; |
32 |
|
|
|
33 |
|
|
static void |
34 |
|
|
simulate(double *dwiSim, const double *parm, const tenExperSpec *espec) { |
35 |
|
|
unsigned int ii; |
36 |
|
|
double b0; |
37 |
|
|
|
38 |
|
|
b0 = parm[0]; |
39 |
|
|
for (ii=0; ii<espec->imgNum; ii++) { |
40 |
|
|
dwiSim[ii] = b0; |
41 |
|
|
} |
42 |
|
|
return; |
43 |
|
|
} |
44 |
|
|
|
45 |
|
|
static char * |
46 |
|
|
parmSprint(char str[AIR_STRLEN_MED], const double *parm) { |
47 |
|
|
sprintf(str, "(%g)", parm[0]); |
48 |
|
|
return str; |
49 |
|
|
} |
50 |
|
|
|
51 |
|
|
_TEN_PARM_ALLOC |
52 |
|
|
_TEN_PARM_RAND |
53 |
|
|
_TEN_PARM_STEP |
54 |
|
|
_TEN_PARM_DIST |
55 |
|
|
_TEN_PARM_COPY |
56 |
|
|
_TEN_PARM_CONVERT_NOOP |
57 |
|
|
|
58 |
|
|
_TEN_SQE |
59 |
|
|
_TEN_SQE_GRAD_CENTDIFF |
60 |
|
|
_TEN_SQE_FIT(tenModelB0) |
61 |
|
|
|
62 |
|
|
_TEN_NLL |
63 |
|
|
_TEN_NLL_GRAD_STUB |
64 |
|
|
_TEN_NLL_FIT_STUB |
65 |
|
|
|
66 |
|
|
tenModel |
67 |
|
|
_tenModelB0 = { |
68 |
|
|
TEN_MODEL_STR_B0, |
69 |
|
|
_TEN_MODEL_FIELDS |
70 |
|
|
}; |
71 |
|
|
const tenModel *const tenModelB0 = &_tenModelB0; |