rapidtide 3.0a13__py3-none-any.whl → 3.0a15__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 +1 -1
- rapidtide/DerivativeDelay.py +4 -2
- rapidtide/OrthoImageItem.py +1 -1
- rapidtide/RapidtideDataset.py +3 -1
- rapidtide/RegressorRefiner.py +1 -1
- rapidtide/calcandfitcorrpairs.py +1 -1
- rapidtide/calccoherence.py +1 -1
- rapidtide/calcnullsimfunc.py +1 -1
- rapidtide/calcsimfunc.py +1 -1
- rapidtide/correlate.py +1 -1
- rapidtide/data/examples/src/test_findmaxlag.py +1 -1
- rapidtide/data/examples/src/testdelayvar +2 -1
- rapidtide/data/examples/src/testfmri +3 -2
- rapidtide/data/examples/src/testfuncs +1 -1
- rapidtide/data/examples/src/testhappy +12 -1
- rapidtide/data/examples/src/testmodels +33 -0
- rapidtide/data/models/model_cnn_w064_l13_fn20_fl08/loss.png +0 -0
- rapidtide/data/models/model_cnn_w064_l13_fn20_fl08/loss.txt +1 -0
- rapidtide/data/models/model_cnn_w064_l13_fn20_fl08/model.keras +0 -0
- rapidtide/data/models/model_cnn_w064_l13_fn20_fl08/model_meta.json +167 -0
- rapidtide/data/models/model_revised_tf2/model.keras +0 -0
- rapidtide/data/models/{model_serdar → model_revised_tf2}/model_meta.json +1 -1
- rapidtide/data/models/model_serdar2_tf2/model.keras +0 -0
- rapidtide/data/models/{model_serdar2 → model_serdar2_tf2}/model_meta.json +1 -1
- rapidtide/data/models/model_serdar_tf2/model.keras +0 -0
- rapidtide/data/models/{model_revised → model_serdar_tf2}/model_meta.json +1 -1
- rapidtide/dlfilter.py +325 -241
- rapidtide/externaltools.py +1 -1
- rapidtide/fMRIData_class.py +1 -1
- rapidtide/filter.py +1 -8
- rapidtide/fit.py +1 -8
- rapidtide/happy_supportfuncs.py +30 -1
- rapidtide/helper_classes.py +1 -1
- rapidtide/io.py +1 -1
- rapidtide/linfitfiltpass.py +3 -1
- rapidtide/makelaggedtcs.py +9 -6
- rapidtide/maskutil.py +1 -1
- rapidtide/miscmath.py +1 -8
- rapidtide/multiproc.py +9 -12
- rapidtide/patchmatch.py +1 -1
- rapidtide/peakeval.py +1 -1
- rapidtide/qualitycheck.py +1 -1
- rapidtide/refinedelay.py +174 -89
- rapidtide/refineregressor.py +1 -1
- rapidtide/resample.py +1 -1
- rapidtide/scripts/adjustoffset.py +1 -1
- rapidtide/scripts/aligntcs.py +1 -1
- rapidtide/scripts/applydlfilter.py +1 -1
- rapidtide/scripts/atlasaverage.py +1 -1
- rapidtide/scripts/atlastool.py +1 -1
- rapidtide/scripts/calcicc.py +1 -1
- rapidtide/scripts/calctexticc.py +1 -1
- rapidtide/scripts/calcttest.py +1 -1
- rapidtide/scripts/ccorrica.py +1 -1
- rapidtide/scripts/delayvar.py +2 -2
- rapidtide/scripts/diffrois.py +1 -1
- rapidtide/scripts/endtidalproc.py +1 -1
- rapidtide/scripts/fdica.py +1 -1
- rapidtide/scripts/filtnifti.py +1 -1
- rapidtide/scripts/filttc.py +1 -1
- rapidtide/scripts/fingerprint.py +1 -1
- rapidtide/scripts/fixtr.py +1 -1
- rapidtide/scripts/gmscalc.py +1 -1
- rapidtide/scripts/happy.py +1 -1
- rapidtide/scripts/happy2std.py +1 -1
- rapidtide/scripts/happywarp.py +1 -1
- rapidtide/scripts/histnifti.py +1 -1
- rapidtide/scripts/histtc.py +1 -1
- rapidtide/scripts/linfitfilt.py +1 -1
- rapidtide/scripts/localflow.py +1 -1
- rapidtide/scripts/mergequality.py +1 -1
- rapidtide/scripts/pairproc.py +1 -1
- rapidtide/scripts/pairwisemergenifti.py +1 -1
- rapidtide/scripts/physiofreq.py +1 -1
- rapidtide/scripts/pixelcomp.py +1 -1
- rapidtide/scripts/plethquality.py +1 -1
- rapidtide/scripts/polyfitim.py +1 -1
- rapidtide/scripts/proj2flow.py +1 -1
- rapidtide/scripts/rankimage.py +1 -1
- rapidtide/scripts/rapidtide.py +1 -1
- rapidtide/scripts/rapidtide2std.py +1 -1
- rapidtide/scripts/resamplenifti.py +1 -1
- rapidtide/scripts/resampletc.py +1 -1
- rapidtide/scripts/retrolagtcs.py +1 -1
- rapidtide/scripts/retroregress.py +1 -1
- rapidtide/scripts/roisummarize.py +1 -1
- rapidtide/scripts/runqualitycheck.py +1 -1
- rapidtide/scripts/showarbcorr.py +1 -1
- rapidtide/scripts/showhist.py +1 -1
- rapidtide/scripts/showstxcorr.py +1 -1
- rapidtide/scripts/showtc.py +1 -1
- rapidtide/scripts/showxcorr_legacy.py +1 -1
- rapidtide/scripts/showxcorrx.py +1 -1
- rapidtide/scripts/showxy.py +1 -1
- rapidtide/scripts/simdata.py +1 -1
- rapidtide/scripts/spatialdecomp.py +1 -1
- rapidtide/scripts/spatialfit.py +1 -1
- rapidtide/scripts/spatialmi.py +1 -1
- rapidtide/scripts/spectrogram.py +1 -1
- rapidtide/scripts/stupidramtricks.py +1 -1
- rapidtide/scripts/synthASL.py +1 -1
- rapidtide/scripts/tcfrom2col.py +1 -1
- rapidtide/scripts/tcfrom3col.py +1 -1
- rapidtide/scripts/temporaldecomp.py +1 -1
- rapidtide/scripts/testhrv.py +1 -1
- rapidtide/scripts/threeD.py +1 -1
- rapidtide/scripts/tidepool.py +1 -1
- rapidtide/scripts/variabilityizer.py +1 -1
- rapidtide/simfuncfit.py +1 -1
- rapidtide/stats.py +1 -8
- rapidtide/tests/cleanposttest +1 -1
- rapidtide/tests/resethappytargets +1 -1
- rapidtide/tests/resetrapidtidetargets +1 -1
- rapidtide/tests/resettargets +1 -1
- rapidtide/tests/runlocaltest +1 -1
- rapidtide/tests/showkernels +1 -1
- rapidtide/tests/test_aliasedcorrelate.py +1 -1
- rapidtide/tests/test_aligntcs.py +1 -1
- rapidtide/tests/test_calcicc.py +1 -1
- rapidtide/tests/test_congrid.py +1 -1
- rapidtide/tests/test_correlate.py +1 -1
- rapidtide/tests/test_corrpass.py +1 -1
- rapidtide/tests/test_delayestimation.py +1 -1
- rapidtide/tests/test_doresample.py +1 -1
- rapidtide/tests/test_fastresampler.py +1 -1
- rapidtide/tests/test_findmaxlag.py +1 -1
- rapidtide/tests/test_fullrunhappy_v1.py +15 -7
- rapidtide/tests/test_fullrunhappy_v2.py +18 -10
- rapidtide/tests/test_fullrunhappy_v3.py +18 -10
- rapidtide/tests/test_fullrunhappy_v4.py +18 -10
- rapidtide/tests/test_fullrunhappy_v5.py +15 -9
- rapidtide/tests/test_fullrunrapidtide_v1.py +19 -11
- rapidtide/tests/test_fullrunrapidtide_v2.py +24 -14
- rapidtide/tests/test_fullrunrapidtide_v3.py +15 -7
- rapidtide/tests/test_fullrunrapidtide_v4.py +15 -8
- rapidtide/tests/test_fullrunrapidtide_v5.py +13 -5
- rapidtide/tests/test_fullrunrapidtide_v6.py +24 -16
- rapidtide/tests/test_io.py +1 -1
- rapidtide/tests/test_linfitfiltpass.py +1 -1
- rapidtide/tests/test_mi.py +1 -1
- rapidtide/tests/test_miscmath.py +1 -1
- rapidtide/tests/test_motionregress.py +1 -1
- rapidtide/tests/test_nullcorr.py +1 -1
- rapidtide/tests/test_padvec.py +1 -1
- rapidtide/tests/test_phaseanalysis.py +1 -1
- rapidtide/tests/test_rapidtideparser.py +1 -1
- rapidtide/tests/test_refinedelay.py +4 -3
- rapidtide/tests/test_runmisc.py +1 -1
- rapidtide/tests/test_sharedmem.py +1 -1
- rapidtide/tests/test_simulate.py +1 -1
- rapidtide/tests/test_stcorrelate.py +1 -1
- rapidtide/tests/test_timeshift.py +1 -1
- rapidtide/tests/test_valtoindex.py +1 -1
- rapidtide/tests/test_zRapidtideDataset.py +1 -1
- rapidtide/tests/utils.py +1 -1
- rapidtide/transformerdlfilter.py +2 -4
- rapidtide/util.py +37 -14
- rapidtide/voxelData.py +278 -0
- rapidtide/wiener.py +1 -1
- rapidtide/wiener2.py +1 -1
- rapidtide/workflows/adjustoffset.py +1 -1
- rapidtide/workflows/aligntcs.py +1 -1
- rapidtide/workflows/applydlfilter.py +20 -65
- rapidtide/workflows/atlasaverage.py +41 -13
- rapidtide/workflows/atlastool.py +1 -1
- rapidtide/workflows/calctexticc.py +1 -1
- rapidtide/workflows/ccorrica.py +1 -1
- rapidtide/workflows/cleanregressor.py +243 -0
- rapidtide/workflows/delayestimation.py +488 -0
- rapidtide/workflows/delayvar.py +122 -34
- rapidtide/workflows/diffrois.py +1 -1
- rapidtide/workflows/endtidalproc.py +1 -1
- rapidtide/workflows/fdica.py +1 -1
- rapidtide/workflows/filtnifti.py +1 -1
- rapidtide/workflows/filttc.py +1 -1
- rapidtide/workflows/fixtr.py +1 -1
- rapidtide/workflows/gmscalc.py +1 -1
- rapidtide/workflows/happy.py +49 -3
- rapidtide/workflows/happy2std.py +1 -1
- rapidtide/workflows/happy_parser.py +30 -6
- rapidtide/workflows/histnifti.py +1 -1
- rapidtide/workflows/histtc.py +1 -1
- rapidtide/workflows/linfitfilt.py +1 -1
- rapidtide/workflows/localflow.py +1 -1
- rapidtide/workflows/mergequality.py +1 -1
- rapidtide/workflows/niftidecomp.py +1 -1
- rapidtide/workflows/niftistats.py +1 -1
- rapidtide/workflows/pairproc.py +1 -1
- rapidtide/workflows/pairwisemergenifti.py +1 -1
- rapidtide/workflows/parser_funcs.py +1 -1
- rapidtide/workflows/physiofreq.py +1 -1
- rapidtide/workflows/pixelcomp.py +1 -1
- rapidtide/workflows/plethquality.py +1 -1
- rapidtide/workflows/polyfitim.py +1 -1
- rapidtide/workflows/proj2flow.py +1 -1
- rapidtide/workflows/rankimage.py +1 -1
- rapidtide/workflows/rapidtide.py +174 -686
- rapidtide/workflows/rapidtide2std.py +1 -1
- rapidtide/workflows/rapidtide_parser.py +14 -113
- rapidtide/workflows/regressfrommaps.py +6 -48
- rapidtide/workflows/resamplenifti.py +1 -1
- rapidtide/workflows/resampletc.py +1 -1
- rapidtide/workflows/retrolagtcs.py +2 -1
- rapidtide/workflows/retroregress.py +26 -2
- rapidtide/workflows/roisummarize.py +1 -1
- rapidtide/workflows/runqualitycheck.py +1 -1
- rapidtide/workflows/showarbcorr.py +1 -1
- rapidtide/workflows/showhist.py +1 -1
- rapidtide/workflows/showstxcorr.py +1 -1
- rapidtide/workflows/showtc.py +1 -1
- rapidtide/workflows/showxcorrx.py +1 -1
- rapidtide/workflows/showxy.py +1 -1
- rapidtide/workflows/simdata.py +1 -1
- rapidtide/workflows/spatialfit.py +1 -1
- rapidtide/workflows/spatialmi.py +1 -1
- rapidtide/workflows/spectrogram.py +1 -1
- rapidtide/workflows/synthASL.py +1 -1
- rapidtide/workflows/tcfrom2col.py +1 -1
- rapidtide/workflows/tcfrom3col.py +1 -1
- rapidtide/workflows/tidepool.py +2 -1
- rapidtide/workflows/utils.py +1 -1
- rapidtide/workflows/variabilityizer.py +1 -1
- {rapidtide-3.0a13.dist-info → rapidtide-3.0a15.dist-info}/METADATA +1 -1
- rapidtide-3.0a15.dist-info/RECORD +353 -0
- {rapidtide-3.0a13.dist-info → rapidtide-3.0a15.dist-info}/WHEEL +1 -1
- rapidtide/data/models/model_revised/model.h5 +0 -0
- rapidtide/data/models/model_serdar/model.h5 +0 -0
- rapidtide/data/models/model_serdar2/model.h5 +0 -0
- rapidtide-3.0a13.dist-info/RECORD +0 -345
- {rapidtide-3.0a13.dist-info → rapidtide-3.0a15.dist-info}/entry_points.txt +0 -0
- {rapidtide-3.0a13.dist-info → rapidtide-3.0a15.dist-info}/licenses/LICENSE +0 -0
- {rapidtide-3.0a13.dist-info → rapidtide-3.0a15.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -29,14 +29,6 @@ import rapidtide.io as tide_io
|
|
|
29
29
|
import rapidtide.util as tide_util
|
|
30
30
|
import rapidtide.workflows.parser_funcs as pf
|
|
31
31
|
|
|
32
|
-
try:
|
|
33
|
-
from memory_profiler import profile
|
|
34
|
-
|
|
35
|
-
memprofilerexists = True
|
|
36
|
-
except ImportError:
|
|
37
|
-
memprofilerexists = False
|
|
38
|
-
|
|
39
|
-
|
|
40
32
|
# Create a sentinel.
|
|
41
33
|
# from https://stackoverflow.com/questions/58594956/find-out-which-arguments-were-passed-explicitly-in-argparse
|
|
42
34
|
class _Sentinel:
|
|
@@ -70,7 +62,6 @@ DEFAULT_MAXPASSES = 15
|
|
|
70
62
|
DEFAULT_REFINE_TYPE = "pca"
|
|
71
63
|
DEFAULT_INTERPTYPE = "univariate"
|
|
72
64
|
DEFAULT_WINDOW_TYPE = "hamming"
|
|
73
|
-
DEFAULT_GLOBALMASK_METHOD = "mean"
|
|
74
65
|
DEFAULT_GLOBALSIGNAL_METHOD = "sum"
|
|
75
66
|
DEFAULT_CORRWEIGHTING = "phat"
|
|
76
67
|
DEFAULT_CORRTYPE = "linear"
|
|
@@ -240,7 +231,7 @@ def _get_parser():
|
|
|
240
231
|
action="store_true",
|
|
241
232
|
help=(
|
|
242
233
|
"This is a NIRS analysis - this is a macro that "
|
|
243
|
-
"sets nothresh, refineprenorm=var, ampthresh=0.7, and "
|
|
234
|
+
"sets nothresh, dataiszeromean=True, refineprenorm=var, ampthresh=0.7, and "
|
|
244
235
|
"lagminthresh=0.1. "
|
|
245
236
|
),
|
|
246
237
|
default=False,
|
|
@@ -382,6 +373,17 @@ def _get_parser():
|
|
|
382
373
|
),
|
|
383
374
|
default=False,
|
|
384
375
|
)
|
|
376
|
+
preproc.add_argument(
|
|
377
|
+
"--dataiszeromean",
|
|
378
|
+
dest="dataiszeromean",
|
|
379
|
+
action="store_true",
|
|
380
|
+
help=(
|
|
381
|
+
"Assume that the fMRI data is zero mean (this will be the case if you used AFNI for preprocessing). "
|
|
382
|
+
"This affects how masks are generated. Rapidtide will attempt to detect this, but set explicitly "
|
|
383
|
+
"if you know this is the case."
|
|
384
|
+
),
|
|
385
|
+
default=False,
|
|
386
|
+
)
|
|
385
387
|
|
|
386
388
|
# Add filter options
|
|
387
389
|
pf.addfilteropts(parser, filtertarget="data and regressors", details=True)
|
|
@@ -444,19 +446,6 @@ def _get_parser():
|
|
|
444
446
|
),
|
|
445
447
|
default=False,
|
|
446
448
|
)
|
|
447
|
-
preproc.add_argument(
|
|
448
|
-
"--globalmaskmethod",
|
|
449
|
-
dest="globalmaskmethod",
|
|
450
|
-
action="store",
|
|
451
|
-
type=str,
|
|
452
|
-
choices=["mean", "variance"],
|
|
453
|
-
help=(
|
|
454
|
-
"Select whether to use timecourse mean or variance to "
|
|
455
|
-
"mask voxels prior to generating global mean. "
|
|
456
|
-
f'Default is "{DEFAULT_GLOBALMASK_METHOD}".'
|
|
457
|
-
),
|
|
458
|
-
default=DEFAULT_GLOBALMASK_METHOD,
|
|
459
|
-
)
|
|
460
449
|
preproc.add_argument(
|
|
461
450
|
"--globalmeaninclude",
|
|
462
451
|
dest="globalmeanincludespec",
|
|
@@ -1425,13 +1414,6 @@ def _get_parser():
|
|
|
1425
1414
|
help=("Disable use of shared memory for large array storage."),
|
|
1426
1415
|
default=True,
|
|
1427
1416
|
)
|
|
1428
|
-
misc.add_argument(
|
|
1429
|
-
"--memprofile",
|
|
1430
|
-
dest="memprofile",
|
|
1431
|
-
action="store_true",
|
|
1432
|
-
help=("Enable memory profiling - " "warning: this slows things down a lot."),
|
|
1433
|
-
default=False,
|
|
1434
|
-
)
|
|
1435
1417
|
pf.addtagopts(misc)
|
|
1436
1418
|
|
|
1437
1419
|
# Experimental options (not fully tested, may not work)
|
|
@@ -1519,68 +1501,6 @@ def _get_parser():
|
|
|
1519
1501
|
help=("Attempt to detect and remove respiratory signal that strays into " "the LFO band."),
|
|
1520
1502
|
default=False,
|
|
1521
1503
|
)
|
|
1522
|
-
|
|
1523
|
-
experimental.add_argument(
|
|
1524
|
-
"--noisetimecourse",
|
|
1525
|
-
dest="noisetimecoursespec",
|
|
1526
|
-
metavar="FILENAME[:VALSPEC]",
|
|
1527
|
-
help=(
|
|
1528
|
-
"Find and remove any instance of the timecourse supplied from any regressors used for analysis. "
|
|
1529
|
-
"(if VALSPEC is given, and there are multiple timecourses in the file, use the indicated timecourse."
|
|
1530
|
-
"This can be the name of the regressor if it's in the file, or the column number). "
|
|
1531
|
-
),
|
|
1532
|
-
default=None,
|
|
1533
|
-
)
|
|
1534
|
-
noise_group = experimental.add_mutually_exclusive_group()
|
|
1535
|
-
noise_group.add_argument(
|
|
1536
|
-
"--noisefreq",
|
|
1537
|
-
dest="noisefreq",
|
|
1538
|
-
action="store",
|
|
1539
|
-
type=lambda x: pf.is_float(parser, x, minval=0.0),
|
|
1540
|
-
metavar="FREQ",
|
|
1541
|
-
help=(
|
|
1542
|
-
"Noise timecourse in file has sample "
|
|
1543
|
-
"frequency FREQ (default is 1/tr) "
|
|
1544
|
-
"NB: --noisefreq and --noisetstep) "
|
|
1545
|
-
"are two ways to specify the same thing."
|
|
1546
|
-
),
|
|
1547
|
-
default="auto",
|
|
1548
|
-
)
|
|
1549
|
-
noise_group.add_argument(
|
|
1550
|
-
"--noisetstep",
|
|
1551
|
-
dest="noisefreq",
|
|
1552
|
-
action="store",
|
|
1553
|
-
type=lambda x: pf.invert_float(parser, x),
|
|
1554
|
-
metavar="TSTEP",
|
|
1555
|
-
help=(
|
|
1556
|
-
"Noise timecourse in file has sample "
|
|
1557
|
-
"frequency FREQ (default is 1/tr) "
|
|
1558
|
-
"NB: --noisefreq and --noisetstep) "
|
|
1559
|
-
"are two ways to specify the same thing."
|
|
1560
|
-
),
|
|
1561
|
-
default="auto",
|
|
1562
|
-
)
|
|
1563
|
-
experimental.add_argument(
|
|
1564
|
-
"--noisestart",
|
|
1565
|
-
dest="noisestarttime",
|
|
1566
|
-
action="store",
|
|
1567
|
-
type=float,
|
|
1568
|
-
metavar="START",
|
|
1569
|
-
help=(
|
|
1570
|
-
"The time delay in seconds into the noise timecourse "
|
|
1571
|
-
"file, corresponding in the first TR of the fMRI "
|
|
1572
|
-
"file (default is 0.0)."
|
|
1573
|
-
),
|
|
1574
|
-
default=0.0,
|
|
1575
|
-
)
|
|
1576
|
-
experimental.add_argument(
|
|
1577
|
-
"--noiseinvert",
|
|
1578
|
-
dest="noiseinvert",
|
|
1579
|
-
action="store_true",
|
|
1580
|
-
help=("Invert noise regressor prior to alignment."),
|
|
1581
|
-
default=False,
|
|
1582
|
-
)
|
|
1583
|
-
|
|
1584
1504
|
experimental.add_argument(
|
|
1585
1505
|
"--acfix",
|
|
1586
1506
|
dest="fix_autocorrelation",
|
|
@@ -1857,8 +1777,6 @@ def process_args(inputargs=None):
|
|
|
1857
1777
|
args["absmaxsigma"] = 10000.0
|
|
1858
1778
|
# width of the reference autocorrelation function
|
|
1859
1779
|
args["absminsigma"] = 0.05
|
|
1860
|
-
# search window width for noise regressor mutual information function
|
|
1861
|
-
args["noisesearchwindow"] = 30.0
|
|
1862
1780
|
# number of MADs away from the median to consider an outlier
|
|
1863
1781
|
args["sigdistoutlierfac"] = 10.0
|
|
1864
1782
|
|
|
@@ -1993,18 +1911,6 @@ def process_args(inputargs=None):
|
|
|
1993
1911
|
else:
|
|
1994
1912
|
args["inputfreq_nondefault"] = True
|
|
1995
1913
|
|
|
1996
|
-
if args["noisetimecoursespec"] is not None:
|
|
1997
|
-
(
|
|
1998
|
-
args["noisetimecoursename"],
|
|
1999
|
-
args["noisetimecoursevals"],
|
|
2000
|
-
) = tide_io.parsefilespec(args["noisetimecoursespec"])
|
|
2001
|
-
else:
|
|
2002
|
-
args["noisetimecoursename"] = None
|
|
2003
|
-
args["noisetimecoursevals"] = None
|
|
2004
|
-
|
|
2005
|
-
if args["noisefreq"] == "auto":
|
|
2006
|
-
args["noisefreq"] = 1.0 / fmri_tr
|
|
2007
|
-
|
|
2008
1914
|
# mask processing
|
|
2009
1915
|
if args["corrmaskincludespec"] is not None:
|
|
2010
1916
|
(
|
|
@@ -2211,6 +2117,7 @@ def process_args(inputargs=None):
|
|
|
2211
2117
|
LGR.warning('Using "nirs" macro. Overriding any affected arguments.')
|
|
2212
2118
|
args["nothresh"] = True
|
|
2213
2119
|
pf.setifnotset(args, "preservefiltering", False)
|
|
2120
|
+
args["dataiszeromean"] = True
|
|
2214
2121
|
args["refineprenorm"] = "var"
|
|
2215
2122
|
args["ampthresh"] = 0.7
|
|
2216
2123
|
args["ampthreshfromsig"] = False
|
|
@@ -2276,12 +2183,6 @@ def process_args(inputargs=None):
|
|
|
2276
2183
|
print(f"illegal output level {args['outputlevel']}")
|
|
2277
2184
|
sys.exit()
|
|
2278
2185
|
|
|
2279
|
-
# disable memory profiling if necessary
|
|
2280
|
-
if not memprofilerexists:
|
|
2281
|
-
if args["memprofile"]:
|
|
2282
|
-
LGR.info("memprofiler is not installed - disabling memory profiling")
|
|
2283
|
-
args["memprofile"] = False
|
|
2284
|
-
|
|
2285
2186
|
# dispersion calculation
|
|
2286
2187
|
args["dispersioncalc_lower"] = args["lagmin"]
|
|
2287
2188
|
args["dispersioncalc_upper"] = args["lagmax"]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -24,35 +24,6 @@ import rapidtide.linfitfiltpass as tide_linfitfiltpass
|
|
|
24
24
|
import rapidtide.makelaggedtcs as tide_makelagged
|
|
25
25
|
import rapidtide.util as tide_util
|
|
26
26
|
|
|
27
|
-
try:
|
|
28
|
-
from memory_profiler import profile
|
|
29
|
-
|
|
30
|
-
memprofilerexists = True
|
|
31
|
-
except ImportError:
|
|
32
|
-
memprofilerexists = False
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def conditionalprofile():
|
|
36
|
-
def resdec(f):
|
|
37
|
-
if memprofilerexists:
|
|
38
|
-
return profile(f)
|
|
39
|
-
return f
|
|
40
|
-
|
|
41
|
-
return resdec
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
@conditionalprofile()
|
|
45
|
-
def memcheckpoint(message):
|
|
46
|
-
pass
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def addmemprofiling(thefunc, memprofile, themessage):
|
|
50
|
-
if memprofile:
|
|
51
|
-
return profile(thefunc, precision=2)
|
|
52
|
-
else:
|
|
53
|
-
tide_util.logmem(themessage)
|
|
54
|
-
return thefunc
|
|
55
|
-
|
|
56
27
|
|
|
57
28
|
def regressfrommaps(
|
|
58
29
|
fmri_data_valid,
|
|
@@ -82,7 +53,6 @@ def regressfrommaps(
|
|
|
82
53
|
mp_chunksize=50000,
|
|
83
54
|
showprogressbar=True,
|
|
84
55
|
alwaysmultiproc=False,
|
|
85
|
-
memprofile=False,
|
|
86
56
|
debug=False,
|
|
87
57
|
):
|
|
88
58
|
if debug:
|
|
@@ -93,7 +63,6 @@ def regressfrommaps(
|
|
|
93
63
|
print(f"{mp_chunksize=}")
|
|
94
64
|
print(f"{showprogressbar=}")
|
|
95
65
|
print(f"{alwaysmultiproc=}")
|
|
96
|
-
print(f"{memprofile=}")
|
|
97
66
|
print(f"{mode=}")
|
|
98
67
|
print(f"{outputname=}")
|
|
99
68
|
print(f"{oversamptr=}")
|
|
@@ -107,20 +76,14 @@ def regressfrommaps(
|
|
|
107
76
|
LGR.info("Start lagged timecourse creation")
|
|
108
77
|
if TimingLGR is not None:
|
|
109
78
|
TimingLGR.info("Start lagged timecourse creation")
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
tide_makelagged.makelaggedtcs,
|
|
113
|
-
memprofile,
|
|
114
|
-
"before making lagged timecourses",
|
|
115
|
-
)
|
|
116
|
-
else:
|
|
117
|
-
makelagged_func = tide_makelagged.makelaggedtcs
|
|
118
|
-
voxelsprocessed_makelagged = makelagged_func(
|
|
79
|
+
|
|
80
|
+
voxelsprocessed_makelagged = tide_makelagged.makelaggedtcs(
|
|
119
81
|
genlagtc,
|
|
120
82
|
initial_fmri_x,
|
|
121
83
|
fitmask,
|
|
122
84
|
lagtimes,
|
|
123
85
|
lagtc,
|
|
86
|
+
LGR=LGR,
|
|
124
87
|
nprocs=nprocs_makelaggedtcs,
|
|
125
88
|
alwaysmultiproc=alwaysmultiproc,
|
|
126
89
|
showprogressbar=showprogressbar,
|
|
@@ -149,12 +112,6 @@ def regressfrommaps(
|
|
|
149
112
|
LGR.info("Start filtering operation")
|
|
150
113
|
if TimingLGR is not None:
|
|
151
114
|
TimingLGR.info("Start filtering operation")
|
|
152
|
-
if memprofile:
|
|
153
|
-
linfitfiltpass_func = addmemprofiling(
|
|
154
|
-
tide_linfitfiltpass.linfitfiltpass, memprofile, "before linfitfiltpass"
|
|
155
|
-
)
|
|
156
|
-
else:
|
|
157
|
-
linfitfiltpass_func = tide_linfitfiltpass.linfitfiltpass
|
|
158
115
|
|
|
159
116
|
if regressderivs > 0:
|
|
160
117
|
if debug:
|
|
@@ -172,7 +129,7 @@ def regressfrommaps(
|
|
|
172
129
|
|
|
173
130
|
if debug:
|
|
174
131
|
print(f"{regressorset.shape=}")
|
|
175
|
-
voxelsprocessed_regressionfilt =
|
|
132
|
+
voxelsprocessed_regressionfilt = tide_linfitfiltpass.linfitfiltpass(
|
|
176
133
|
numvalidspatiallocs,
|
|
177
134
|
fmri_data_valid,
|
|
178
135
|
regressfiltthreshval,
|
|
@@ -187,6 +144,7 @@ def regressfrommaps(
|
|
|
187
144
|
nprocs=nprocs_regressionfilt,
|
|
188
145
|
alwaysmultiproc=alwaysmultiproc,
|
|
189
146
|
showprogressbar=showprogressbar,
|
|
147
|
+
verbose=(LGR is not None),
|
|
190
148
|
mp_chunksize=mp_chunksize,
|
|
191
149
|
rt_floatset=rt_floatset,
|
|
192
150
|
rt_floattype=rt_floattype,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -257,6 +257,7 @@ def retrolagtcs(args):
|
|
|
257
257
|
procmask_valid,
|
|
258
258
|
lagtimes_valid,
|
|
259
259
|
lagtc,
|
|
260
|
+
LGR=LGR,
|
|
260
261
|
nprocs=args.nprocs,
|
|
261
262
|
showprogressbar=args.showprogressbar,
|
|
262
263
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright
|
|
4
|
+
# Copyright 2024-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -295,7 +295,29 @@ def retroregress(args):
|
|
|
295
295
|
print(f"illegal output level {args['outputlevel']}")
|
|
296
296
|
sys.exit()
|
|
297
297
|
|
|
298
|
+
# save the raw and formatted command lines
|
|
299
|
+
argstowrite = sys.argv
|
|
298
300
|
thecommandline = " ".join(sys.argv[1:])
|
|
301
|
+
tide_io.writevec([thecommandline], f"{outputname}_retrocommandline.txt")
|
|
302
|
+
formattedcommandline = []
|
|
303
|
+
for thetoken in argstowrite[0:3]:
|
|
304
|
+
formattedcommandline.append(thetoken)
|
|
305
|
+
for thetoken in argstowrite[3:]:
|
|
306
|
+
if thetoken[0:2] == "--":
|
|
307
|
+
formattedcommandline.append(thetoken)
|
|
308
|
+
else:
|
|
309
|
+
formattedcommandline[-1] += " " + thetoken
|
|
310
|
+
for i in range(len(formattedcommandline)):
|
|
311
|
+
if i > 0:
|
|
312
|
+
prefix = " "
|
|
313
|
+
else:
|
|
314
|
+
prefix = ""
|
|
315
|
+
if i < len(formattedcommandline) - 1:
|
|
316
|
+
suffix = " \\"
|
|
317
|
+
else:
|
|
318
|
+
suffix = ""
|
|
319
|
+
formattedcommandline[i] = prefix + formattedcommandline[i] + suffix
|
|
320
|
+
tide_io.writevec(formattedcommandline, f"{outputname}_retroformattedcommandline.txt")
|
|
299
321
|
|
|
300
322
|
if args.nprocs < 1:
|
|
301
323
|
args.nprocs = tide_multiproc.maxcpus()
|
|
@@ -659,7 +681,9 @@ def retroregress(args):
|
|
|
659
681
|
if args.debug:
|
|
660
682
|
print(f"calculating delayoffsets for {filteredregressderivratios.shape[0]} voxels")
|
|
661
683
|
for i in range(filteredregressderivratios.shape[0]):
|
|
662
|
-
delayoffset[i] = tide_refinedelay.ratiotodelay(
|
|
684
|
+
delayoffset[i], closestoffset = tide_refinedelay.ratiotodelay(
|
|
685
|
+
filteredregressderivratios[i]
|
|
686
|
+
)
|
|
663
687
|
"""delayoffset[i] = tide_refinedelay.coffstodelay(
|
|
664
688
|
np.asarray([filteredregressderivratios[i]]),
|
|
665
689
|
mindelay=args.mindelay,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2021-
|
|
4
|
+
# Copyright 2021-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2024-
|
|
4
|
+
# Copyright 2024-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
rapidtide/workflows/showhist.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
rapidtide/workflows/showtc.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
rapidtide/workflows/showxy.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
rapidtide/workflows/simdata.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
rapidtide/workflows/spatialmi.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
rapidtide/workflows/synthASL.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2020-
|
|
4
|
+
# Copyright 2020-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
rapidtide/workflows/tidepool.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -262,6 +262,7 @@ def selectDataset(thesubject):
|
|
|
262
262
|
|
|
263
263
|
class xyztlocation(QtWidgets.QWidget):
|
|
264
264
|
"Manage a location in time and space"
|
|
265
|
+
|
|
265
266
|
updatedXYZ = QtCore.pyqtSignal()
|
|
266
267
|
updatedT = QtCore.pyqtSignal()
|
|
267
268
|
movieTimer = QtCore.QTimer()
|
rapidtide/workflows/utils.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2021-
|
|
4
|
+
# Copyright 2021-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2016-
|
|
4
|
+
# Copyright 2016-2025 Blaise Frederick
|
|
5
5
|
#
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
# you may not use this file except in compliance with the License.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rapidtide
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.0a15
|
|
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>
|