rapidtide 3.0.11__py3-none-any.whl → 3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rapidtide/Colortables.py +492 -27
- rapidtide/OrthoImageItem.py +1049 -46
- rapidtide/RapidtideDataset.py +1533 -86
- rapidtide/_version.py +3 -3
- rapidtide/calccoherence.py +196 -29
- rapidtide/calcnullsimfunc.py +191 -40
- rapidtide/calcsimfunc.py +245 -42
- rapidtide/correlate.py +1210 -393
- rapidtide/data/examples/src/testLD +56 -0
- rapidtide/data/examples/src/testalign +1 -1
- rapidtide/data/examples/src/testdelayvar +0 -1
- rapidtide/data/examples/src/testfmri +19 -1
- rapidtide/data/examples/src/testglmfilt +5 -5
- rapidtide/data/examples/src/testhappy +25 -3
- rapidtide/data/examples/src/testppgproc +17 -0
- rapidtide/data/examples/src/testrolloff +11 -0
- rapidtide/data/models/model_cnn_pytorch/best_model.pth +0 -0
- rapidtide/data/models/model_cnn_pytorch/loss.png +0 -0
- rapidtide/data/models/model_cnn_pytorch/loss.txt +1 -0
- rapidtide/data/models/model_cnn_pytorch/model.pth +0 -0
- rapidtide/data/models/model_cnn_pytorch/model_meta.json +68 -0
- rapidtide/decorators.py +91 -0
- rapidtide/dlfilter.py +2225 -108
- rapidtide/dlfiltertorch.py +4843 -0
- rapidtide/externaltools.py +327 -12
- rapidtide/fMRIData_class.py +79 -40
- rapidtide/filter.py +1899 -810
- rapidtide/fit.py +2004 -574
- rapidtide/genericmultiproc.py +93 -18
- rapidtide/happy_supportfuncs.py +2044 -171
- rapidtide/helper_classes.py +584 -43
- rapidtide/io.py +2363 -370
- rapidtide/linfitfiltpass.py +341 -75
- rapidtide/makelaggedtcs.py +211 -20
- rapidtide/maskutil.py +423 -53
- rapidtide/miscmath.py +827 -121
- rapidtide/multiproc.py +210 -22
- rapidtide/patchmatch.py +234 -33
- rapidtide/peakeval.py +32 -30
- rapidtide/ppgproc.py +2203 -0
- rapidtide/qualitycheck.py +352 -39
- rapidtide/refinedelay.py +422 -57
- rapidtide/refineregressor.py +498 -184
- rapidtide/resample.py +671 -185
- rapidtide/scripts/applyppgproc.py +28 -0
- rapidtide/simFuncClasses.py +1052 -77
- rapidtide/simfuncfit.py +260 -46
- rapidtide/stats.py +540 -238
- rapidtide/tests/happycomp +9 -0
- rapidtide/tests/test_dlfiltertorch.py +627 -0
- rapidtide/tests/test_findmaxlag.py +24 -8
- rapidtide/tests/test_fullrunhappy_v1.py +0 -2
- rapidtide/tests/test_fullrunhappy_v2.py +0 -2
- rapidtide/tests/test_fullrunhappy_v3.py +1 -0
- rapidtide/tests/test_fullrunhappy_v4.py +2 -2
- rapidtide/tests/test_fullrunrapidtide_v7.py +1 -1
- rapidtide/tests/test_simroundtrip.py +8 -8
- rapidtide/tests/utils.py +9 -8
- rapidtide/tidepoolTemplate.py +142 -38
- rapidtide/tidepoolTemplate_alt.py +165 -44
- rapidtide/tidepoolTemplate_big.py +189 -52
- rapidtide/util.py +1217 -118
- rapidtide/voxelData.py +684 -37
- rapidtide/wiener.py +19 -12
- rapidtide/wiener2.py +113 -7
- rapidtide/wiener_doc.py +255 -0
- rapidtide/workflows/adjustoffset.py +105 -3
- rapidtide/workflows/aligntcs.py +85 -2
- rapidtide/workflows/applydlfilter.py +87 -10
- rapidtide/workflows/applyppgproc.py +522 -0
- rapidtide/workflows/atlasaverage.py +210 -47
- rapidtide/workflows/atlastool.py +100 -3
- rapidtide/workflows/calcSimFuncMap.py +294 -64
- rapidtide/workflows/calctexticc.py +201 -9
- rapidtide/workflows/ccorrica.py +97 -4
- rapidtide/workflows/cleanregressor.py +168 -29
- rapidtide/workflows/delayvar.py +163 -10
- rapidtide/workflows/diffrois.py +81 -3
- rapidtide/workflows/endtidalproc.py +144 -4
- rapidtide/workflows/fdica.py +195 -15
- rapidtide/workflows/filtnifti.py +70 -3
- rapidtide/workflows/filttc.py +74 -3
- rapidtide/workflows/fitSimFuncMap.py +206 -48
- rapidtide/workflows/fixtr.py +73 -3
- rapidtide/workflows/gmscalc.py +113 -3
- rapidtide/workflows/happy.py +801 -199
- rapidtide/workflows/happy2std.py +144 -12
- rapidtide/workflows/happy_parser.py +138 -9
- rapidtide/workflows/histnifti.py +118 -2
- rapidtide/workflows/histtc.py +84 -3
- rapidtide/workflows/linfitfilt.py +117 -4
- rapidtide/workflows/localflow.py +328 -28
- rapidtide/workflows/mergequality.py +79 -3
- rapidtide/workflows/niftidecomp.py +322 -18
- rapidtide/workflows/niftistats.py +174 -4
- rapidtide/workflows/pairproc.py +88 -2
- rapidtide/workflows/pairwisemergenifti.py +85 -2
- rapidtide/workflows/parser_funcs.py +1421 -40
- rapidtide/workflows/physiofreq.py +137 -11
- rapidtide/workflows/pixelcomp.py +208 -5
- rapidtide/workflows/plethquality.py +103 -21
- rapidtide/workflows/polyfitim.py +151 -11
- rapidtide/workflows/proj2flow.py +75 -2
- rapidtide/workflows/rankimage.py +111 -4
- rapidtide/workflows/rapidtide.py +272 -15
- rapidtide/workflows/rapidtide2std.py +98 -2
- rapidtide/workflows/rapidtide_parser.py +109 -9
- rapidtide/workflows/refineDelayMap.py +143 -33
- rapidtide/workflows/refineRegressor.py +682 -93
- rapidtide/workflows/regressfrommaps.py +152 -31
- rapidtide/workflows/resamplenifti.py +85 -3
- rapidtide/workflows/resampletc.py +91 -3
- rapidtide/workflows/retrolagtcs.py +98 -6
- rapidtide/workflows/retroregress.py +165 -9
- rapidtide/workflows/roisummarize.py +173 -5
- rapidtide/workflows/runqualitycheck.py +71 -3
- rapidtide/workflows/showarbcorr.py +147 -4
- rapidtide/workflows/showhist.py +86 -2
- rapidtide/workflows/showstxcorr.py +160 -3
- rapidtide/workflows/showtc.py +159 -3
- rapidtide/workflows/showxcorrx.py +184 -4
- rapidtide/workflows/showxy.py +185 -15
- rapidtide/workflows/simdata.py +262 -36
- rapidtide/workflows/spatialfit.py +77 -2
- rapidtide/workflows/spatialmi.py +251 -27
- rapidtide/workflows/spectrogram.py +305 -32
- rapidtide/workflows/synthASL.py +154 -3
- rapidtide/workflows/tcfrom2col.py +76 -2
- rapidtide/workflows/tcfrom3col.py +74 -2
- rapidtide/workflows/tidepool.py +2969 -130
- rapidtide/workflows/utils.py +19 -14
- rapidtide/workflows/utils_doc.py +293 -0
- rapidtide/workflows/variabilityizer.py +116 -3
- {rapidtide-3.0.11.dist-info → rapidtide-3.1.dist-info}/METADATA +3 -2
- {rapidtide-3.0.11.dist-info → rapidtide-3.1.dist-info}/RECORD +139 -122
- {rapidtide-3.0.11.dist-info → rapidtide-3.1.dist-info}/entry_points.txt +1 -0
- {rapidtide-3.0.11.dist-info → rapidtide-3.1.dist-info}/WHEEL +0 -0
- {rapidtide-3.0.11.dist-info → rapidtide-3.1.dist-info}/licenses/LICENSE +0 -0
- {rapidtide-3.0.11.dist-info → rapidtide-3.1.dist-info}/top_level.txt +0 -0
rapidtide/simfuncfit.py
CHANGED
|
@@ -19,8 +19,10 @@
|
|
|
19
19
|
import bisect
|
|
20
20
|
import gc
|
|
21
21
|
import logging
|
|
22
|
+
from typing import Any, Callable, Optional, Tuple, Union
|
|
22
23
|
|
|
23
24
|
import numpy as np
|
|
25
|
+
from numpy.typing import ArrayLike, NDArray
|
|
24
26
|
from tqdm import tqdm
|
|
25
27
|
|
|
26
28
|
import rapidtide.fit as tide_fit
|
|
@@ -30,17 +32,77 @@ LGR = logging.getLogger("GENERAL")
|
|
|
30
32
|
|
|
31
33
|
|
|
32
34
|
def onesimfuncfit(
|
|
33
|
-
correlationfunc,
|
|
34
|
-
thefitter,
|
|
35
|
-
disablethresholds=False,
|
|
36
|
-
initiallag=None,
|
|
37
|
-
despeckle_thresh=5.0,
|
|
38
|
-
lthreshval=0.0,
|
|
39
|
-
fixdelay=False,
|
|
40
|
-
initialdelayvalue=0.0,
|
|
41
|
-
rt_floatset=np.float64,
|
|
42
|
-
rt_floattype="float64",
|
|
43
|
-
):
|
|
35
|
+
correlationfunc: ArrayLike,
|
|
36
|
+
thefitter: Any,
|
|
37
|
+
disablethresholds: bool = False,
|
|
38
|
+
initiallag: Optional[float] = None,
|
|
39
|
+
despeckle_thresh: float = 5.0,
|
|
40
|
+
lthreshval: float = 0.0,
|
|
41
|
+
fixdelay: bool = False,
|
|
42
|
+
initialdelayvalue: float = 0.0,
|
|
43
|
+
rt_floatset: type = np.float64,
|
|
44
|
+
rt_floattype: str = "float64",
|
|
45
|
+
) -> Tuple[int, float, float, float, int, int, int, int]:
|
|
46
|
+
"""
|
|
47
|
+
Perform a single fit on a correlation function using the provided fitter.
|
|
48
|
+
|
|
49
|
+
This function sets up the fitter with initial parameters and thresholds,
|
|
50
|
+
then performs a fit on the provided correlation function. If `fixdelay` is
|
|
51
|
+
True, the fit is skipped and a fixed delay value is used instead.
|
|
52
|
+
|
|
53
|
+
Parameters
|
|
54
|
+
----------
|
|
55
|
+
correlationfunc : ArrayLike
|
|
56
|
+
The correlation function data to be fitted.
|
|
57
|
+
thefitter : Any
|
|
58
|
+
An object with methods `setguess`, `setrange`, `setlthresh`, and `fit`.
|
|
59
|
+
disablethresholds : bool, optional
|
|
60
|
+
If True, disables the threshold setting in the fitter. Default is False.
|
|
61
|
+
initiallag : float, optional
|
|
62
|
+
Initial guess for the lag value. If None, no initial guess is set.
|
|
63
|
+
Default is None.
|
|
64
|
+
despeckle_thresh : float, optional
|
|
65
|
+
Threshold for despeckling. Default is 5.0.
|
|
66
|
+
lthreshval : float, optional
|
|
67
|
+
Low threshold value for the fitter. Default is 0.0.
|
|
68
|
+
fixdelay : bool, optional
|
|
69
|
+
If True, uses a fixed delay value instead of performing a fit.
|
|
70
|
+
Default is False.
|
|
71
|
+
initialdelayvalue : float, optional
|
|
72
|
+
The fixed delay value to use when `fixdelay=True`. Default is 0.0.
|
|
73
|
+
rt_floatset : type, optional
|
|
74
|
+
The data type to use for floating-point values. Default is `np.float64`.
|
|
75
|
+
rt_floattype : str, optional
|
|
76
|
+
String representation of the floating-point type. Default is "float64".
|
|
77
|
+
|
|
78
|
+
Returns
|
|
79
|
+
-------
|
|
80
|
+
tuple of (int, float, float, float, int, int, int, int)
|
|
81
|
+
A tuple containing:
|
|
82
|
+
- maxindex (int): Index of the maximum value in the correlation function.
|
|
83
|
+
- maxlag (float): The lag value at the maximum.
|
|
84
|
+
- maxval (float): The maximum value in the correlation function.
|
|
85
|
+
- maxsigma (float): The sigma (standard deviation) of the fit.
|
|
86
|
+
- maskval (int): A mask value indicating fit quality.
|
|
87
|
+
- peakstart (int): Start index of the fitted peak.
|
|
88
|
+
- peakend (int): End index of the fitted peak.
|
|
89
|
+
- failreason (int): Reason for fit failure (0 if successful).
|
|
90
|
+
|
|
91
|
+
Notes
|
|
92
|
+
-----
|
|
93
|
+
When `fixdelay=True`, the function bypasses the fitting process and returns
|
|
94
|
+
precomputed values based on `initialdelayvalue`.
|
|
95
|
+
|
|
96
|
+
Examples
|
|
97
|
+
--------
|
|
98
|
+
>>> import numpy as np
|
|
99
|
+
>>> from some_module import some_fitter_class
|
|
100
|
+
>>> corr_func = np.random.rand(100)
|
|
101
|
+
>>> fitter = some_fitter_class()
|
|
102
|
+
>>> result = onesimfuncfit(corr_func, fitter)
|
|
103
|
+
>>> print(result)
|
|
104
|
+
(50, 0.5, 0.95, 0.02, 1, 45, 55, 0)
|
|
105
|
+
"""
|
|
44
106
|
if initiallag is not None:
|
|
45
107
|
thefitter.setguess(True, maxguess=initiallag)
|
|
46
108
|
thefitter.setrange(-despeckle_thresh / 2.0, despeckle_thresh / 2.0)
|
|
@@ -78,17 +140,84 @@ def onesimfuncfit(
|
|
|
78
140
|
|
|
79
141
|
|
|
80
142
|
def _procOneVoxelFitcorr(
|
|
81
|
-
vox,
|
|
82
|
-
corr_y,
|
|
83
|
-
thefitter,
|
|
84
|
-
disablethresholds=False,
|
|
85
|
-
despeckle_thresh=5.0,
|
|
86
|
-
initiallag=None,
|
|
87
|
-
fixdelay=False,
|
|
88
|
-
initialdelayvalue=0.0,
|
|
89
|
-
rt_floatset=np.float64,
|
|
90
|
-
rt_floattype="float64",
|
|
91
|
-
):
|
|
143
|
+
vox: int,
|
|
144
|
+
corr_y: ArrayLike,
|
|
145
|
+
thefitter: Any,
|
|
146
|
+
disablethresholds: bool = False,
|
|
147
|
+
despeckle_thresh: float = 5.0,
|
|
148
|
+
initiallag: Optional[float] = None,
|
|
149
|
+
fixdelay: bool = False,
|
|
150
|
+
initialdelayvalue: float = 0.0,
|
|
151
|
+
rt_floatset: type = np.float64,
|
|
152
|
+
rt_floattype: str = "float64",
|
|
153
|
+
) -> Tuple[int, int, float, float, float, NDArray, NDArray, float, int, int]:
|
|
154
|
+
"""
|
|
155
|
+
Process a single voxel for correlation fitting.
|
|
156
|
+
|
|
157
|
+
This function performs correlation fitting on a single voxel's data using the provided fitter.
|
|
158
|
+
It returns fitting results including time, strength, sigma, Gaussian fit, window mask, R² value,
|
|
159
|
+
and metadata such as mask value and failure reason.
|
|
160
|
+
|
|
161
|
+
Parameters
|
|
162
|
+
----------
|
|
163
|
+
vox : int
|
|
164
|
+
Voxel index.
|
|
165
|
+
corr_y : ArrayLike
|
|
166
|
+
Correlation data for the voxel.
|
|
167
|
+
thefitter : Any
|
|
168
|
+
Fitter object containing fitting parameters and methods.
|
|
169
|
+
disablethresholds : bool, optional
|
|
170
|
+
If True, disables thresholding during fitting. Default is False.
|
|
171
|
+
despeckle_thresh : float, optional
|
|
172
|
+
Threshold for despeckling. Default is 5.0.
|
|
173
|
+
initiallag : float, optional
|
|
174
|
+
Initial lag value for fitting. Default is None.
|
|
175
|
+
fixdelay : bool, optional
|
|
176
|
+
If True, fixes the delay during fitting. Default is False.
|
|
177
|
+
initialdelayvalue : float, optional
|
|
178
|
+
Initial delay value if `fixdelay` is True. Default is 0.0.
|
|
179
|
+
rt_floatset : type, optional
|
|
180
|
+
Type to use for real-valued floating-point arrays. Default is `np.float64`.
|
|
181
|
+
rt_floattype : str, optional
|
|
182
|
+
String representation of the floating-point type. Default is "float64".
|
|
183
|
+
|
|
184
|
+
Returns
|
|
185
|
+
-------
|
|
186
|
+
tuple of (int, int, float, float, float, ndarray, ndarray, float, int, int)
|
|
187
|
+
A tuple containing:
|
|
188
|
+
- `vox`: Voxel index.
|
|
189
|
+
- `volumetotalinc`: 1 if fit was successful, 0 otherwise.
|
|
190
|
+
- `thetime`: Fitted time value.
|
|
191
|
+
- `thestrength`: Fitted strength value.
|
|
192
|
+
- `thesigma`: Fitted sigma value.
|
|
193
|
+
- `thegaussout`: Gaussian fit evaluated over the time axis.
|
|
194
|
+
- `thewindowout`: Binary window mask indicating the peak region.
|
|
195
|
+
- `theR2`: R-squared value of the fit.
|
|
196
|
+
- `maskval`: Mask value from the fitting process.
|
|
197
|
+
- `failreason`: Reason for failure, if any.
|
|
198
|
+
|
|
199
|
+
Notes
|
|
200
|
+
-----
|
|
201
|
+
- If `maxval > 0.3`, plotting is disabled.
|
|
202
|
+
- The function uses `onesimfuncfit` to perform the actual fitting.
|
|
203
|
+
- The `thefitter` object must have attributes like `zerooutbadfit`, `lagmod`, and `corrtimeaxis`.
|
|
204
|
+
|
|
205
|
+
Examples
|
|
206
|
+
--------
|
|
207
|
+
>>> result = _procOneVoxelFitcorr(
|
|
208
|
+
... vox=10,
|
|
209
|
+
... corr_y=corr_data,
|
|
210
|
+
... thefitter=fitter_obj,
|
|
211
|
+
... disablethresholds=False,
|
|
212
|
+
... despeckle_thresh=5.0,
|
|
213
|
+
... fixdelay=False,
|
|
214
|
+
... initialdelayvalue=0.0,
|
|
215
|
+
... rt_floatset=np.float64,
|
|
216
|
+
... rt_floattype="float64"
|
|
217
|
+
... )
|
|
218
|
+
>>> print(result)
|
|
219
|
+
(10, 1, 1.23, 0.95, 0.12, array([...]), array([...]), 0.90, 1, 0)
|
|
220
|
+
"""
|
|
92
221
|
(
|
|
93
222
|
maxindex,
|
|
94
223
|
maxlag,
|
|
@@ -154,30 +283,115 @@ def _procOneVoxelFitcorr(
|
|
|
154
283
|
|
|
155
284
|
|
|
156
285
|
def fitcorr(
|
|
157
|
-
corrtimescale,
|
|
158
|
-
thefitter,
|
|
159
|
-
corrout,
|
|
160
|
-
lagmask,
|
|
161
|
-
failimage,
|
|
162
|
-
lagtimes,
|
|
163
|
-
lagstrengths,
|
|
164
|
-
lagsigma,
|
|
165
|
-
gaussout,
|
|
166
|
-
windowout,
|
|
167
|
-
R2,
|
|
168
|
-
despeckling=False,
|
|
169
|
-
peakdict=None,
|
|
170
|
-
nprocs=1,
|
|
171
|
-
alwaysmultiproc=False,
|
|
172
|
-
fixdelay=False,
|
|
173
|
-
initialdelayvalue=0.0,
|
|
174
|
-
showprogressbar=True,
|
|
175
|
-
chunksize=1000,
|
|
176
|
-
despeckle_thresh=5.0,
|
|
177
|
-
initiallags=None,
|
|
178
|
-
rt_floatset=np.float64,
|
|
179
|
-
rt_floattype="float64",
|
|
180
|
-
):
|
|
286
|
+
corrtimescale: ArrayLike,
|
|
287
|
+
thefitter: Any,
|
|
288
|
+
corrout: NDArray,
|
|
289
|
+
lagmask: NDArray,
|
|
290
|
+
failimage: NDArray,
|
|
291
|
+
lagtimes: NDArray,
|
|
292
|
+
lagstrengths: NDArray,
|
|
293
|
+
lagsigma: NDArray,
|
|
294
|
+
gaussout: NDArray,
|
|
295
|
+
windowout: NDArray,
|
|
296
|
+
R2: NDArray,
|
|
297
|
+
despeckling: bool = False,
|
|
298
|
+
peakdict: Optional[dict] = None,
|
|
299
|
+
nprocs: int = 1,
|
|
300
|
+
alwaysmultiproc: bool = False,
|
|
301
|
+
fixdelay: bool = False,
|
|
302
|
+
initialdelayvalue: Union[float, NDArray] = 0.0,
|
|
303
|
+
showprogressbar: bool = True,
|
|
304
|
+
chunksize: int = 1000,
|
|
305
|
+
despeckle_thresh: float = 5.0,
|
|
306
|
+
initiallags: Optional[NDArray] = None,
|
|
307
|
+
rt_floatset: type = np.float64,
|
|
308
|
+
rt_floattype: str = "float64",
|
|
309
|
+
) -> int:
|
|
310
|
+
"""
|
|
311
|
+
Fit correlation data to extract lag parameters and related statistics for each voxel.
|
|
312
|
+
|
|
313
|
+
This function performs a fitting procedure on correlation data for each voxel,
|
|
314
|
+
extracting lag times, strengths, sigma values, Gaussian fits, window functions,
|
|
315
|
+
and R² values. It supports both single-threaded and multi-threaded processing.
|
|
316
|
+
|
|
317
|
+
Parameters
|
|
318
|
+
----------
|
|
319
|
+
corrtimescale : ArrayLike
|
|
320
|
+
Time scale of the correlation data.
|
|
321
|
+
thefitter : Any
|
|
322
|
+
Fitter object used to perform the fitting. Must have methods like `setcorrtimeaxis`.
|
|
323
|
+
corrout : NDArray
|
|
324
|
+
Correlation data for all voxels, shape (n_voxels, n_timepoints).
|
|
325
|
+
lagmask : NDArray
|
|
326
|
+
Mask indicating valid lags for each voxel, shape (n_voxels,).
|
|
327
|
+
failimage : NDArray
|
|
328
|
+
Image to store failure flags for each voxel, shape (n_voxels,).
|
|
329
|
+
lagtimes : NDArray
|
|
330
|
+
Output array for lag times, shape (n_voxels,).
|
|
331
|
+
lagstrengths : NDArray
|
|
332
|
+
Output array for lag strengths, shape (n_voxels,).
|
|
333
|
+
lagsigma : NDArray
|
|
334
|
+
Output array for lag sigma values, shape (n_voxels,).
|
|
335
|
+
gaussout : NDArray
|
|
336
|
+
Output array for Gaussian fit parameters, shape (n_voxels, n_timepoints).
|
|
337
|
+
windowout : NDArray
|
|
338
|
+
Output array for window function values, shape (n_voxels, n_timepoints).
|
|
339
|
+
R2 : NDArray
|
|
340
|
+
Output array for R² values, shape (n_voxels,).
|
|
341
|
+
despeckling : bool, optional
|
|
342
|
+
If True, performs despeckling pass, only accepting successful fits, by default False.
|
|
343
|
+
peakdict : dict, optional
|
|
344
|
+
Dictionary of peak information, by default None.
|
|
345
|
+
nprocs : int, optional
|
|
346
|
+
Number of processes to use for multiprocessing, by default 1.
|
|
347
|
+
alwaysmultiproc : bool, optional
|
|
348
|
+
If True, always use multiprocessing even for single process, by default False.
|
|
349
|
+
fixdelay : bool, optional
|
|
350
|
+
If True, fix the delay value, by default False.
|
|
351
|
+
initialdelayvalue : Union[float, NDArray], optional
|
|
352
|
+
Initial delay value(s), by default 0.0.
|
|
353
|
+
showprogressbar : bool, optional
|
|
354
|
+
If True, show progress bar, by default True.
|
|
355
|
+
chunksize : int, optional
|
|
356
|
+
Size of chunks for multiprocessing, by default 1000.
|
|
357
|
+
despeckle_thresh : float, optional
|
|
358
|
+
Threshold for despeckling, by default 5.0.
|
|
359
|
+
initiallags : NDArray, optional
|
|
360
|
+
Initial lag values for each voxel, by default None.
|
|
361
|
+
rt_floatset : type, optional
|
|
362
|
+
Floating-point type for runtime, by default np.float64.
|
|
363
|
+
rt_floattype : str, optional
|
|
364
|
+
String representation of floating-point type, by default "float64".
|
|
365
|
+
|
|
366
|
+
Returns
|
|
367
|
+
-------
|
|
368
|
+
int
|
|
369
|
+
Total number of voxels successfully processed.
|
|
370
|
+
|
|
371
|
+
Notes
|
|
372
|
+
-----
|
|
373
|
+
The function modifies the input arrays (`lagtimes`, `lagstrengths`, `lagsigma`,
|
|
374
|
+
`gaussout`, `windowout`, `R2`, `lagmask`, `failimage`) in-place.
|
|
375
|
+
|
|
376
|
+
Examples
|
|
377
|
+
--------
|
|
378
|
+
>>> fitcorr(
|
|
379
|
+
... corrtimescale=timescale,
|
|
380
|
+
... thefitter=fitter,
|
|
381
|
+
... corrout=correlation_data,
|
|
382
|
+
... lagmask=lag_mask,
|
|
383
|
+
... failimage=fail_image,
|
|
384
|
+
... lagtimes=lag_times,
|
|
385
|
+
... lagstrengths=lag_strengths,
|
|
386
|
+
... lagsigma=lag_sigma,
|
|
387
|
+
... gaussout=gaussian_out,
|
|
388
|
+
... windowout=window_out,
|
|
389
|
+
... R2=r2_values,
|
|
390
|
+
... nprocs=4,
|
|
391
|
+
... despeckling=True,
|
|
392
|
+
... )
|
|
393
|
+
12345
|
|
394
|
+
"""
|
|
181
395
|
thefitter.setcorrtimeaxis(corrtimescale)
|
|
182
396
|
inputshape = np.shape(corrout)
|
|
183
397
|
if initiallags is None:
|