rapidtide 3.0.7.1__py3-none-any.whl → 3.0.8__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/_version.py +3 -3
- rapidtide/calcnullsimfunc.py +1 -3
- rapidtide/data/examples/src/test_findmaxlag.py +1 -1
- rapidtide/data/examples/src/testfmri +22 -16
- 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 +59 -0
- rapidtide/makelaggedtcs.py +10 -0
- rapidtide/refinedelay.py +10 -19
- 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 +8 -7
- rapidtide/tests/test_findmaxlag.py +2 -2
- rapidtide/tests/test_fullrunrapidtide_v3.py +2 -1
- 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/cleanregressor.py +2 -2
- rapidtide/workflows/delayvar.py +44 -58
- rapidtide/workflows/{delayestimation.py → estimateDelayMap.py} +84 -31
- rapidtide/workflows/rapidtide.py +349 -859
- rapidtide/workflows/rapidtide_parser.py +5 -38
- rapidtide/workflows/refineDelayMap.py +138 -0
- rapidtide/{RegressorRefiner.py → workflows/refineRegressor.py} +200 -28
- rapidtide/workflows/regressfrommaps.py +35 -27
- 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.8.dist-info}/METADATA +2 -2
- {rapidtide-3.0.7.1.dist-info → rapidtide-3.0.8.dist-info}/RECORD +50 -48
- {rapidtide-3.0.7.1.dist-info → rapidtide-3.0.8.dist-info}/WHEEL +0 -0
- {rapidtide-3.0.7.1.dist-info → rapidtide-3.0.8.dist-info}/entry_points.txt +0 -0
- {rapidtide-3.0.7.1.dist-info → rapidtide-3.0.8.dist-info}/licenses/LICENSE +0 -0
- {rapidtide-3.0.7.1.dist-info → rapidtide-3.0.8.dist-info}/top_level.txt +0 -0
rapidtide/workflows/delayvar.py
CHANGED
|
@@ -614,38 +614,32 @@ def delayvar(args):
|
|
|
614
614
|
windowedfilteredregressderivratios = np.zeros(internalwinspaceshape, dtype=float)
|
|
615
615
|
windoweddelayoffset = np.zeros(internalwinspaceshape, dtype=float)
|
|
616
616
|
windowedclosestoffset = np.zeros(internalwinspaceshape, dtype=float)
|
|
617
|
+
|
|
618
|
+
winsLFOfitmean, winsLFOfitmean_shm = tide_util.allocarray(
|
|
619
|
+
internalwinspaceshape, rt_outfloattype, shared=usesharedmem
|
|
620
|
+
)
|
|
621
|
+
winrvalue, winrvalue_shm = tide_util.allocarray(internalwinspaceshape, rt_outfloattype, shared=usesharedmem)
|
|
622
|
+
winr2value, winr2value_shm = tide_util.allocarray(internalwinspaceshape, rt_outfloattype, shared=usesharedmem)
|
|
623
|
+
winfitNorm, winfitNorm_shm = tide_util.allocarray(
|
|
624
|
+
internalwinspaceshapederivs, rt_outfloattype, shared=usesharedmem
|
|
625
|
+
)
|
|
626
|
+
winfitcoeff, winitcoeff_shm = tide_util.allocarray(
|
|
627
|
+
internalwinspaceshapederivs, rt_outfloattype, shared=usesharedmem
|
|
628
|
+
)
|
|
629
|
+
winmovingsignal, winmovingsignal_shm = tide_util.allocarray(
|
|
630
|
+
internalwinfmrishape, rt_outfloattype, shared=usesharedmem
|
|
631
|
+
)
|
|
632
|
+
winlagtc, winlagtc_shm = tide_util.allocarray(internalwinfmrishape, rt_floattype, shared=usesharedmem)
|
|
633
|
+
winfiltereddata, winfiltereddata_shm = tide_util.allocarray(
|
|
634
|
+
internalwinfmrishape, rt_outfloattype, shared=usesharedmem
|
|
635
|
+
)
|
|
617
636
|
if usesharedmem:
|
|
618
637
|
if args.debug:
|
|
619
638
|
print("allocating shared memory")
|
|
620
|
-
winsLFOfitmean, winsLFOfitmean_shm = tide_util.allocshared(
|
|
621
|
-
internalwinspaceshape, rt_outfloatset
|
|
622
|
-
)
|
|
623
|
-
winrvalue, winrvalue_shm = tide_util.allocshared(internalwinspaceshape, rt_outfloatset)
|
|
624
|
-
winr2value, winr2value_shm = tide_util.allocshared(internalwinspaceshape, rt_outfloatset)
|
|
625
|
-
winfitNorm, winfitNorm_shm = tide_util.allocshared(
|
|
626
|
-
internalwinspaceshapederivs, rt_outfloatset
|
|
627
|
-
)
|
|
628
|
-
winfitcoeff, winitcoeff_shm = tide_util.allocshared(
|
|
629
|
-
internalwinspaceshapederivs, rt_outfloatset
|
|
630
|
-
)
|
|
631
|
-
winmovingsignal, winmovingsignal_shm = tide_util.allocshared(
|
|
632
|
-
internalwinfmrishape, rt_outfloatset
|
|
633
|
-
)
|
|
634
|
-
winlagtc, winlagtc_shm = tide_util.allocshared(internalwinfmrishape, rt_floatset)
|
|
635
|
-
winfiltereddata, winfiltereddata_shm = tide_util.allocshared(
|
|
636
|
-
internalwinfmrishape, rt_outfloatset
|
|
637
|
-
)
|
|
638
639
|
else:
|
|
639
640
|
if args.debug:
|
|
640
641
|
print("allocating memory")
|
|
641
|
-
|
|
642
|
-
winrvalue = np.zeros(internalwinspaceshape, dtype=rt_outfloattype)
|
|
643
|
-
winr2value = np.zeros(internalwinspaceshape, dtype=rt_outfloattype)
|
|
644
|
-
winfitNorm = np.zeros(internalwinspaceshapederivs, dtype=rt_outfloattype)
|
|
645
|
-
winfitcoeff = np.zeros(internalwinspaceshapederivs, dtype=rt_outfloattype)
|
|
646
|
-
winmovingsignal = np.zeros(internalwinfmrishape, dtype=rt_outfloattype)
|
|
647
|
-
winlagtc = np.zeros(internalwinfmrishape, dtype=rt_floattype)
|
|
648
|
-
winfiltereddata = np.zeros(internalwinfmrishape, dtype=rt_outfloattype)
|
|
642
|
+
|
|
649
643
|
if args.debug:
|
|
650
644
|
print(f"wintrs={wintrs}, winskip={winskip}, numtrs={numtrs}, numwins={numwins}")
|
|
651
645
|
thewindowprocoptions = therunoptions
|
|
@@ -872,44 +866,36 @@ def delayvar(args):
|
|
|
872
866
|
|
|
873
867
|
doregress = False
|
|
874
868
|
if doregress:
|
|
869
|
+
systemicsLFOfitmean, systemicsLFOfitmean_shm = tide_util.allocarray(
|
|
870
|
+
internalwinspaceshape, rt_outfloattype, shared=usesharedmem
|
|
871
|
+
)
|
|
872
|
+
systemicrvalue, systemicrvalue_shm = tide_util.allocarray(
|
|
873
|
+
internalwinspaceshape, rt_outfloattype, shared=usesharedmem
|
|
874
|
+
)
|
|
875
|
+
systemicr2value, systemicr2value_shm = tide_util.allocarray(
|
|
876
|
+
internalwinspaceshape, rt_outfloattype, shared=usesharedmem
|
|
877
|
+
)
|
|
878
|
+
systemicfitNorm, systemicfitNorm_shm = tide_util.allocarray(
|
|
879
|
+
internalwinspaceshapederivs, rt_outfloattype, shared=usesharedmem
|
|
880
|
+
)
|
|
881
|
+
systemicfitcoeff, systemicitcoeff_shm = tide_util.allocarray(
|
|
882
|
+
internalwinspaceshapederivs, rt_outfloattype, shared=usesharedmem
|
|
883
|
+
)
|
|
884
|
+
systemicmovingsignal, systemicmovingsignal_shm = tide_util.allocarray(
|
|
885
|
+
internalwinspaceshape, rt_outfloattype, shared=usesharedmem
|
|
886
|
+
)
|
|
887
|
+
systemiclagtc, systemiclagtc_shm = tide_util.allocarray(
|
|
888
|
+
internalwinspaceshape, rt_floattype, shared=usesharedmem
|
|
889
|
+
)
|
|
890
|
+
systemicfiltereddata, systemicfiltereddata_shm = tide_util.allocarray(
|
|
891
|
+
internalwinspaceshape, rt_outfloattype, shared=usesharedmem
|
|
892
|
+
)
|
|
875
893
|
if usesharedmem:
|
|
876
894
|
if args.debug:
|
|
877
895
|
print("allocating shared memory")
|
|
878
|
-
systemicsLFOfitmean, systemicsLFOfitmean_shm = tide_util.allocshared(
|
|
879
|
-
internalwinspaceshape, rt_outfloatset
|
|
880
|
-
)
|
|
881
|
-
systemicrvalue, systemicrvalue_shm = tide_util.allocshared(
|
|
882
|
-
internalwinspaceshape, rt_outfloatset
|
|
883
|
-
)
|
|
884
|
-
systemicr2value, systemicr2value_shm = tide_util.allocshared(
|
|
885
|
-
internalwinspaceshape, rt_outfloatset
|
|
886
|
-
)
|
|
887
|
-
systemicfitNorm, systemicfitNorm_shm = tide_util.allocshared(
|
|
888
|
-
internalwinspaceshapederivs, rt_outfloatset
|
|
889
|
-
)
|
|
890
|
-
systemicfitcoeff, systemicitcoeff_shm = tide_util.allocshared(
|
|
891
|
-
internalwinspaceshapederivs, rt_outfloatset
|
|
892
|
-
)
|
|
893
|
-
systemicmovingsignal, systemicmovingsignal_shm = tide_util.allocshared(
|
|
894
|
-
internalwinspaceshape, rt_outfloatset
|
|
895
|
-
)
|
|
896
|
-
systemiclagtc, systemiclagtc_shm = tide_util.allocshared(
|
|
897
|
-
internalwinspaceshape, rt_floatset
|
|
898
|
-
)
|
|
899
|
-
systemicfiltereddata, systemicfiltereddata_shm = tide_util.allocshared(
|
|
900
|
-
internalwinspaceshape, rt_outfloatset
|
|
901
|
-
)
|
|
902
896
|
else:
|
|
903
897
|
if args.debug:
|
|
904
898
|
print("allocating memory")
|
|
905
|
-
systemicsLFOfitmean = np.zeros(internalwinspaceshape, dtype=rt_outfloattype)
|
|
906
|
-
systemicrvalue = np.zeros(internalwinspaceshape, dtype=rt_outfloattype)
|
|
907
|
-
systemicr2value = np.zeros(internalwinspaceshape, dtype=rt_outfloattype)
|
|
908
|
-
systemicfitNorm = np.zeros(internalwinspaceshapederivs, dtype=rt_outfloattype)
|
|
909
|
-
systemicfitcoeff = np.zeros(internalwinspaceshapederivs, dtype=rt_outfloattype)
|
|
910
|
-
systemicmovingsignal = np.zeros(internalwinspaceshape, dtype=rt_outfloattype)
|
|
911
|
-
systemiclagtc = np.zeros(internalwinspaceshape, dtype=rt_floattype)
|
|
912
|
-
systemicfiltereddata = np.zeros(internalwinspaceshape, dtype=rt_outfloattype)
|
|
913
899
|
|
|
914
900
|
windowlocs = np.linspace(0.0, winspace * numwins, num=numwins, endpoint=False) + skiptime
|
|
915
901
|
voxelsprocessed_regressionfilt, regressorset, evset = tide_regressfrommaps.regressfrommaps(
|
|
@@ -16,14 +16,16 @@
|
|
|
16
16
|
# limitations under the License.
|
|
17
17
|
#
|
|
18
18
|
#
|
|
19
|
-
import argparse
|
|
20
|
-
import sys
|
|
21
|
-
|
|
22
19
|
import numpy as np
|
|
23
|
-
from scipy
|
|
20
|
+
from scipy import ndimage
|
|
24
21
|
|
|
22
|
+
import rapidtide.calcsimfunc as tide_calcsimfunc
|
|
25
23
|
import rapidtide.io as tide_io
|
|
26
|
-
import rapidtide.
|
|
24
|
+
import rapidtide.patchmatch as tide_patch
|
|
25
|
+
import rapidtide.peakeval as tide_peakeval
|
|
26
|
+
import rapidtide.simfuncfit as tide_simfuncfit
|
|
27
|
+
import rapidtide.stats as tide_stats
|
|
28
|
+
import rapidtide.util as tide_util
|
|
27
29
|
|
|
28
30
|
try:
|
|
29
31
|
import mkl
|
|
@@ -48,7 +50,52 @@ def enablemkl(numthreads, debug=False):
|
|
|
48
50
|
mkl.set_num_threads(numthreads)
|
|
49
51
|
|
|
50
52
|
|
|
51
|
-
def estimateDelay(
|
|
53
|
+
def estimateDelay(
|
|
54
|
+
fmri_data_valid,
|
|
55
|
+
validsimcalcstart,
|
|
56
|
+
validsimcalcend,
|
|
57
|
+
osvalidsimcalcstart,
|
|
58
|
+
osvalidsimcalcend,
|
|
59
|
+
initial_fmri_x,
|
|
60
|
+
os_fmri_x,
|
|
61
|
+
theCorrelator,
|
|
62
|
+
theMutualInformationator,
|
|
63
|
+
cleaned_referencetc,
|
|
64
|
+
corrout,
|
|
65
|
+
meanval,
|
|
66
|
+
corrscale,
|
|
67
|
+
outputname,
|
|
68
|
+
outcorrarray,
|
|
69
|
+
validvoxels,
|
|
70
|
+
nativecorrshape,
|
|
71
|
+
nativespaceshape,
|
|
72
|
+
bidsbasedict,
|
|
73
|
+
numspatiallocs,
|
|
74
|
+
gaussout,
|
|
75
|
+
theinitialdelay,
|
|
76
|
+
windowout,
|
|
77
|
+
R2,
|
|
78
|
+
thesizes,
|
|
79
|
+
internalspaceshape,
|
|
80
|
+
numvalidspatiallocs,
|
|
81
|
+
theinputdata,
|
|
82
|
+
theheader,
|
|
83
|
+
theFitter,
|
|
84
|
+
fitmask,
|
|
85
|
+
lagtimes,
|
|
86
|
+
lagstrengths,
|
|
87
|
+
lagsigma,
|
|
88
|
+
failreason,
|
|
89
|
+
outmaparray,
|
|
90
|
+
lagmininpts,
|
|
91
|
+
lagmaxinpts,
|
|
92
|
+
thepass,
|
|
93
|
+
optiondict,
|
|
94
|
+
LGR,
|
|
95
|
+
TimingLGR,
|
|
96
|
+
rt_floatset=np.float64,
|
|
97
|
+
rt_floattype="float64",
|
|
98
|
+
):
|
|
52
99
|
# Step 1 - Correlation step
|
|
53
100
|
if optiondict["similaritymetric"] == "mutualinfo":
|
|
54
101
|
similaritytype = "Mutual information"
|
|
@@ -59,7 +106,7 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
59
106
|
LGR.info(f"\n\n{similaritytype} calculation, pass {thepass}")
|
|
60
107
|
TimingLGR.info(f"{similaritytype} calculation start, pass {thepass}")
|
|
61
108
|
|
|
62
|
-
disablemkl(optiondict["nprocs_calcsimilarity"], debug=threaddebug)
|
|
109
|
+
tide_util.disablemkl(optiondict["nprocs_calcsimilarity"], debug=optiondict["threaddebug"])
|
|
63
110
|
if optiondict["similaritymetric"] == "mutualinfo":
|
|
64
111
|
theMutualInformationator.setlimits(lagmininpts, lagmaxinpts)
|
|
65
112
|
(
|
|
@@ -67,11 +114,11 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
67
114
|
theglobalmaxlist,
|
|
68
115
|
trimmedcorrscale,
|
|
69
116
|
) = tide_calcsimfunc.correlationpass(
|
|
70
|
-
|
|
117
|
+
fmri_data_valid[:, validsimcalcstart : validsimcalcend + 1],
|
|
71
118
|
cleaned_referencetc,
|
|
72
119
|
theMutualInformationator,
|
|
73
|
-
|
|
74
|
-
|
|
120
|
+
initial_fmri_x[validsimcalcstart : validsimcalcend + 1],
|
|
121
|
+
os_fmri_x[osvalidsimcalcstart : osvalidsimcalcend + 1],
|
|
75
122
|
lagmininpts,
|
|
76
123
|
lagmaxinpts,
|
|
77
124
|
corrout,
|
|
@@ -84,6 +131,7 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
84
131
|
chunksize=optiondict["mp_chunksize"],
|
|
85
132
|
rt_floatset=rt_floatset,
|
|
86
133
|
rt_floattype=rt_floattype,
|
|
134
|
+
debug=optiondict["focaldebug"],
|
|
87
135
|
)
|
|
88
136
|
else:
|
|
89
137
|
(
|
|
@@ -91,11 +139,11 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
91
139
|
theglobalmaxlist,
|
|
92
140
|
trimmedcorrscale,
|
|
93
141
|
) = tide_calcsimfunc.correlationpass(
|
|
94
|
-
|
|
142
|
+
fmri_data_valid[:, validsimcalcstart : validsimcalcend + 1],
|
|
95
143
|
cleaned_referencetc,
|
|
96
144
|
theCorrelator,
|
|
97
|
-
|
|
98
|
-
|
|
145
|
+
initial_fmri_x[validsimcalcstart : validsimcalcend + 1],
|
|
146
|
+
os_fmri_x[osvalidsimcalcstart : osvalidsimcalcend + 1],
|
|
99
147
|
lagmininpts,
|
|
100
148
|
lagmaxinpts,
|
|
101
149
|
corrout,
|
|
@@ -108,8 +156,9 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
108
156
|
chunksize=optiondict["mp_chunksize"],
|
|
109
157
|
rt_floatset=rt_floatset,
|
|
110
158
|
rt_floattype=rt_floattype,
|
|
159
|
+
debug=optiondict["focaldebug"],
|
|
111
160
|
)
|
|
112
|
-
enablemkl(optiondict["mklthreads"], debug=threaddebug)
|
|
161
|
+
tide_util.enablemkl(optiondict["mklthreads"], debug=optiondict["threaddebug"])
|
|
113
162
|
|
|
114
163
|
for i in range(len(theglobalmaxlist)):
|
|
115
164
|
theglobalmaxlist[i] = corrscale[theglobalmaxlist[i]] - optiondict["simcalcoffset"]
|
|
@@ -152,12 +201,12 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
152
201
|
LGR.info(f"\n\nPeak prefit calculation, pass {thepass}")
|
|
153
202
|
TimingLGR.info(f"Peak prefit calculation start, pass {thepass}")
|
|
154
203
|
|
|
155
|
-
disablemkl(optiondict["nprocs_peakeval"], debug=threaddebug)
|
|
204
|
+
tide_util.disablemkl(optiondict["nprocs_peakeval"], debug=optiondict["threaddebug"])
|
|
156
205
|
voxelsprocessed_pe, thepeakdict = tide_peakeval.peakevalpass(
|
|
157
|
-
|
|
206
|
+
fmri_data_valid[:, validsimcalcstart : validsimcalcend + 1],
|
|
158
207
|
cleaned_referencetc,
|
|
159
|
-
|
|
160
|
-
|
|
208
|
+
initial_fmri_x[validsimcalcstart : validsimcalcend + 1],
|
|
209
|
+
os_fmri_x[osvalidsimcalcstart : osvalidsimcalcend + 1],
|
|
161
210
|
theMutualInformationator,
|
|
162
211
|
trimmedcorrscale,
|
|
163
212
|
corrout,
|
|
@@ -171,7 +220,7 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
171
220
|
rt_floatset=rt_floatset,
|
|
172
221
|
rt_floattype=rt_floattype,
|
|
173
222
|
)
|
|
174
|
-
enablemkl(optiondict["mklthreads"], debug=threaddebug)
|
|
223
|
+
tide_util.enablemkl(optiondict["mklthreads"], debug=optiondict["threaddebug"])
|
|
175
224
|
|
|
176
225
|
TimingLGR.info(
|
|
177
226
|
f"Peak prefit end, pass {thepass}",
|
|
@@ -203,7 +252,7 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
203
252
|
else:
|
|
204
253
|
initlags = None
|
|
205
254
|
|
|
206
|
-
disablemkl(optiondict["nprocs_fitcorr"], debug=threaddebug)
|
|
255
|
+
tide_util.disablemkl(optiondict["nprocs_fitcorr"], debug=optiondict["threaddebug"])
|
|
207
256
|
voxelsprocessed_fc = tide_simfuncfit.fitcorr(
|
|
208
257
|
trimmedcorrscale,
|
|
209
258
|
theFitter,
|
|
@@ -229,7 +278,7 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
229
278
|
rt_floatset=rt_floatset,
|
|
230
279
|
rt_floattype=rt_floattype,
|
|
231
280
|
)
|
|
232
|
-
enablemkl(optiondict["mklthreads"], debug=threaddebug)
|
|
281
|
+
tide_util.enablemkl(optiondict["mklthreads"], debug=optiondict["threaddebug"])
|
|
233
282
|
|
|
234
283
|
TimingLGR.info(
|
|
235
284
|
f"Time lag estimation end, pass {thepass}",
|
|
@@ -269,7 +318,9 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
269
318
|
numdespeckled = len(np.where(initlags != -1000000.0)[0])
|
|
270
319
|
if lastnumdespeckled > numdespeckled > 0:
|
|
271
320
|
lastnumdespeckled = numdespeckled
|
|
272
|
-
disablemkl(
|
|
321
|
+
tide_util.disablemkl(
|
|
322
|
+
optiondict["nprocs_fitcorr"], debug=optiondict["threaddebug"]
|
|
323
|
+
)
|
|
273
324
|
voxelsprocessed_thispass = tide_simfuncfit.fitcorr(
|
|
274
325
|
trimmedcorrscale,
|
|
275
326
|
theFitter,
|
|
@@ -295,7 +346,7 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
295
346
|
rt_floatset=rt_floatset,
|
|
296
347
|
rt_floattype=rt_floattype,
|
|
297
348
|
)
|
|
298
|
-
enablemkl(optiondict["mklthreads"], debug=threaddebug)
|
|
349
|
+
tide_util.enablemkl(optiondict["mklthreads"], debug=optiondict["threaddebug"])
|
|
299
350
|
|
|
300
351
|
voxelsprocessed_fc_ds += voxelsprocessed_thispass
|
|
301
352
|
optiondict[
|
|
@@ -348,7 +399,7 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
348
399
|
bidsbasedict,
|
|
349
400
|
filetype=theinputdata.filetype,
|
|
350
401
|
rt_floattype=rt_floattype,
|
|
351
|
-
cifti_hdr=cifti_hdr,
|
|
402
|
+
cifti_hdr=theinputdata.cifti_hdr,
|
|
352
403
|
)
|
|
353
404
|
LGR.info(
|
|
354
405
|
f"\n\n{voxelsprocessed_fc_ds} voxels despeckled in "
|
|
@@ -385,15 +436,15 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
385
436
|
bidsbasedict,
|
|
386
437
|
filetype=theinputdata.filetype,
|
|
387
438
|
rt_floattype=rt_floattype,
|
|
388
|
-
cifti_hdr=cifti_hdr,
|
|
439
|
+
cifti_hdr=theinputdata.cifti_hdr,
|
|
389
440
|
)
|
|
390
441
|
|
|
391
442
|
# create list of anomalous 3D regions that don't match surroundings
|
|
392
|
-
if nim_affine is not None:
|
|
443
|
+
if theinputdata.nim_affine is not None:
|
|
393
444
|
# make an atlas of anomalous patches - each patch shares the same integer value
|
|
394
445
|
step1 = tide_patch.calc_DoG(
|
|
395
446
|
outmaparray.reshape(nativespaceshape).copy(),
|
|
396
|
-
nim_affine,
|
|
447
|
+
theinputdata.nim_affine,
|
|
397
448
|
thesizes,
|
|
398
449
|
fwhm=optiondict["patchfwhm"],
|
|
399
450
|
ratioopt=False,
|
|
@@ -417,7 +468,7 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
417
468
|
bidsbasedict,
|
|
418
469
|
filetype=theinputdata.filetype,
|
|
419
470
|
rt_floattype=rt_floattype,
|
|
420
|
-
cifti_hdr=cifti_hdr,
|
|
471
|
+
cifti_hdr=theinputdata.cifti_hdr,
|
|
421
472
|
)
|
|
422
473
|
step2 = tide_patch.invertedflood3D(
|
|
423
474
|
step1,
|
|
@@ -441,7 +492,7 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
441
492
|
bidsbasedict,
|
|
442
493
|
filetype=theinputdata.filetype,
|
|
443
494
|
rt_floattype=rt_floattype,
|
|
444
|
-
cifti_hdr=cifti_hdr,
|
|
495
|
+
cifti_hdr=theinputdata.cifti_hdr,
|
|
445
496
|
)
|
|
446
497
|
|
|
447
498
|
patchmap = tide_patch.separateclusters(
|
|
@@ -451,7 +502,7 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
451
502
|
)
|
|
452
503
|
# patchmap = tide_patch.getclusters(
|
|
453
504
|
# outmaparray.reshape(nativespaceshape),
|
|
454
|
-
# nim_affine,
|
|
505
|
+
# theinputdata.nim_affine,
|
|
455
506
|
# thesizes,
|
|
456
507
|
# fwhm=optiondict["patchfwhm"],
|
|
457
508
|
# ratioopt=True,
|
|
@@ -476,8 +527,10 @@ def estimateDelay(voxeldata, datatimeaxis, osdatatimeaxis, theMutualInformationa
|
|
|
476
527
|
bidsbasedict,
|
|
477
528
|
filetype=theinputdata.filetype,
|
|
478
529
|
rt_floattype=rt_floattype,
|
|
479
|
-
cifti_hdr=cifti_hdr,
|
|
530
|
+
cifti_hdr=theinputdata.cifti_hdr,
|
|
480
531
|
)
|
|
481
532
|
|
|
482
533
|
# now shift the patches to align with the majority of the image
|
|
483
534
|
tide_patch.interppatch(lagtimes, patchmap[validvoxels])
|
|
535
|
+
|
|
536
|
+
return internaldespeckleincludemask
|