rapidtide 3.0.7.1__py3-none-any.whl → 3.0.9__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/RapidtideDataset.py +1 -1
- rapidtide/_version.py +3 -3
- rapidtide/calcnullsimfunc.py +1 -3
- rapidtide/data/examples/src/test_findmaxlag.py +1 -1
- rapidtide/data/examples/src/testfmri +19 -7
- rapidtide/data/examples/src/testnewrefine +0 -23
- rapidtide/fMRIData_class.py +29 -52
- rapidtide/fit.py +4 -4
- rapidtide/happy_supportfuncs.py +1 -1
- rapidtide/helper_classes.py +0 -1099
- rapidtide/linfitfiltpass.py +82 -4
- rapidtide/makelaggedtcs.py +10 -0
- rapidtide/refinedelay.py +11 -20
- rapidtide/refineregressor.py +1 -1
- rapidtide/resample.py +8 -8
- rapidtide/simFuncClasses.py +1132 -0
- rapidtide/simfuncfit.py +30 -30
- rapidtide/stats.py +5 -2
- rapidtide/tests/.coveragerc +6 -0
- rapidtide/tests/cleanposttest +1 -1
- rapidtide/tests/runlocaltest +2 -2
- rapidtide/tests/test_cleanregressor.py +3 -3
- rapidtide/tests/test_congrid.py +1 -1
- rapidtide/tests/test_corrpass.py +3 -3
- rapidtide/tests/test_delayestimation.py +9 -8
- rapidtide/tests/test_findmaxlag.py +2 -2
- rapidtide/tests/test_fullrunrapidtide_v3.py +2 -1
- rapidtide/tests/test_fullrunrapidtide_v8.py +66 -0
- rapidtide/tests/test_getparsers.py +14 -6
- rapidtide/tests/test_io.py +2 -6
- rapidtide/tests/test_nullcorr.py +3 -3
- rapidtide/tests/test_refinedelay.py +20 -5
- rapidtide/tidepoolTemplate_alt.py +1 -1
- rapidtide/util.py +7 -0
- rapidtide/voxelData.py +3 -6
- rapidtide/workflows/calcSimFuncMap.py +271 -0
- rapidtide/workflows/cleanregressor.py +2 -2
- rapidtide/workflows/delayvar.py +45 -59
- rapidtide/workflows/fitSimFuncMap.py +427 -0
- rapidtide/workflows/happy.py +1 -1
- rapidtide/workflows/rapidtide.py +499 -877
- rapidtide/workflows/rapidtide_parser.py +26 -38
- rapidtide/workflows/refineDelayMap.py +138 -0
- rapidtide/{RegressorRefiner.py → workflows/refineRegressor.py} +200 -28
- rapidtide/workflows/regressfrommaps.py +38 -30
- rapidtide/workflows/retrolagtcs.py +5 -6
- rapidtide/workflows/retroregress.py +73 -191
- rapidtide/workflows/showarbcorr.py +2 -2
- rapidtide/workflows/showxcorrx.py +5 -5
- rapidtide/workflows/tidepool.py +5 -5
- {rapidtide-3.0.7.1.dist-info → rapidtide-3.0.9.dist-info}/METADATA +2 -2
- {rapidtide-3.0.7.1.dist-info → rapidtide-3.0.9.dist-info}/RECORD +56 -52
- rapidtide/workflows/delayestimation.py +0 -483
- {rapidtide-3.0.7.1.dist-info → rapidtide-3.0.9.dist-info}/WHEEL +0 -0
- {rapidtide-3.0.7.1.dist-info → rapidtide-3.0.9.dist-info}/entry_points.txt +0 -0
- {rapidtide-3.0.7.1.dist-info → rapidtide-3.0.9.dist-info}/licenses/LICENSE +0 -0
- {rapidtide-3.0.7.1.dist-info → rapidtide-3.0.9.dist-info}/top_level.txt +0 -0
|
@@ -32,12 +32,12 @@ import rapidtide.io as tide_io
|
|
|
32
32
|
import rapidtide.maskutil as tide_mask
|
|
33
33
|
import rapidtide.miscmath as tide_math
|
|
34
34
|
import rapidtide.multiproc as tide_multiproc
|
|
35
|
-
import rapidtide.refinedelay as tide_refinedelay
|
|
36
35
|
import rapidtide.resample as tide_resample
|
|
37
36
|
import rapidtide.stats as tide_stats
|
|
38
37
|
import rapidtide.util as tide_util
|
|
39
38
|
import rapidtide.voxelData as tide_voxelData
|
|
40
39
|
import rapidtide.workflows.parser_funcs as pf
|
|
40
|
+
import rapidtide.workflows.refineDelayMap as tide_refineDelayMap
|
|
41
41
|
import rapidtide.workflows.regressfrommaps as tide_regressfrommaps
|
|
42
42
|
|
|
43
43
|
from .rapidtide_parser import DEFAULT_REGRESSIONFILTDERIVS
|
|
@@ -61,7 +61,6 @@ DEFAULT_REFINEDELAYMINDELAY = -5.0
|
|
|
61
61
|
DEFAULT_REFINEDELAYMAXDELAY = 5.0
|
|
62
62
|
DEFAULT_REFINEDELAYNUMPOINTS = 501
|
|
63
63
|
DEFAULT_DELAYOFFSETSPATIALFILT = -1
|
|
64
|
-
DEFAULT_REFINEREGRESSDERIVS = 1
|
|
65
64
|
|
|
66
65
|
|
|
67
66
|
def _get_parser():
|
|
@@ -229,18 +228,6 @@ def _get_parser():
|
|
|
229
228
|
experimental = parser.add_argument_group(
|
|
230
229
|
"Experimental options (not fully tested, or not tested at all, may not work). Beware!"
|
|
231
230
|
)
|
|
232
|
-
experimental.add_argument(
|
|
233
|
-
"--refineregressderivs",
|
|
234
|
-
dest="refineregressderivs",
|
|
235
|
-
action="store",
|
|
236
|
-
type=lambda x: pf.is_int(parser, x, minval=1),
|
|
237
|
-
metavar="NDERIVS",
|
|
238
|
-
help=(
|
|
239
|
-
f"When doing GLM for delay refinement, include derivatives up to NDERIVS order. Must be 1 or more. "
|
|
240
|
-
f"Default is {DEFAULT_REFINEREGRESSDERIVS}"
|
|
241
|
-
),
|
|
242
|
-
default=DEFAULT_REFINEREGRESSDERIVS,
|
|
243
|
-
)
|
|
244
231
|
|
|
245
232
|
return parser
|
|
246
233
|
|
|
@@ -504,7 +491,7 @@ def retroregress(args):
|
|
|
504
491
|
print(f"{numvalidspatiallocs=}")
|
|
505
492
|
internalvalidspaceshape = numvalidspatiallocs
|
|
506
493
|
if args.refinedelay:
|
|
507
|
-
derivaxissize = np.max([
|
|
494
|
+
derivaxissize = np.max([2, args.regressderivs + 1])
|
|
508
495
|
else:
|
|
509
496
|
derivaxissize = args.regressderivs + 1
|
|
510
497
|
internalvalidspaceshapederivs = (
|
|
@@ -529,37 +516,29 @@ def retroregress(args):
|
|
|
529
516
|
if args.debug:
|
|
530
517
|
print(f"{fmri_data_valid.shape=}")
|
|
531
518
|
|
|
519
|
+
sLFOfitmean, sLFOfitmean_shm = tide_util.allocarray(
|
|
520
|
+
internalvalidspaceshape, rt_outfloattype, shared=usesharedmem
|
|
521
|
+
)
|
|
522
|
+
rvalue, rvalue_shm = tide_util.allocarray(internalvalidspaceshape, rt_outfloattype, shared=usesharedmem)
|
|
523
|
+
r2value, r2value_shm = tide_util.allocarray(internalvalidspaceshape, rt_outfloattype, shared=usesharedmem)
|
|
524
|
+
fitNorm, fitNorm_shm = tide_util.allocarray(internalvalidspaceshapederivs, rt_outfloattype, shared=usesharedmem)
|
|
525
|
+
fitcoeff, fitcoeff_shm = tide_util.allocarray(
|
|
526
|
+
internalvalidspaceshapederivs, rt_outfloattype, shared=usesharedmem
|
|
527
|
+
)
|
|
528
|
+
movingsignal, movingsignal_shm = tide_util.allocarray(
|
|
529
|
+
internalvalidfmrishape, rt_outfloattype, shared=usesharedmem
|
|
530
|
+
)
|
|
531
|
+
lagtc, lagtc_shm = tide_util.allocarray(internalvalidfmrishape, rt_floattype, shared=usesharedmem)
|
|
532
|
+
filtereddata, filtereddata_shm = tide_util.allocarray(
|
|
533
|
+
internalvalidfmrishape, rt_outfloattype, shared=usesharedmem
|
|
534
|
+
)
|
|
532
535
|
if usesharedmem:
|
|
533
536
|
if args.debug:
|
|
534
537
|
print("allocating shared memory")
|
|
535
|
-
sLFOfitmean, sLFOfitmean_shm = tide_util.allocshared(
|
|
536
|
-
internalvalidspaceshape, rt_outfloatset
|
|
537
|
-
)
|
|
538
|
-
rvalue, rvalue_shm = tide_util.allocshared(internalvalidspaceshape, rt_outfloatset)
|
|
539
|
-
r2value, r2value_shm = tide_util.allocshared(internalvalidspaceshape, rt_outfloatset)
|
|
540
|
-
fitNorm, fitNorm_shm = tide_util.allocshared(internalvalidspaceshapederivs, rt_outfloatset)
|
|
541
|
-
fitcoeff, fitcoeff_shm = tide_util.allocshared(
|
|
542
|
-
internalvalidspaceshapederivs, rt_outfloatset
|
|
543
|
-
)
|
|
544
|
-
movingsignal, movingsignal_shm = tide_util.allocshared(
|
|
545
|
-
internalvalidfmrishape, rt_outfloatset
|
|
546
|
-
)
|
|
547
|
-
lagtc, lagtc_shm = tide_util.allocshared(internalvalidfmrishape, rt_floatset)
|
|
548
|
-
filtereddata, filtereddata_shm = tide_util.allocshared(
|
|
549
|
-
internalvalidfmrishape, rt_outfloatset
|
|
550
|
-
)
|
|
551
538
|
ramlocation = "in shared memory"
|
|
552
539
|
else:
|
|
553
540
|
if args.debug:
|
|
554
541
|
print("allocating memory")
|
|
555
|
-
sLFOfitmean = np.zeros(internalvalidspaceshape, dtype=rt_outfloattype)
|
|
556
|
-
rvalue = np.zeros(internalvalidspaceshape, dtype=rt_outfloattype)
|
|
557
|
-
r2value = np.zeros(internalvalidspaceshape, dtype=rt_outfloattype)
|
|
558
|
-
fitNorm = np.zeros(internalvalidspaceshapederivs, dtype=rt_outfloattype)
|
|
559
|
-
fitcoeff = np.zeros(internalvalidspaceshapederivs, dtype=rt_outfloattype)
|
|
560
|
-
movingsignal = np.zeros(internalvalidfmrishape, dtype=rt_outfloattype)
|
|
561
|
-
lagtc = np.zeros(internalvalidfmrishape, dtype=rt_floattype)
|
|
562
|
-
filtereddata = np.zeros(internalvalidfmrishape, dtype=rt_outfloattype)
|
|
563
542
|
ramlocation = "locally"
|
|
564
543
|
|
|
565
544
|
totalbytes = (
|
|
@@ -643,118 +622,49 @@ def retroregress(args):
|
|
|
643
622
|
# set gausssigma automatically
|
|
644
623
|
args.delayoffsetgausssigma = np.mean([xdim, ydim, slicethickness]) / 2.0
|
|
645
624
|
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
mode,
|
|
655
|
-
outputname,
|
|
656
|
-
oversamptr,
|
|
657
|
-
sLFOfitmean,
|
|
658
|
-
rvalue,
|
|
659
|
-
r2value,
|
|
660
|
-
fitNorm[:, : (args.refineregressderivs + 1)],
|
|
661
|
-
fitcoeff[:, : (args.refineregressderivs + 1)],
|
|
662
|
-
movingsignal,
|
|
663
|
-
lagtc,
|
|
664
|
-
filtereddata,
|
|
665
|
-
LGR,
|
|
666
|
-
TimingLGR,
|
|
667
|
-
therunoptions,
|
|
668
|
-
regressderivs=args.refineregressderivs,
|
|
669
|
-
debug=args.debug,
|
|
670
|
-
)
|
|
671
|
-
|
|
672
|
-
if args.refineregressderivs == 1:
|
|
673
|
-
medfiltregressderivratios, filteredregressderivratios, delayoffsetMAD = (
|
|
674
|
-
tide_refinedelay.filterderivratios(
|
|
675
|
-
regressderivratios,
|
|
676
|
-
(xsize, ysize, numslices),
|
|
677
|
-
validvoxels,
|
|
678
|
-
(xdim, ydim, slicethickness),
|
|
679
|
-
gausssigma=args.delayoffsetgausssigma,
|
|
680
|
-
patchthresh=args.delaypatchthresh,
|
|
681
|
-
rt_floattype=rt_floattype,
|
|
682
|
-
debug=args.debug,
|
|
683
|
-
)
|
|
684
|
-
)
|
|
685
|
-
|
|
686
|
-
# find the mapping of glm ratios to delays
|
|
687
|
-
tide_refinedelay.trainratiotooffset(
|
|
688
|
-
genlagtc,
|
|
625
|
+
(
|
|
626
|
+
delayoffset,
|
|
627
|
+
regressderivratios,
|
|
628
|
+
medfiltregressderivratios,
|
|
629
|
+
filteredregressderivratios,
|
|
630
|
+
delayoffsetMAD,
|
|
631
|
+
) = tide_refineDelayMap.refineDelay(
|
|
632
|
+
fmri_data_valid,
|
|
689
633
|
initial_fmri_x,
|
|
634
|
+
xdim,
|
|
635
|
+
ydim,
|
|
636
|
+
slicethickness,
|
|
637
|
+
sLFOfiltmask_valid,
|
|
638
|
+
genlagtc,
|
|
639
|
+
oversamptr,
|
|
640
|
+
sLFOfitmean,
|
|
641
|
+
rvalue,
|
|
642
|
+
r2value,
|
|
643
|
+
fitNorm,
|
|
644
|
+
fitcoeff,
|
|
645
|
+
lagtc,
|
|
690
646
|
outputname,
|
|
691
|
-
|
|
647
|
+
validvoxels,
|
|
648
|
+
theinputdata.nativespaceshape,
|
|
649
|
+
theinputdata,
|
|
650
|
+
lagtimes_valid,
|
|
651
|
+
therunoptions,
|
|
652
|
+
LGR,
|
|
653
|
+
TimingLGR,
|
|
654
|
+
outputlevel=args.outputlevel,
|
|
655
|
+
gausssigma=args.delayoffsetgausssigma,
|
|
656
|
+
patchthresh=args.delaypatchthresh,
|
|
692
657
|
mindelay=args.mindelay,
|
|
693
658
|
maxdelay=args.maxdelay,
|
|
694
659
|
numpoints=args.numpoints,
|
|
660
|
+
histlen=therunoptions["histlen"],
|
|
661
|
+
rt_floatset=rt_floatset,
|
|
662
|
+
rt_floattype=rt_floattype,
|
|
695
663
|
debug=args.debug,
|
|
696
664
|
)
|
|
697
|
-
TimingLGR.info("Refinement calibration end")
|
|
698
|
-
|
|
699
|
-
# now calculate the delay offsets
|
|
700
|
-
TimingLGR.info("Calculating delay offsets")
|
|
701
|
-
delayoffset = np.zeros_like(filteredregressderivratios)
|
|
702
|
-
if args.debug:
|
|
703
|
-
print(f"calculating delayoffsets for {filteredregressderivratios.shape[0]} voxels")
|
|
704
|
-
for i in range(filteredregressderivratios.shape[0]):
|
|
705
|
-
delayoffset[i], closestoffset = tide_refinedelay.ratiotodelay(
|
|
706
|
-
filteredregressderivratios[i]
|
|
707
|
-
)
|
|
708
|
-
"""delayoffset[i] = tide_refinedelay.coffstodelay(
|
|
709
|
-
np.asarray([filteredregressderivratios[i]]),
|
|
710
|
-
mindelay=args.mindelay,
|
|
711
|
-
maxdelay=args.maxdelay,
|
|
712
|
-
)"""
|
|
713
665
|
|
|
714
|
-
|
|
715
|
-
else:
|
|
716
|
-
medfiltregressderivratios = np.zeros_like(regressderivratios)
|
|
717
|
-
filteredregressderivratios = np.zeros_like(regressderivratios)
|
|
718
|
-
delayoffsetMAD = np.zeros(args.refineregressderivs, dtype=float)
|
|
719
|
-
for i in range(args.refineregressderivs):
|
|
720
|
-
(
|
|
721
|
-
medfiltregressderivratios[i, :],
|
|
722
|
-
filteredregressderivratios[i, :],
|
|
723
|
-
delayoffsetMAD[i],
|
|
724
|
-
) = tide_refinedelay.filterderivratios(
|
|
725
|
-
regressderivratios[i, :],
|
|
726
|
-
(xsize, ysize, numslices),
|
|
727
|
-
validvoxels,
|
|
728
|
-
(xdim, ydim, slicethickness),
|
|
729
|
-
gausssigma=args.delayoffsetgausssigma,
|
|
730
|
-
patchthresh=args.delaypatchthresh,
|
|
731
|
-
rt_floattype=rt_floattype,
|
|
732
|
-
debug=args.debug,
|
|
733
|
-
)
|
|
734
|
-
|
|
735
|
-
# now calculate the delay offsets
|
|
736
|
-
delayoffset = np.zeros_like(filteredregressderivratios[0, :])
|
|
737
|
-
if args.debug:
|
|
738
|
-
print(f"calculating delayoffsets for {filteredregressderivratios.shape[1]} voxels")
|
|
739
|
-
for i in range(filteredregressderivratios.shape[1]):
|
|
740
|
-
delayoffset[i] = tide_refinedelay.coffstodelay(
|
|
741
|
-
filteredregressderivratios[:, i],
|
|
742
|
-
mindelay=args.mindelay,
|
|
743
|
-
maxdelay=args.maxdelay,
|
|
744
|
-
)
|
|
745
|
-
refinedvoxelstoreport = filteredregressderivratios.shape[1]
|
|
666
|
+
refinedvoxelstoreport = filteredregressderivratios.shape[0]
|
|
746
667
|
|
|
747
|
-
if not args.saveEVsandquit:
|
|
748
|
-
namesuffix = "_desc-delayoffset_hist"
|
|
749
|
-
tide_stats.makeandsavehistogram(
|
|
750
|
-
delayoffset,
|
|
751
|
-
therunoptions["histlen"],
|
|
752
|
-
1,
|
|
753
|
-
outputname + namesuffix,
|
|
754
|
-
displaytitle="Histogram of delay offsets calculated from GLM",
|
|
755
|
-
dictvarname="delayoffsethist",
|
|
756
|
-
thedict=None,
|
|
757
|
-
)
|
|
758
668
|
lagtimesrefined_valid = lagtimes_valid + delayoffset
|
|
759
669
|
|
|
760
670
|
TimingLGR.info(
|
|
@@ -1090,56 +1000,28 @@ def retroregress(args):
|
|
|
1090
1000
|
]
|
|
1091
1001
|
|
|
1092
1002
|
if args.refinedelay:
|
|
1093
|
-
if args.refineregressderivs > 1:
|
|
1094
|
-
for i in range(args.refineregressderivs):
|
|
1095
|
-
maplist += [
|
|
1096
|
-
(
|
|
1097
|
-
regressderivratios[i, :],
|
|
1098
|
-
f"regressderivratios_{i}",
|
|
1099
|
-
"map",
|
|
1100
|
-
None,
|
|
1101
|
-
f"Ratio of derivative {i+1} of delayed sLFO to the delayed sLFO",
|
|
1102
|
-
),
|
|
1103
|
-
(
|
|
1104
|
-
medfiltregressderivratios[i, :],
|
|
1105
|
-
f"medfiltregressderivratios_{i}",
|
|
1106
|
-
"map",
|
|
1107
|
-
None,
|
|
1108
|
-
f"Median filtered version of the regressderivratios_{i} map",
|
|
1109
|
-
),
|
|
1110
|
-
(
|
|
1111
|
-
filteredregressderivratios[i, :],
|
|
1112
|
-
f"filteredregressderivratios_{i}",
|
|
1113
|
-
"map",
|
|
1114
|
-
None,
|
|
1115
|
-
f"regressderivratios_{i}, with outliers patched using median filtered data",
|
|
1116
|
-
),
|
|
1117
|
-
]
|
|
1118
|
-
else:
|
|
1119
|
-
maplist += [
|
|
1120
|
-
(
|
|
1121
|
-
regressderivratios,
|
|
1122
|
-
"regressderivratios",
|
|
1123
|
-
"map",
|
|
1124
|
-
None,
|
|
1125
|
-
"Ratio of the first derivative of delayed sLFO to the delayed sLFO",
|
|
1126
|
-
),
|
|
1127
|
-
(
|
|
1128
|
-
medfiltregressderivratios,
|
|
1129
|
-
"medfiltregressderivratios",
|
|
1130
|
-
"map",
|
|
1131
|
-
None,
|
|
1132
|
-
"Median filtered version of the regressderivratios map",
|
|
1133
|
-
),
|
|
1134
|
-
(
|
|
1135
|
-
filteredregressderivratios,
|
|
1136
|
-
"filteredregressderivratios",
|
|
1137
|
-
"map",
|
|
1138
|
-
None,
|
|
1139
|
-
"regressderivratios, with outliers patched using median filtered data",
|
|
1140
|
-
),
|
|
1141
|
-
]
|
|
1142
1003
|
maplist += [
|
|
1004
|
+
(
|
|
1005
|
+
regressderivratios,
|
|
1006
|
+
"regressderivratios",
|
|
1007
|
+
"map",
|
|
1008
|
+
None,
|
|
1009
|
+
"Ratio of the first derivative of delayed sLFO to the delayed sLFO",
|
|
1010
|
+
),
|
|
1011
|
+
(
|
|
1012
|
+
medfiltregressderivratios,
|
|
1013
|
+
"medfiltregressderivratios",
|
|
1014
|
+
"map",
|
|
1015
|
+
None,
|
|
1016
|
+
"Median filtered version of the regressderivratios map",
|
|
1017
|
+
),
|
|
1018
|
+
(
|
|
1019
|
+
filteredregressderivratios,
|
|
1020
|
+
"filteredregressderivratios",
|
|
1021
|
+
"map",
|
|
1022
|
+
None,
|
|
1023
|
+
"regressderivratios, with outliers patched using median filtered data",
|
|
1024
|
+
),
|
|
1143
1025
|
(
|
|
1144
1026
|
delayoffset,
|
|
1145
1027
|
"delayoffset",
|
|
@@ -23,9 +23,9 @@ import numpy as np
|
|
|
23
23
|
from scipy.stats import pearsonr
|
|
24
24
|
|
|
25
25
|
import rapidtide.correlate as tide_corr
|
|
26
|
-
import rapidtide.helper_classes as tide_classes
|
|
27
26
|
import rapidtide.io as tide_io
|
|
28
27
|
import rapidtide.miscmath as tide_math
|
|
28
|
+
import rapidtide.simFuncClasses as tide_simFuncClasses
|
|
29
29
|
import rapidtide.workflows.parser_funcs as pf
|
|
30
30
|
|
|
31
31
|
|
|
@@ -391,7 +391,7 @@ def showarbcorr(args):
|
|
|
391
391
|
thepxcorr = pearsonr(filtereddata1, filtereddata2)
|
|
392
392
|
|
|
393
393
|
# initialize the correlation fitter
|
|
394
|
-
thexsimfuncfitter =
|
|
394
|
+
thexsimfuncfitter = tide_simFuncClasses.SimilarityFunctionFitter(
|
|
395
395
|
corrtimeaxis=xcorr_x,
|
|
396
396
|
lagmin=args.lagmin,
|
|
397
397
|
lagmax=args.lagmax,
|
|
@@ -28,10 +28,10 @@ from scipy.stats import pearsonr
|
|
|
28
28
|
import rapidtide.calcnullsimfunc as tide_nullsimfunc
|
|
29
29
|
import rapidtide.correlate as tide_corr
|
|
30
30
|
import rapidtide.fit as tide_fit
|
|
31
|
-
import rapidtide.helper_classes as tide_classes
|
|
32
31
|
import rapidtide.io as tide_io
|
|
33
32
|
import rapidtide.miscmath as tide_math
|
|
34
33
|
import rapidtide.peakeval as tide_peakeval
|
|
34
|
+
import rapidtide.simFuncClasses as tide_simFuncClasses
|
|
35
35
|
import rapidtide.stats as tide_stats
|
|
36
36
|
import rapidtide.util as tide_util
|
|
37
37
|
import rapidtide.workflows.parser_funcs as pf
|
|
@@ -459,7 +459,7 @@ def showxcorrx(args):
|
|
|
459
459
|
thefit, R2 = tide_fit.mlregress(regressorvec, filtereddata2)
|
|
460
460
|
|
|
461
461
|
# initialize the Correlator and MutualInformationator
|
|
462
|
-
theCorrelator =
|
|
462
|
+
theCorrelator = tide_simFuncClasses.Correlator(
|
|
463
463
|
Fs=args.samplerate,
|
|
464
464
|
ncprefilter=theprefilter,
|
|
465
465
|
detrendorder=args.detrendorder,
|
|
@@ -469,7 +469,7 @@ def showxcorrx(args):
|
|
|
469
469
|
debug=args.debug,
|
|
470
470
|
)
|
|
471
471
|
theCorrelator.setreftc(trimdata2 * flipfac)
|
|
472
|
-
theMutualInformationator =
|
|
472
|
+
theMutualInformationator = tide_simFuncClasses.MutualInformationator(
|
|
473
473
|
Fs=args.samplerate,
|
|
474
474
|
smoothingtime=args.smoothingtime,
|
|
475
475
|
ncprefilter=theprefilter,
|
|
@@ -559,7 +559,7 @@ def showxcorrx(args):
|
|
|
559
559
|
|
|
560
560
|
if args.similaritymetric == "mutualinfo":
|
|
561
561
|
# initialize the similarity function fitter
|
|
562
|
-
themifitter =
|
|
562
|
+
themifitter = tide_simFuncClasses.SimilarityFunctionFitter(
|
|
563
563
|
corrtimeaxis=MI_x_trim,
|
|
564
564
|
lagmin=args.lagmin,
|
|
565
565
|
lagmax=args.lagmax,
|
|
@@ -574,7 +574,7 @@ def showxcorrx(args):
|
|
|
574
574
|
maxdelaymi = MI_x_trim[np.argmax(theMI_trim)]
|
|
575
575
|
else:
|
|
576
576
|
# initialize the correlation fitter
|
|
577
|
-
thexsimfuncfitter =
|
|
577
|
+
thexsimfuncfitter = tide_simFuncClasses.SimilarityFunctionFitter(
|
|
578
578
|
corrtimeaxis=xcorr_x,
|
|
579
579
|
lagmin=args.lagmin,
|
|
580
580
|
lagmax=args.lagmax,
|
rapidtide/workflows/tidepool.py
CHANGED
|
@@ -33,9 +33,9 @@ from pyqtgraph.Qt import QtCore, QtGui, QtWidgets
|
|
|
33
33
|
|
|
34
34
|
import rapidtide.util as tide_util
|
|
35
35
|
from rapidtide.Colortables import *
|
|
36
|
-
from rapidtide.helper_classes import SimilarityFunctionFitter
|
|
37
36
|
from rapidtide.OrthoImageItem import OrthoImageItem
|
|
38
37
|
from rapidtide.RapidtideDataset import RapidtideDataset, check_rt_spatialmatch
|
|
38
|
+
from rapidtide.simFuncClasses import SimilarityFunctionFitter
|
|
39
39
|
from rapidtide.workflows.atlasaverage import summarizevoxels
|
|
40
40
|
|
|
41
41
|
try:
|
|
@@ -2002,7 +2002,7 @@ def tidepool(args):
|
|
|
2002
2002
|
},
|
|
2003
2003
|
"R2": {
|
|
2004
2004
|
"colormap": gen_thermal_state(),
|
|
2005
|
-
"label": "
|
|
2005
|
+
"label": "sLFO Fit R2",
|
|
2006
2006
|
"display": extramaps,
|
|
2007
2007
|
"funcmask": "p_lt_0p050_mask",
|
|
2008
2008
|
},
|
|
@@ -2020,13 +2020,13 @@ def tidepool(args):
|
|
|
2020
2020
|
},
|
|
2021
2021
|
"varBefore": {
|
|
2022
2022
|
"colormap": gen_thermal_state(),
|
|
2023
|
-
"label": "LFO variance before
|
|
2023
|
+
"label": "LFO variance before filtering",
|
|
2024
2024
|
"display": extramaps,
|
|
2025
2025
|
"funcmask": "p_lt_0p050_mask",
|
|
2026
2026
|
},
|
|
2027
2027
|
"varAfter": {
|
|
2028
2028
|
"colormap": gen_thermal_state(),
|
|
2029
|
-
"label": "LFO variance after
|
|
2029
|
+
"label": "LFO variance after filtering",
|
|
2030
2030
|
"display": extramaps,
|
|
2031
2031
|
"funcmask": "p_lt_0p050_mask",
|
|
2032
2032
|
},
|
|
@@ -2074,7 +2074,7 @@ def tidepool(args):
|
|
|
2074
2074
|
},
|
|
2075
2075
|
"fitcoff": {
|
|
2076
2076
|
"colormap": gen_thermal_state(),
|
|
2077
|
-
"label": "
|
|
2077
|
+
"label": "sLFO fit coefficient",
|
|
2078
2078
|
"display": True,
|
|
2079
2079
|
"funcmask": "p_lt_0p050_mask",
|
|
2080
2080
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rapidtide
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.9
|
|
4
4
|
Summary: Tools for performing correlation analysis on fMRI data.
|
|
5
5
|
Author: Taylor Salo, Daniel M. Drucker, Ph.D., Jeffrey N Stout, Yaroslav O. Halchenko, Derek Monroe
|
|
6
6
|
Author-email: "Blaise deB. Frederick" <blaise.frederick@gmail.com>
|
|
@@ -24,7 +24,7 @@ Requires-Python: >=3.9
|
|
|
24
24
|
Description-Content-Type: text/x-rst
|
|
25
25
|
License-File: LICENSE
|
|
26
26
|
Requires-Dist: numpy
|
|
27
|
-
Requires-Dist: scipy
|
|
27
|
+
Requires-Dist: scipy<=1.15.3
|
|
28
28
|
Requires-Dist: pandas
|
|
29
29
|
Requires-Dist: pyarrow
|
|
30
30
|
Requires-Dist: scikit-image
|