rapidtide 3.0a12__py3-none-any.whl → 3.0a14__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.
- cloud/gmscalc-HCPYA +1 -1
- cloud/rapidtide-HCPYA +3 -3
- rapidtide/Colortables.py +10 -10
- rapidtide/DerivativeDelay.py +213 -0
- rapidtide/{Refiner.py → RegressorRefiner.py} +1 -1
- rapidtide/__init__.py +2 -1
- rapidtide/_version.py +1 -1
- rapidtide/data/examples/src/test_mlregressallt.py +32 -17
- rapidtide/data/examples/src/testalign +1 -1
- rapidtide/data/examples/src/testboth +1 -1
- rapidtide/data/examples/src/testcifti +11 -0
- rapidtide/data/examples/src/testdelayvar +14 -0
- rapidtide/data/examples/src/testfmri +1 -0
- rapidtide/data/examples/src/testglmfilt +8 -6
- rapidtide/data/examples/src/testhappy +1 -1
- rapidtide/data/examples/src/testnewrefine +11 -11
- rapidtide/data/examples/src/testnoiseamp +2 -2
- rapidtide/data/examples/src/testretro +16 -7
- rapidtide/data/examples/src/testretrolagtcs +1 -1
- rapidtide/dlfilter.py +0 -1
- rapidtide/fit.py +41 -9
- rapidtide/happy_supportfuncs.py +5 -0
- rapidtide/io.py +13 -2
- rapidtide/{glmpass.py → linfitfiltpass.py} +23 -19
- rapidtide/makelaggedtcs.py +8 -5
- rapidtide/multiproc.py +8 -11
- rapidtide/refinedelay.py +234 -109
- rapidtide/resample.py +3 -0
- rapidtide/scripts/{retroglm.py → delayvar.py} +2 -2
- rapidtide/scripts/{glmfilt.py → linfitfilt.py} +2 -2
- rapidtide/scripts/retroregress.py +28 -0
- rapidtide/scripts/stupidramtricks.py +9 -7
- rapidtide/simfuncfit.py +1 -1
- rapidtide/tests/cleanposttest +21 -0
- rapidtide/tests/test_delayestimation.py +3 -3
- rapidtide/tests/test_fastresampler.py +1 -2
- rapidtide/tests/test_fullrunhappy_v1.py +14 -6
- rapidtide/tests/test_fullrunhappy_v2.py +17 -9
- rapidtide/tests/test_fullrunhappy_v3.py +16 -8
- rapidtide/tests/test_fullrunhappy_v4.py +16 -8
- rapidtide/tests/test_fullrunhappy_v5.py +14 -6
- rapidtide/tests/test_fullrunrapidtide_v1.py +20 -12
- rapidtide/tests/test_fullrunrapidtide_v2.py +21 -13
- rapidtide/tests/test_fullrunrapidtide_v3.py +15 -7
- rapidtide/tests/test_fullrunrapidtide_v4.py +14 -7
- rapidtide/tests/test_fullrunrapidtide_v5.py +13 -5
- rapidtide/tests/test_fullrunrapidtide_v6.py +34 -26
- rapidtide/tests/{test_glmpass.py → test_linfitfiltpass.py} +9 -9
- rapidtide/tests/test_motionregress.py +3 -3
- rapidtide/tests/test_refinedelay.py +14 -12
- rapidtide/tidepoolTemplate_alt_qt6.py +172 -45
- rapidtide/tidepoolTemplate_big_qt6.py +196 -53
- rapidtide/tidepoolTemplate_qt6.py +150 -39
- rapidtide/workflows/atlasaverage.py +40 -12
- rapidtide/workflows/delayvar.py +1136 -0
- rapidtide/workflows/happy.py +37 -11
- rapidtide/workflows/happy_parser.py +4 -4
- rapidtide/workflows/{glmfilt.py → linfitfilt.py} +4 -4
- rapidtide/workflows/rapidtide.py +246 -178
- rapidtide/workflows/rapidtide_parser.py +116 -101
- rapidtide/workflows/{glmfrommaps.py → regressfrommaps.py} +30 -26
- rapidtide/workflows/retrolagtcs.py +13 -12
- rapidtide/workflows/{retroglm.py → retroregress.py} +182 -141
- {rapidtide-3.0a12.dist-info → rapidtide-3.0a14.dist-info}/METADATA +3 -2
- {rapidtide-3.0a12.dist-info → rapidtide-3.0a14.dist-info}/RECORD +69 -64
- {rapidtide-3.0a12.dist-info → rapidtide-3.0a14.dist-info}/WHEEL +1 -1
- {rapidtide-3.0a12.dist-info → rapidtide-3.0a14.dist-info}/entry_points.txt +3 -2
- rapidtide/data/examples/src/testoutputsize +0 -45
- {rapidtide-3.0a12.dist-info → rapidtide-3.0a14.dist-info/licenses}/LICENSE +0 -0
- {rapidtide-3.0a12.dist-info → rapidtide-3.0a14.dist-info}/top_level.txt +0 -0
|
@@ -24,8 +24,8 @@ import numpy as np
|
|
|
24
24
|
|
|
25
25
|
import rapidtide.calcsimfunc as tide_calcsimfunc
|
|
26
26
|
import rapidtide.filter as tide_filt
|
|
27
|
-
import rapidtide.glmpass as tide_glmpass
|
|
28
27
|
import rapidtide.helper_classes as tide_classes
|
|
28
|
+
import rapidtide.linfitfiltpass as tide_linfitfiltpass
|
|
29
29
|
import rapidtide.miscmath as tide_math
|
|
30
30
|
import rapidtide.peakeval as tide_peakeval
|
|
31
31
|
import rapidtide.resample as tide_resample
|
|
@@ -335,7 +335,7 @@ def test_delayestimation(displayplots=False, debug=False):
|
|
|
335
335
|
filteredwaveforms[i, :] = theprefilter.apply(Fs, waveforms[i, :])
|
|
336
336
|
|
|
337
337
|
for nprocs in [4, 1]:
|
|
338
|
-
|
|
338
|
+
voxelsprocessed_regressionfilt = tide_linfitfiltpass.linfitfiltpass(
|
|
339
339
|
numlocs,
|
|
340
340
|
waveforms[:, :],
|
|
341
341
|
threshval,
|
|
@@ -366,7 +366,7 @@ def test_delayestimation(displayplots=False, debug=False):
|
|
|
366
366
|
ax.legend()
|
|
367
367
|
plt.show()
|
|
368
368
|
|
|
369
|
-
print(proctype, "
|
|
369
|
+
print(proctype, "linfitfiltpass", np.mean(diffsignal), np.max(np.fabs(diffsignal)))
|
|
370
370
|
|
|
371
371
|
# clean up shared memory
|
|
372
372
|
tide_util.cleanup_shm(waveforms_shm)
|
|
@@ -23,8 +23,7 @@ import matplotlib.pyplot as plt
|
|
|
23
23
|
import numpy as np
|
|
24
24
|
|
|
25
25
|
from rapidtide.resample import FastResampler, FastResamplerFromFile
|
|
26
|
-
from rapidtide.tests.utils import mse
|
|
27
|
-
from rapidtide.tests.utils import get_test_temp_path
|
|
26
|
+
from rapidtide.tests.utils import get_test_temp_path, mse
|
|
28
27
|
|
|
29
28
|
|
|
30
29
|
def test_FastResampler(debug=False):
|
|
@@ -25,15 +25,23 @@ import rapidtide.workflows.happy_parser as happy_parser
|
|
|
25
25
|
from rapidtide.tests.utils import create_dir, get_examples_path, get_test_temp_path, mse
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def test_fullrunhappy_v1(debug=False, displayplots=False):
|
|
28
|
+
def test_fullrunhappy_v1(debug=False, local=False, displayplots=False):
|
|
29
|
+
# set input and output directories
|
|
30
|
+
if local:
|
|
31
|
+
exampleroot = "../data/examples/src"
|
|
32
|
+
testtemproot = "./tmp"
|
|
33
|
+
else:
|
|
34
|
+
exampleroot = get_examples_path()
|
|
35
|
+
testtemproot = get_test_temp_path()
|
|
36
|
+
|
|
29
37
|
# run happy
|
|
30
38
|
inputargs = [
|
|
31
|
-
os.path.join(
|
|
32
|
-
os.path.join(
|
|
33
|
-
os.path.join(
|
|
39
|
+
os.path.join(exampleroot, "sub-HAPPYTEST.nii.gz"),
|
|
40
|
+
os.path.join(exampleroot, "sub-HAPPYTEST.json"),
|
|
41
|
+
os.path.join(testtemproot, "happyout1"),
|
|
34
42
|
"--mklthreads",
|
|
35
43
|
"-1",
|
|
36
|
-
"--
|
|
44
|
+
"--spatialregression",
|
|
37
45
|
"--model",
|
|
38
46
|
"model_revised",
|
|
39
47
|
]
|
|
@@ -42,4 +50,4 @@ def test_fullrunhappy_v1(debug=False, displayplots=False):
|
|
|
42
50
|
|
|
43
51
|
if __name__ == "__main__":
|
|
44
52
|
mpl.use("TkAgg")
|
|
45
|
-
test_fullrunhappy_v1(debug=True, displayplots=True)
|
|
53
|
+
test_fullrunhappy_v1(debug=True, local=True, displayplots=True)
|
|
@@ -25,25 +25,33 @@ import rapidtide.workflows.happy_parser as happy_parser
|
|
|
25
25
|
from rapidtide.tests.utils import get_examples_path, get_test_temp_path
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def test_fullrunhappy_v2(debug=False, displayplots=False):
|
|
28
|
+
def test_fullrunhappy_v2(debug=False, local=False, displayplots=False):
|
|
29
|
+
# set input and output directories
|
|
30
|
+
if local:
|
|
31
|
+
exampleroot = "../data/examples/src"
|
|
32
|
+
testtemproot = "./tmp"
|
|
33
|
+
else:
|
|
34
|
+
exampleroot = get_examples_path()
|
|
35
|
+
testtemproot = get_test_temp_path()
|
|
36
|
+
|
|
29
37
|
# run happy
|
|
30
38
|
inputargs = [
|
|
31
|
-
os.path.join(
|
|
32
|
-
os.path.join(
|
|
33
|
-
os.path.join(
|
|
39
|
+
os.path.join(exampleroot, "sub-HAPPYTEST.nii.gz"),
|
|
40
|
+
os.path.join(exampleroot, "sub-HAPPYTEST.json"),
|
|
41
|
+
os.path.join(testtemproot, "happyout2"),
|
|
34
42
|
"--estweights",
|
|
35
|
-
os.path.join(
|
|
43
|
+
os.path.join(exampleroot, "sub-HAPPYTEST_smallmask.nii.gz"),
|
|
36
44
|
"--projmask",
|
|
37
|
-
os.path.join(
|
|
45
|
+
os.path.join(exampleroot, "sub-HAPPYTEST_smallmask.nii.gz"),
|
|
38
46
|
"--mklthreads",
|
|
39
47
|
"-1",
|
|
40
48
|
"--model",
|
|
41
49
|
"model_revised",
|
|
42
50
|
"--fliparteries",
|
|
43
|
-
"--
|
|
51
|
+
"--temporalregression",
|
|
44
52
|
"--cardiacfile",
|
|
45
53
|
os.path.join(
|
|
46
|
-
|
|
54
|
+
exampleroot,
|
|
47
55
|
"sub-HAPPYTEST_desc-slicerescardfromfmri_timeseries.json:cardiacfromfmri_dlfiltered",
|
|
48
56
|
),
|
|
49
57
|
"--increaseoutputlevel",
|
|
@@ -54,4 +62,4 @@ def test_fullrunhappy_v2(debug=False, displayplots=False):
|
|
|
54
62
|
|
|
55
63
|
if __name__ == "__main__":
|
|
56
64
|
mpl.use("TkAgg")
|
|
57
|
-
test_fullrunhappy_v2(debug=True, displayplots=True)
|
|
65
|
+
test_fullrunhappy_v2(debug=True, local=True, displayplots=True)
|
|
@@ -25,16 +25,24 @@ import rapidtide.workflows.happy_parser as happy_parser
|
|
|
25
25
|
from rapidtide.tests.utils import get_examples_path, get_test_temp_path
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def test_fullrunhappy_v3(debug=False, displayplots=False):
|
|
28
|
+
def test_fullrunhappy_v3(debug=False, local=False, displayplots=False):
|
|
29
|
+
# set input and output directories
|
|
30
|
+
if local:
|
|
31
|
+
exampleroot = "../data/examples/src"
|
|
32
|
+
testtemproot = "./tmp"
|
|
33
|
+
else:
|
|
34
|
+
exampleroot = get_examples_path()
|
|
35
|
+
testtemproot = get_test_temp_path()
|
|
36
|
+
|
|
29
37
|
# run happy
|
|
30
38
|
inputargs = [
|
|
31
|
-
os.path.join(
|
|
32
|
-
os.path.join(
|
|
33
|
-
os.path.join(
|
|
39
|
+
os.path.join(exampleroot, "sub-HAPPYTEST.nii.gz"),
|
|
40
|
+
os.path.join(exampleroot, "sub-HAPPYTEST.json"),
|
|
41
|
+
os.path.join(testtemproot, "happyout3"),
|
|
34
42
|
"--estweights",
|
|
35
|
-
os.path.join(
|
|
43
|
+
os.path.join(exampleroot, "sub-HAPPYTEST_smallmask.nii.gz"),
|
|
36
44
|
"--projmask",
|
|
37
|
-
os.path.join(
|
|
45
|
+
os.path.join(exampleroot, "sub-HAPPYTEST_smallmask.nii.gz"),
|
|
38
46
|
"--mklthreads",
|
|
39
47
|
"-1",
|
|
40
48
|
"--model",
|
|
@@ -42,10 +50,10 @@ def test_fullrunhappy_v3(debug=False, displayplots=False):
|
|
|
42
50
|
"--cardcalconly",
|
|
43
51
|
]
|
|
44
52
|
# "--motionfile",
|
|
45
|
-
# os.path.join(
|
|
53
|
+
# os.path.join(exampleroot, "sub-HAPPYTEST_mcf.par"),
|
|
46
54
|
happy_workflow.happy_main(happy_parser.process_args(inputargs=inputargs))
|
|
47
55
|
|
|
48
56
|
|
|
49
57
|
if __name__ == "__main__":
|
|
50
58
|
mpl.use("TkAgg")
|
|
51
|
-
test_fullrunhappy_v3(debug=True, displayplots=True)
|
|
59
|
+
test_fullrunhappy_v3(debug=True, local=True, displayplots=True)
|
|
@@ -25,22 +25,30 @@ import rapidtide.workflows.happy_parser as happy_parser
|
|
|
25
25
|
from rapidtide.tests.utils import get_examples_path, get_test_temp_path
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def test_fullrunhappy_v4(debug=False, displayplots=False):
|
|
28
|
+
def test_fullrunhappy_v4(debug=False, local=False, displayplots=False):
|
|
29
|
+
# set input and output directories
|
|
30
|
+
if local:
|
|
31
|
+
exampleroot = "../data/examples/src"
|
|
32
|
+
testtemproot = "./tmp"
|
|
33
|
+
else:
|
|
34
|
+
exampleroot = get_examples_path()
|
|
35
|
+
testtemproot = get_test_temp_path()
|
|
36
|
+
|
|
29
37
|
# run happy
|
|
30
38
|
inputargs = [
|
|
31
|
-
os.path.join(
|
|
32
|
-
os.path.join(
|
|
33
|
-
os.path.join(
|
|
39
|
+
os.path.join(exampleroot, "sub-HAPPYTEST.nii.gz"),
|
|
40
|
+
os.path.join(exampleroot, "sub-HAPPYTEST.json"),
|
|
41
|
+
os.path.join(testtemproot, "happyout4"),
|
|
34
42
|
"--estweights",
|
|
35
|
-
os.path.join(
|
|
43
|
+
os.path.join(exampleroot, "sub-HAPPYTEST_smallmask.nii.gz"),
|
|
36
44
|
"--projmask",
|
|
37
|
-
os.path.join(
|
|
45
|
+
os.path.join(exampleroot, "sub-HAPPYTEST_smallmask.nii.gz"),
|
|
38
46
|
"--mklthreads",
|
|
39
47
|
"-1",
|
|
40
48
|
"--model",
|
|
41
49
|
"model_revised",
|
|
42
50
|
"--motionfile",
|
|
43
|
-
os.path.join(
|
|
51
|
+
os.path.join(exampleroot, "sub-HAPPYTEST_mcf.par"),
|
|
44
52
|
"--aliasedcorrelation",
|
|
45
53
|
]
|
|
46
54
|
happy_workflow.happy_main(happy_parser.process_args(inputargs=inputargs))
|
|
@@ -48,4 +56,4 @@ def test_fullrunhappy_v4(debug=False, displayplots=False):
|
|
|
48
56
|
|
|
49
57
|
if __name__ == "__main__":
|
|
50
58
|
mpl.use("TkAgg")
|
|
51
|
-
test_fullrunhappy_v4(debug=True, displayplots=True)
|
|
59
|
+
test_fullrunhappy_v4(debug=True, local=True, displayplots=True)
|
|
@@ -25,16 +25,24 @@ import rapidtide.workflows.happy_parser as happy_parser
|
|
|
25
25
|
from rapidtide.tests.utils import get_examples_path, get_test_temp_path
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def test_fullrunhappy_v4(debug=False, displayplots=False):
|
|
28
|
+
def test_fullrunhappy_v4(debug=False, local=False, displayplots=False):
|
|
29
|
+
# set input and output directories
|
|
30
|
+
if local:
|
|
31
|
+
exampleroot = "../data/examples/src"
|
|
32
|
+
testtemproot = "./tmp"
|
|
33
|
+
else:
|
|
34
|
+
exampleroot = get_examples_path()
|
|
35
|
+
testtemproot = get_test_temp_path()
|
|
36
|
+
|
|
29
37
|
# run happy
|
|
30
38
|
inputargs = [
|
|
31
|
-
os.path.join(
|
|
32
|
-
os.path.join(
|
|
33
|
-
os.path.join(
|
|
39
|
+
os.path.join(exampleroot, "sub-HAPPYTEST.nii.gz"),
|
|
40
|
+
os.path.join(exampleroot, "sub-HAPPYTEST.json"),
|
|
41
|
+
os.path.join(testtemproot, "happyout5"),
|
|
34
42
|
"--model",
|
|
35
43
|
"model_revised",
|
|
36
44
|
"--motionfile",
|
|
37
|
-
os.path.join(
|
|
45
|
+
os.path.join(exampleroot, "sub-HAPPYTEST_mcf.par"),
|
|
38
46
|
"--nomotderiv",
|
|
39
47
|
"--nomotorthogonalize",
|
|
40
48
|
"--motfiltorder",
|
|
@@ -53,4 +61,4 @@ def test_fullrunhappy_v4(debug=False, displayplots=False):
|
|
|
53
61
|
|
|
54
62
|
if __name__ == "__main__":
|
|
55
63
|
mpl.use("TkAgg")
|
|
56
|
-
test_fullrunhappy_v4(debug=True, displayplots=True)
|
|
64
|
+
test_fullrunhappy_v4(debug=True, local=True, displayplots=True)
|
|
@@ -26,11 +26,19 @@ import rapidtide.workflows.rapidtide_parser as rapidtide_parser
|
|
|
26
26
|
from rapidtide.tests.utils import get_examples_path, get_test_temp_path
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
def test_fullrunrapidtide_v1(debug=False, displayplots=False):
|
|
29
|
+
def test_fullrunrapidtide_v1(debug=False, local=False, displayplots=False):
|
|
30
|
+
# set input and output directories
|
|
31
|
+
if local:
|
|
32
|
+
exampleroot = "../data/examples/src"
|
|
33
|
+
testtemproot = "./tmp"
|
|
34
|
+
else:
|
|
35
|
+
exampleroot = get_examples_path()
|
|
36
|
+
testtemproot = get_test_temp_path()
|
|
37
|
+
|
|
30
38
|
# run rapidtide
|
|
31
39
|
inputargs = [
|
|
32
|
-
os.path.join(
|
|
33
|
-
os.path.join(
|
|
40
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST.nii.gz"),
|
|
41
|
+
os.path.join(testtemproot, "sub-RAPIDTIDETEST1"),
|
|
34
42
|
"--spatialfilt",
|
|
35
43
|
"2",
|
|
36
44
|
"--simcalcrange",
|
|
@@ -46,11 +54,11 @@ def test_fullrunrapidtide_v1(debug=False, displayplots=False):
|
|
|
46
54
|
"4.0",
|
|
47
55
|
]
|
|
48
56
|
rapidtide_workflow.rapidtide_main(rapidtide_parser.process_args(inputargs=inputargs))
|
|
49
|
-
rapidtide_quality.qualitycheck(os.path.join(
|
|
57
|
+
rapidtide_quality.qualitycheck(os.path.join(testtemproot, "sub-RAPIDTIDETEST1"))
|
|
50
58
|
|
|
51
59
|
inputargs = [
|
|
52
|
-
os.path.join(
|
|
53
|
-
os.path.join(
|
|
60
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST.nii.gz"),
|
|
61
|
+
os.path.join(testtemproot, "sub-RAPIDTIDETEST1_fixval"),
|
|
54
62
|
"--spatialfilt",
|
|
55
63
|
"2",
|
|
56
64
|
"--simcalcrange",
|
|
@@ -62,7 +70,7 @@ def test_fullrunrapidtide_v1(debug=False, displayplots=False):
|
|
|
62
70
|
"1",
|
|
63
71
|
"--despecklepasses",
|
|
64
72
|
"3",
|
|
65
|
-
"--
|
|
73
|
+
"--nodenoise",
|
|
66
74
|
"--norefinedelay",
|
|
67
75
|
"--initialdelay",
|
|
68
76
|
"0.0",
|
|
@@ -70,8 +78,8 @@ def test_fullrunrapidtide_v1(debug=False, displayplots=False):
|
|
|
70
78
|
rapidtide_workflow.rapidtide_main(rapidtide_parser.process_args(inputargs=inputargs))
|
|
71
79
|
|
|
72
80
|
inputargs = [
|
|
73
|
-
os.path.join(
|
|
74
|
-
os.path.join(
|
|
81
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST.nii.gz"),
|
|
82
|
+
os.path.join(testtemproot, "sub-RAPIDTIDETEST1_fixmap"),
|
|
75
83
|
"--spatialfilt",
|
|
76
84
|
"2",
|
|
77
85
|
"--simcalcrange",
|
|
@@ -83,13 +91,13 @@ def test_fullrunrapidtide_v1(debug=False, displayplots=False):
|
|
|
83
91
|
"1",
|
|
84
92
|
"--despecklepasses",
|
|
85
93
|
"3",
|
|
86
|
-
"--
|
|
94
|
+
"--nodenoise",
|
|
87
95
|
"--initialdelay",
|
|
88
|
-
os.path.join(
|
|
96
|
+
os.path.join(testtemproot, "sub-RAPIDTIDETEST1_desc-maxtime_map.nii.gz"),
|
|
89
97
|
]
|
|
90
98
|
rapidtide_workflow.rapidtide_main(rapidtide_parser.process_args(inputargs=inputargs))
|
|
91
99
|
|
|
92
100
|
|
|
93
101
|
if __name__ == "__main__":
|
|
94
102
|
mpl.use("TkAgg")
|
|
95
|
-
test_fullrunrapidtide_v1(debug=True, displayplots=True)
|
|
103
|
+
test_fullrunrapidtide_v1(debug=True, local=True, displayplots=True)
|
|
@@ -25,27 +25,35 @@ import rapidtide.workflows.rapidtide_parser as rapidtide_parser
|
|
|
25
25
|
from rapidtide.tests.utils import get_examples_path, get_test_temp_path
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def test_fullrunrapidtide_v2(debug=False, displayplots=False):
|
|
28
|
+
def test_fullrunrapidtide_v2(debug=False, local=False, displayplots=False):
|
|
29
|
+
# set input and output directories
|
|
30
|
+
if local:
|
|
31
|
+
exampleroot = "../data/examples/src"
|
|
32
|
+
testtemproot = "./tmp"
|
|
33
|
+
else:
|
|
34
|
+
exampleroot = get_examples_path()
|
|
35
|
+
testtemproot = get_test_temp_path()
|
|
36
|
+
|
|
29
37
|
# run rapidtide
|
|
30
38
|
inputargs = [
|
|
31
|
-
os.path.join(
|
|
32
|
-
os.path.join(
|
|
39
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST.nii.gz"),
|
|
40
|
+
os.path.join(testtemproot, "sub-RAPIDTIDETEST2"),
|
|
33
41
|
"--tincludemask",
|
|
34
|
-
os.path.join(
|
|
42
|
+
os.path.join(exampleroot, "tmask3.txt"),
|
|
35
43
|
"--corrmask",
|
|
36
|
-
os.path.join(
|
|
44
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST_restrictedmask.nii.gz"),
|
|
37
45
|
"--globalmeaninclude",
|
|
38
|
-
os.path.join(
|
|
46
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST_brainmask.nii.gz"),
|
|
39
47
|
"--globalmeanexclude",
|
|
40
|
-
os.path.join(
|
|
48
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST_nullmask.nii.gz"),
|
|
41
49
|
"--refineinclude",
|
|
42
|
-
os.path.join(
|
|
50
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST_brainmask.nii.gz"),
|
|
43
51
|
"--refineexclude",
|
|
44
|
-
os.path.join(
|
|
52
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST_nullmask.nii.gz"),
|
|
45
53
|
"--offsetinclude",
|
|
46
|
-
os.path.join(
|
|
54
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST_brainmask.nii.gz"),
|
|
47
55
|
"--offsetexclude",
|
|
48
|
-
os.path.join(
|
|
56
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST_nullmask.nii.gz"),
|
|
49
57
|
"--spatialfilt",
|
|
50
58
|
"-1",
|
|
51
59
|
"--savelags",
|
|
@@ -74,7 +82,7 @@ def test_fullrunrapidtide_v2(debug=False, displayplots=False):
|
|
|
74
82
|
"--refineprenorm",
|
|
75
83
|
"var",
|
|
76
84
|
"--motionfile",
|
|
77
|
-
os.path.join(
|
|
85
|
+
os.path.join(exampleroot, "fakemotion.par"),
|
|
78
86
|
]
|
|
79
87
|
if debug:
|
|
80
88
|
print(inputargs)
|
|
@@ -83,4 +91,4 @@ def test_fullrunrapidtide_v2(debug=False, displayplots=False):
|
|
|
83
91
|
|
|
84
92
|
if __name__ == "__main__":
|
|
85
93
|
mpl.use("TkAgg")
|
|
86
|
-
test_fullrunrapidtide_v2(debug=True, displayplots=True)
|
|
94
|
+
test_fullrunrapidtide_v2(debug=True, local=True, displayplots=True)
|
|
@@ -25,13 +25,21 @@ import rapidtide.workflows.rapidtide_parser as rapidtide_parser
|
|
|
25
25
|
from rapidtide.tests.utils import get_examples_path, get_test_temp_path
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def test_fullrunrapidtide_v3(debug=False, displayplots=False):
|
|
28
|
+
def test_fullrunrapidtide_v3(debug=False, local=False, displayplots=False):
|
|
29
|
+
# set input and output directories
|
|
30
|
+
if local:
|
|
31
|
+
exampleroot = "../data/examples/src"
|
|
32
|
+
testtemproot = "./tmp"
|
|
33
|
+
else:
|
|
34
|
+
exampleroot = get_examples_path()
|
|
35
|
+
testtemproot = get_test_temp_path()
|
|
36
|
+
|
|
29
37
|
# run rapidtide
|
|
30
38
|
inputargs = [
|
|
31
|
-
os.path.join(
|
|
32
|
-
os.path.join(
|
|
39
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST.nii.gz"),
|
|
40
|
+
os.path.join(testtemproot, "sub-RAPIDTIDETEST3"),
|
|
33
41
|
"--corrmask",
|
|
34
|
-
os.path.join(
|
|
42
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST_restrictedmask.nii.gz:1"),
|
|
35
43
|
"--maxpasses",
|
|
36
44
|
"2",
|
|
37
45
|
"--numnull",
|
|
@@ -40,7 +48,7 @@ def test_fullrunrapidtide_v3(debug=False, displayplots=False):
|
|
|
40
48
|
"pca",
|
|
41
49
|
"--convergencethresh",
|
|
42
50
|
"0.5",
|
|
43
|
-
"--
|
|
51
|
+
"--nodenoise",
|
|
44
52
|
"--nprocs",
|
|
45
53
|
"-1",
|
|
46
54
|
"--similaritymetric",
|
|
@@ -60,7 +68,7 @@ def test_fullrunrapidtide_v3(debug=False, displayplots=False):
|
|
|
60
68
|
"R",
|
|
61
69
|
"--regressor",
|
|
62
70
|
os.path.join(
|
|
63
|
-
|
|
71
|
+
exampleroot,
|
|
64
72
|
"sub-RAPIDTIDETEST_desc-oversampledmovingregressor_timeseries.json:pass3",
|
|
65
73
|
),
|
|
66
74
|
]
|
|
@@ -71,4 +79,4 @@ def test_fullrunrapidtide_v3(debug=False, displayplots=False):
|
|
|
71
79
|
|
|
72
80
|
if __name__ == "__main__":
|
|
73
81
|
mpl.use("TkAgg")
|
|
74
|
-
test_fullrunrapidtide_v3(debug=True, displayplots=True)
|
|
82
|
+
test_fullrunrapidtide_v3(debug=True, local=True, displayplots=True)
|
|
@@ -25,18 +25,25 @@ import rapidtide.workflows.rapidtide_parser as rapidtide_parser
|
|
|
25
25
|
from rapidtide.tests.utils import get_examples_path, get_test_temp_path
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def test_fullrunrapidtide_v4(debug=False, displayplots=False):
|
|
28
|
+
def test_fullrunrapidtide_v4(debug=False, local=False, displayplots=False):
|
|
29
|
+
# set input and output directories
|
|
30
|
+
if local:
|
|
31
|
+
exampleroot = "../data/examples/src"
|
|
32
|
+
testtemproot = "./tmp"
|
|
33
|
+
else:
|
|
34
|
+
exampleroot = get_examples_path()
|
|
35
|
+
testtemproot = get_test_temp_path()
|
|
36
|
+
|
|
29
37
|
# run rapidtide
|
|
30
38
|
inputargs = [
|
|
31
|
-
os.path.join(
|
|
32
|
-
os.path.join(
|
|
39
|
+
os.path.join(exampleroot, "sub-NIRSRAPIDTIDETEST.txt"),
|
|
40
|
+
os.path.join(testtemproot, "sub-NIRSRAPIDTIDETEST4"),
|
|
33
41
|
"--globalmeaninclude",
|
|
34
|
-
os.path.join(
|
|
42
|
+
os.path.join(exampleroot, "sub-NIRSRAPIDTIDETEST_mask.txt"),
|
|
35
43
|
"--nirs",
|
|
36
44
|
"--datatstep",
|
|
37
45
|
"0.2560",
|
|
38
|
-
"--
|
|
39
|
-
"variance",
|
|
46
|
+
"--dataiszeromean",
|
|
40
47
|
"--norefinedelay",
|
|
41
48
|
"--despecklepasses",
|
|
42
49
|
"0",
|
|
@@ -59,4 +66,4 @@ def test_fullrunrapidtide_v4(debug=False, displayplots=False):
|
|
|
59
66
|
|
|
60
67
|
if __name__ == "__main__":
|
|
61
68
|
mpl.use("TkAgg")
|
|
62
|
-
test_fullrunrapidtide_v4(debug=True, displayplots=True)
|
|
69
|
+
test_fullrunrapidtide_v4(debug=True, local=True, displayplots=True)
|
|
@@ -25,17 +25,25 @@ import rapidtide.workflows.rapidtide_parser as rapidtide_parser
|
|
|
25
25
|
from rapidtide.tests.utils import get_examples_path, get_test_temp_path
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def test_fullrunrapidtide_v5(debug=False, displayplots=False):
|
|
28
|
+
def test_fullrunrapidtide_v5(debug=False, local=False, displayplots=False):
|
|
29
|
+
# set input and output directories
|
|
30
|
+
if local:
|
|
31
|
+
exampleroot = "../data/examples/src"
|
|
32
|
+
testtemproot = "./tmp"
|
|
33
|
+
else:
|
|
34
|
+
exampleroot = get_examples_path()
|
|
35
|
+
testtemproot = get_test_temp_path()
|
|
36
|
+
|
|
29
37
|
# run rapidtide
|
|
30
38
|
inputargs = [
|
|
31
|
-
os.path.join(
|
|
32
|
-
os.path.join(
|
|
39
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST_cifti.ptseries.nii"),
|
|
40
|
+
os.path.join(testtemproot, "sub-RAPIDTIDETEST5"),
|
|
33
41
|
"--nprocs",
|
|
34
42
|
"-1",
|
|
35
43
|
"--passes",
|
|
36
44
|
"2",
|
|
37
45
|
"--numnull",
|
|
38
|
-
"
|
|
46
|
+
"10000",
|
|
39
47
|
"--pickleft",
|
|
40
48
|
"--norefinedelay",
|
|
41
49
|
"--refineprenorm",
|
|
@@ -46,4 +54,4 @@ def test_fullrunrapidtide_v5(debug=False, displayplots=False):
|
|
|
46
54
|
|
|
47
55
|
if __name__ == "__main__":
|
|
48
56
|
mpl.use("TkAgg")
|
|
49
|
-
test_fullrunrapidtide_v5(debug=True, displayplots=True)
|
|
57
|
+
test_fullrunrapidtide_v5(debug=True, local=True, displayplots=True)
|
|
@@ -24,15 +24,23 @@ import matplotlib as mpl
|
|
|
24
24
|
import rapidtide.io as tide_io
|
|
25
25
|
import rapidtide.workflows.rapidtide as rapidtide_workflow
|
|
26
26
|
import rapidtide.workflows.rapidtide_parser as rapidtide_parser
|
|
27
|
-
import rapidtide.workflows.
|
|
27
|
+
import rapidtide.workflows.retroregress as rapidtide_retroregress
|
|
28
28
|
from rapidtide.tests.utils import get_examples_path, get_test_temp_path
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
def test_fullrunrapidtide_v6(debug=False, displayplots=False):
|
|
31
|
+
def test_fullrunrapidtide_v6(debug=False, local=False, displayplots=False):
|
|
32
|
+
# set input and output directories
|
|
33
|
+
if local:
|
|
34
|
+
exampleroot = "../data/examples/src"
|
|
35
|
+
testtemproot = "./tmp"
|
|
36
|
+
else:
|
|
37
|
+
exampleroot = get_examples_path()
|
|
38
|
+
testtemproot = get_test_temp_path()
|
|
39
|
+
|
|
32
40
|
# run rapidtide
|
|
33
41
|
inputargs = [
|
|
34
|
-
os.path.join(
|
|
35
|
-
os.path.join(
|
|
42
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST.nii.gz"),
|
|
43
|
+
os.path.join(testtemproot, "sub-RAPIDTIDETEST6"),
|
|
36
44
|
"--spatialfilt",
|
|
37
45
|
"2",
|
|
38
46
|
"--simcalcrange",
|
|
@@ -44,7 +52,7 @@ def test_fullrunrapidtide_v6(debug=False, displayplots=False):
|
|
|
44
52
|
"1",
|
|
45
53
|
"--despecklepasses",
|
|
46
54
|
"3",
|
|
47
|
-
"--
|
|
55
|
+
"--regressderivs",
|
|
48
56
|
"0",
|
|
49
57
|
"--delaypatchthresh",
|
|
50
58
|
"4.0",
|
|
@@ -54,59 +62,59 @@ def test_fullrunrapidtide_v6(debug=False, displayplots=False):
|
|
|
54
62
|
rapidtide_workflow.rapidtide_main(rapidtide_parser.process_args(inputargs=inputargs))
|
|
55
63
|
|
|
56
64
|
inputargs = [
|
|
57
|
-
os.path.join(
|
|
58
|
-
os.path.join(
|
|
65
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST.nii.gz"),
|
|
66
|
+
os.path.join(testtemproot, "sub-RAPIDTIDETEST6"),
|
|
59
67
|
"--alternateoutput",
|
|
60
|
-
os.path.join(
|
|
68
|
+
os.path.join(testtemproot, "2deriv"),
|
|
61
69
|
"--nprocs",
|
|
62
70
|
"-1",
|
|
63
|
-
"--
|
|
71
|
+
"--regressderivs",
|
|
64
72
|
"2",
|
|
65
73
|
"--makepseudofile",
|
|
66
74
|
"--outputlevel",
|
|
67
75
|
"max",
|
|
68
76
|
]
|
|
69
|
-
|
|
77
|
+
rapidtide_retroregress.retroregress(rapidtide_retroregress.process_args(inputargs=inputargs))
|
|
70
78
|
|
|
71
79
|
inputargs = [
|
|
72
|
-
os.path.join(
|
|
73
|
-
os.path.join(
|
|
80
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST.nii.gz"),
|
|
81
|
+
os.path.join(testtemproot, "sub-RAPIDTIDETEST6"),
|
|
74
82
|
"--alternateoutput",
|
|
75
|
-
os.path.join(
|
|
83
|
+
os.path.join(testtemproot, "1deriv_refined_corrected"),
|
|
76
84
|
"--nprocs",
|
|
77
85
|
"1",
|
|
78
|
-
"--
|
|
86
|
+
"--regressderivs",
|
|
79
87
|
"1",
|
|
80
88
|
"--makepseudofile",
|
|
81
89
|
"--outputlevel",
|
|
82
90
|
"max",
|
|
83
91
|
"--nofilterwithrefineddelay",
|
|
84
92
|
]
|
|
85
|
-
|
|
93
|
+
rapidtide_retroregress.retroregress(rapidtide_retroregress.process_args(inputargs=inputargs))
|
|
86
94
|
|
|
87
95
|
inputargs = [
|
|
88
|
-
os.path.join(
|
|
89
|
-
os.path.join(
|
|
96
|
+
os.path.join(exampleroot, "sub-RAPIDTIDETEST.nii.gz"),
|
|
97
|
+
os.path.join(testtemproot, "sub-RAPIDTIDETEST6"),
|
|
90
98
|
"--alternateoutput",
|
|
91
|
-
os.path.join(
|
|
99
|
+
os.path.join(testtemproot, "concordance"),
|
|
92
100
|
"--nprocs",
|
|
93
101
|
"-1",
|
|
94
|
-
"--
|
|
102
|
+
"--regressderivs",
|
|
95
103
|
"0",
|
|
96
104
|
"--delaypatchthresh",
|
|
97
105
|
"4.0",
|
|
98
106
|
"--outputlevel",
|
|
99
107
|
"max",
|
|
100
108
|
]
|
|
101
|
-
|
|
109
|
+
rapidtide_retroregress.retroregress(rapidtide_retroregress.process_args(inputargs=inputargs))
|
|
102
110
|
|
|
103
111
|
absthresh = 1e-10
|
|
104
112
|
msethresh = 1e-12
|
|
105
113
|
spacetolerance = 1e-3
|
|
106
114
|
for map in [
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
115
|
+
"regressderivratios",
|
|
116
|
+
"medfiltregressderivratios",
|
|
117
|
+
"filteredregressderivratios",
|
|
110
118
|
"maxtimerefined",
|
|
111
119
|
"lfofilterInbandVarianceBefore",
|
|
112
120
|
"lfofilterInbandVarianceAfter",
|
|
@@ -118,8 +126,8 @@ def test_fullrunrapidtide_v6(debug=False, displayplots=False):
|
|
|
118
126
|
"lfofilterR",
|
|
119
127
|
]:
|
|
120
128
|
print(f"Testing map={map}")
|
|
121
|
-
filename1 = os.path.join(
|
|
122
|
-
filename2 = os.path.join(
|
|
129
|
+
filename1 = os.path.join(testtemproot, f"sub-RAPIDTIDETEST6_desc-{map}_map.nii.gz")
|
|
130
|
+
filename2 = os.path.join(testtemproot, f"concordance_desc-{map}_map.nii.gz")
|
|
123
131
|
assert tide_io.checkniftifilematch(
|
|
124
132
|
filename1,
|
|
125
133
|
filename2,
|
|
@@ -132,4 +140,4 @@ def test_fullrunrapidtide_v6(debug=False, displayplots=False):
|
|
|
132
140
|
|
|
133
141
|
if __name__ == "__main__":
|
|
134
142
|
mpl.use("TkAgg")
|
|
135
|
-
test_fullrunrapidtide_v6(debug=True, displayplots=True)
|
|
143
|
+
test_fullrunrapidtide_v6(debug=True, local=True, displayplots=True)
|