rapidtide 3.0.11__py3-none-any.whl → 3.1.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 +188 -40
- rapidtide/calcsimfunc.py +242 -42
- rapidtide/correlate.py +1203 -383
- 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 +53 -3
- rapidtide/data/examples/src/testglmfilt +5 -5
- rapidtide/data/examples/src/testhappy +29 -7
- 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 +2226 -110
- rapidtide/dlfiltertorch.py +4842 -0
- rapidtide/externaltools.py +327 -12
- rapidtide/fMRIData_class.py +79 -40
- rapidtide/filter.py +1899 -810
- rapidtide/fit.py +2011 -581
- rapidtide/genericmultiproc.py +93 -18
- rapidtide/happy_supportfuncs.py +2047 -172
- rapidtide/helper_classes.py +584 -43
- rapidtide/io.py +2370 -372
- rapidtide/linfitfiltpass.py +346 -99
- rapidtide/makelaggedtcs.py +210 -24
- rapidtide/maskutil.py +448 -62
- rapidtide/miscmath.py +827 -121
- rapidtide/multiproc.py +210 -22
- rapidtide/patchmatch.py +242 -42
- rapidtide/peakeval.py +31 -31
- rapidtide/ppgproc.py +2203 -0
- rapidtide/qualitycheck.py +352 -39
- rapidtide/refinedelay.py +431 -57
- rapidtide/refineregressor.py +494 -189
- rapidtide/resample.py +671 -185
- rapidtide/scripts/applyppgproc.py +28 -0
- rapidtide/scripts/showxcorr_legacy.py +7 -7
- rapidtide/scripts/stupidramtricks.py +15 -17
- rapidtide/simFuncClasses.py +1052 -77
- rapidtide/simfuncfit.py +269 -69
- rapidtide/stats.py +540 -238
- rapidtide/tests/happycomp +9 -0
- rapidtide/tests/test_cleanregressor.py +1 -2
- 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 +11 -4
- rapidtide/tests/test_fullrunhappy_v4.py +10 -2
- rapidtide/tests/test_fullrunrapidtide_v7.py +1 -1
- rapidtide/tests/test_getparsers.py +11 -3
- rapidtide/tests/test_refinedelay.py +0 -1
- rapidtide/tests/test_simroundtrip.py +16 -8
- rapidtide/tests/test_stcorrelate.py +3 -1
- 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 +136 -23
- rapidtide/wiener2.py +113 -7
- rapidtide/workflows/adjustoffset.py +105 -3
- rapidtide/workflows/aligntcs.py +85 -2
- rapidtide/workflows/applydlfilter.py +87 -10
- rapidtide/workflows/applyppgproc.py +540 -0
- rapidtide/workflows/atlasaverage.py +210 -47
- rapidtide/workflows/atlastool.py +100 -3
- rapidtide/workflows/calcSimFuncMap.py +288 -69
- rapidtide/workflows/calctexticc.py +201 -9
- rapidtide/workflows/ccorrica.py +101 -6
- rapidtide/workflows/cleanregressor.py +165 -31
- rapidtide/workflows/delayvar.py +171 -23
- 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 +202 -51
- 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 +163 -23
- 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 +98 -4
- rapidtide/workflows/pairwisemergenifti.py +85 -2
- rapidtide/workflows/parser_funcs.py +1421 -40
- rapidtide/workflows/physiofreq.py +137 -11
- rapidtide/workflows/pixelcomp.py +207 -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 +368 -76
- rapidtide/workflows/rapidtide2std.py +98 -2
- rapidtide/workflows/rapidtide_parser.py +109 -9
- rapidtide/workflows/refineDelayMap.py +144 -33
- rapidtide/workflows/refineRegressor.py +675 -96
- rapidtide/workflows/regressfrommaps.py +161 -37
- rapidtide/workflows/resamplenifti.py +85 -3
- rapidtide/workflows/resampletc.py +91 -3
- rapidtide/workflows/retrolagtcs.py +99 -9
- rapidtide/workflows/retroregress.py +176 -26
- rapidtide/workflows/roisummarize.py +174 -5
- rapidtide/workflows/runqualitycheck.py +71 -3
- rapidtide/workflows/showarbcorr.py +149 -6
- rapidtide/workflows/showhist.py +86 -2
- rapidtide/workflows/showstxcorr.py +160 -3
- rapidtide/workflows/showtc.py +159 -3
- rapidtide/workflows/showxcorrx.py +190 -10
- rapidtide/workflows/showxy.py +185 -15
- rapidtide/workflows/simdata.py +264 -38
- rapidtide/workflows/spatialfit.py +77 -2
- rapidtide/workflows/spatialmi.py +250 -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 +2971 -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.1.dist-info}/METADATA +10 -8
- {rapidtide-3.0.11.dist-info → rapidtide-3.1.1.dist-info}/RECORD +144 -128
- {rapidtide-3.0.11.dist-info → rapidtide-3.1.1.dist-info}/entry_points.txt +1 -0
- {rapidtide-3.0.11.dist-info → rapidtide-3.1.1.dist-info}/WHEEL +0 -0
- {rapidtide-3.0.11.dist-info → rapidtide-3.1.1.dist-info}/licenses/LICENSE +0 -0
- {rapidtide-3.0.11.dist-info → rapidtide-3.1.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
#
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
|
+
#
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
# you may not use this file except in compliance with the License.
|
|
8
|
+
# You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
#
|
|
18
|
+
#
|
|
19
|
+
import rapidtide.workflows.applyppgproc as theworkflow
|
|
20
|
+
import rapidtide.workflows.parser_funcs as pf
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def entrypoint():
|
|
24
|
+
pf.generic_init(theworkflow._get_parser, theworkflow.procppg)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
if __name__ == "__main__":
|
|
28
|
+
entrypoint()
|
|
@@ -79,7 +79,7 @@ def getNullDistributionData(
|
|
|
79
79
|
corrlist[i] = theshuffledxcorr_trim[argmax(theshuffledxcorr_trim)]
|
|
80
80
|
|
|
81
81
|
# find and tabulate correlation coefficient at 0 lag
|
|
82
|
-
corrlist_pear[i] = pearsonr(filteredindata, filteredshuffleddata)
|
|
82
|
+
corrlist_pear[i] = pearsonr(filteredindata, filteredshuffleddata).statistic
|
|
83
83
|
|
|
84
84
|
# progress
|
|
85
85
|
# tide_util.progressbar(i + 1, numreps, label='Percent complete')
|
|
@@ -455,7 +455,7 @@ def main():
|
|
|
455
455
|
|
|
456
456
|
# report the pearson correlation
|
|
457
457
|
if showpearson and verbose:
|
|
458
|
-
print("Pearson_R:\t", thepxcorr
|
|
458
|
+
print("Pearson_R:\t", thepxcorr.statistic)
|
|
459
459
|
if estimate_significance:
|
|
460
460
|
for idx, percentile in enumerate(thepercentiles):
|
|
461
461
|
print(
|
|
@@ -467,7 +467,7 @@ def main():
|
|
|
467
467
|
print("")
|
|
468
468
|
|
|
469
469
|
if debug:
|
|
470
|
-
print(thepxcorr)
|
|
470
|
+
print(thepxcorr.statistic, thepxcorr.pvalue)
|
|
471
471
|
|
|
472
472
|
if verbose:
|
|
473
473
|
if uselabel:
|
|
@@ -497,7 +497,7 @@ def main():
|
|
|
497
497
|
"xcorr_R(P=0.05)",
|
|
498
498
|
"xcorr_maxdelay",
|
|
499
499
|
)
|
|
500
|
-
print(thelabel, thepxcorr
|
|
500
|
+
print(thelabel, thepxcorr.statistic, pearpcts_fit[0], R, pcts_fit[0], -maxdelay)
|
|
501
501
|
else:
|
|
502
502
|
if labelline:
|
|
503
503
|
print(
|
|
@@ -507,7 +507,7 @@ def main():
|
|
|
507
507
|
"xcorr_R(P=0.05)",
|
|
508
508
|
"xcorr_maxdelay",
|
|
509
509
|
)
|
|
510
|
-
print(thepxcorr
|
|
510
|
+
print(thepxcorr.statistic, pearpcts_fit[0], R, pcts_fit[0], -maxdelay)
|
|
511
511
|
else:
|
|
512
512
|
if uselabel:
|
|
513
513
|
if labelline:
|
|
@@ -518,11 +518,11 @@ def main():
|
|
|
518
518
|
"xcorr_R",
|
|
519
519
|
"xcorr_maxdelay",
|
|
520
520
|
)
|
|
521
|
-
print(thelabel, thepxcorr
|
|
521
|
+
print(thelabel, thepxcorr.statistic, thepxcorr.pvalue, R, -maxdelay)
|
|
522
522
|
else:
|
|
523
523
|
if labelline:
|
|
524
524
|
print("pearson_r\tpearson_p\txcorr_R\txcorr_t\txcorr_maxdelay")
|
|
525
|
-
print(thepxcorr
|
|
525
|
+
print(thepxcorr.statistic, "\t", thepxcorr.pvalue, "\t", R, "\t", -maxdelay)
|
|
526
526
|
|
|
527
527
|
if displayplots:
|
|
528
528
|
fig = figure()
|
|
@@ -102,19 +102,15 @@ def stupidramtricks(args):
|
|
|
102
102
|
args.nprocs = tide_multiproc.maxcpus()
|
|
103
103
|
|
|
104
104
|
if args.internalprecision == "double":
|
|
105
|
-
rt_floattype =
|
|
106
|
-
rt_floatset = np.float64
|
|
105
|
+
rt_floattype = np.float64
|
|
107
106
|
else:
|
|
108
|
-
rt_floattype =
|
|
109
|
-
rt_floatset = np.float32
|
|
107
|
+
rt_floattype = np.float32
|
|
110
108
|
|
|
111
109
|
# set the output precision
|
|
112
110
|
if args.outputprecision == "double":
|
|
113
|
-
rt_outfloattype =
|
|
114
|
-
rt_outfloatset = np.float64
|
|
111
|
+
rt_outfloattype = np.float64
|
|
115
112
|
else:
|
|
116
|
-
rt_outfloattype =
|
|
117
|
-
rt_outfloatset = np.float32
|
|
113
|
+
rt_outfloattype = np.float32
|
|
118
114
|
|
|
119
115
|
# select the voxels in the mask
|
|
120
116
|
print("setting sizes")
|
|
@@ -139,23 +135,25 @@ def stupidramtricks(args):
|
|
|
139
135
|
print("allocating shared memory")
|
|
140
136
|
# first move fmridata into shared memory
|
|
141
137
|
fmridata, fmridata_shm = tide_util.numpy2shared(
|
|
142
|
-
fmridata,
|
|
138
|
+
fmridata, rt_floattype, name=f"fmridata_{args.pid}"
|
|
143
139
|
)
|
|
144
140
|
sLFOfitmean, sLFOfitmean_shm = tide_util.allocshared(
|
|
145
|
-
internalvalidspaceshape,
|
|
141
|
+
internalvalidspaceshape, rt_outfloattype
|
|
142
|
+
)
|
|
143
|
+
rvalue, rvalue_shm = tide_util.allocshared(internalvalidspaceshape, rt_outfloattype)
|
|
144
|
+
r2value, r2value_shm = tide_util.allocshared(internalvalidspaceshape, rt_outfloattype)
|
|
145
|
+
fitNorm, fitNorm_shm = tide_util.allocshared(
|
|
146
|
+
internalvalidspaceshapederivs, rt_outfloattype
|
|
146
147
|
)
|
|
147
|
-
rvalue, rvalue_shm = tide_util.allocshared(internalvalidspaceshape, rt_outfloatset)
|
|
148
|
-
r2value, r2value_shm = tide_util.allocshared(internalvalidspaceshape, rt_outfloatset)
|
|
149
|
-
fitNorm, fitNorm_shm = tide_util.allocshared(internalvalidspaceshapederivs, rt_outfloatset)
|
|
150
148
|
fitcoeff, fitcoeff_shm = tide_util.allocshared(
|
|
151
|
-
internalvalidspaceshapederivs,
|
|
149
|
+
internalvalidspaceshapederivs, rt_outfloattype
|
|
152
150
|
)
|
|
153
151
|
movingsignal, movingsignal_shm = tide_util.allocshared(
|
|
154
|
-
internalvalidfmrishape,
|
|
152
|
+
internalvalidfmrishape, rt_outfloattype
|
|
155
153
|
)
|
|
156
|
-
lagtc, lagtc_shm = tide_util.allocshared(internalvalidfmrishape,
|
|
154
|
+
lagtc, lagtc_shm = tide_util.allocshared(internalvalidfmrishape, rt_floattype)
|
|
157
155
|
filtereddata, filtereddata_shm = tide_util.allocshared(
|
|
158
|
-
internalvalidfmrishape,
|
|
156
|
+
internalvalidfmrishape, rt_outfloattype
|
|
159
157
|
)
|
|
160
158
|
|
|
161
159
|
location = "in shared memory"
|