rapidtide 3.0a14__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 +1 -1
- 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/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 +1 -1
- rapidtide/makelaggedtcs.py +1 -1
- rapidtide/maskutil.py +1 -1
- rapidtide/miscmath.py +1 -8
- rapidtide/multiproc.py +1 -1
- rapidtide/patchmatch.py +1 -1
- rapidtide/peakeval.py +1 -1
- rapidtide/qualitycheck.py +1 -1
- rapidtide/refinedelay.py +1 -3
- 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 +2 -2
- rapidtide/tests/test_fullrunhappy_v2.py +2 -2
- rapidtide/tests/test_fullrunhappy_v3.py +2 -2
- rapidtide/tests/test_fullrunhappy_v4.py +2 -2
- rapidtide/tests/test_fullrunhappy_v5.py +1 -3
- rapidtide/tests/test_fullrunrapidtide_v1.py +1 -1
- rapidtide/tests/test_fullrunrapidtide_v2.py +3 -1
- rapidtide/tests/test_fullrunrapidtide_v3.py +1 -1
- rapidtide/tests/test_fullrunrapidtide_v4.py +1 -1
- rapidtide/tests/test_fullrunrapidtide_v5.py +1 -1
- rapidtide/tests/test_fullrunrapidtide_v6.py +1 -1
- 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 +1 -2
- 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 +1 -1
- 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 +1 -1
- 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 +163 -679
- rapidtide/workflows/rapidtide2std.py +1 -1
- rapidtide/workflows/rapidtide_parser.py +1 -98
- rapidtide/workflows/regressfrommaps.py +4 -48
- rapidtide/workflows/resamplenifti.py +1 -1
- rapidtide/workflows/resampletc.py +1 -1
- rapidtide/workflows/retrolagtcs.py +1 -1
- rapidtide/workflows/retroregress.py +1 -1
- 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.0a14.dist-info → rapidtide-3.0a15.dist-info}/METADATA +1 -1
- rapidtide-3.0a15.dist-info/RECORD +353 -0
- {rapidtide-3.0a14.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.0a14.dist-info/RECORD +0 -345
- {rapidtide-3.0a14.dist-info → rapidtide-3.0a15.dist-info}/entry_points.txt +0 -0
- {rapidtide-3.0a14.dist-info → rapidtide-3.0a15.dist-info}/licenses/LICENSE +0 -0
- {rapidtide-3.0a14.dist-info → rapidtide-3.0a15.dist-info}/top_level.txt +0 -0
rapidtide/workflows/happy.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2018-
|
|
4
|
+
# Copyright 2018-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.
|
|
@@ -205,7 +205,6 @@ def happy_main(argparsingfunc):
|
|
|
205
205
|
tide_util.logmem("before mask creation")
|
|
206
206
|
# mask = np.uint16(masking.compute_epi_mask(nim).dataobj.reshape(numspatiallocs))
|
|
207
207
|
mask = np.uint16(tide_mask.makeepimask(nim).dataobj.reshape(numspatiallocs))
|
|
208
|
-
validvoxels = np.where(mask > 0)[0]
|
|
209
208
|
theheader = copy.deepcopy(nim_hdr)
|
|
210
209
|
theheader["dim"][4] = 1
|
|
211
210
|
timings.append(["Mask created", time.time(), None, None])
|
|
@@ -236,13 +235,14 @@ def happy_main(argparsingfunc):
|
|
|
236
235
|
# filter out motion regressors here
|
|
237
236
|
if args.motionfilename is not None:
|
|
238
237
|
timings.append(["Motion filtering start", time.time(), None, None])
|
|
239
|
-
motiondict = tide_io.readmotion(args.motionfilename, tr=tr)
|
|
238
|
+
motiondict = tide_io.readmotion(args.motionfilename, tr=tr, colspec=args.motionfilecolspec)
|
|
240
239
|
confoundregressors, confoundregressorlabels = tide_fit.calcexpandedregressors(
|
|
241
240
|
motiondict,
|
|
242
241
|
labels=["xtrans", "ytrans", "ztrans", "xrot", "yrot", "zrot"],
|
|
243
242
|
deriv=args.motfilt_deriv,
|
|
244
243
|
order=args.motfilt_order,
|
|
245
244
|
)
|
|
245
|
+
tide_util.disablemkl(args.nprocs)
|
|
246
246
|
(motionregressors, motionregressorlabels, filtereddata, confoundr2) = (
|
|
247
247
|
tide_linfitfiltpass.confoundregress(
|
|
248
248
|
confoundregressors,
|
|
@@ -253,8 +253,10 @@ def happy_main(argparsingfunc):
|
|
|
253
253
|
tcstart=args.motskip,
|
|
254
254
|
tchp=args.motionhp,
|
|
255
255
|
tclp=args.motionlp,
|
|
256
|
+
nprocs=args.nprocs,
|
|
256
257
|
)
|
|
257
258
|
)
|
|
259
|
+
tide_util.enablemkl(args.mklthreads)
|
|
258
260
|
if confoundr2 is None:
|
|
259
261
|
print("There are no nonzero confound regressors - exiting")
|
|
260
262
|
sys.exit()
|
|
@@ -273,6 +275,17 @@ def happy_main(argparsingfunc):
|
|
|
273
275
|
append=False,
|
|
274
276
|
debug=args.debug,
|
|
275
277
|
)
|
|
278
|
+
# save motionr2 map
|
|
279
|
+
theheader = copy.deepcopy(nim_hdr)
|
|
280
|
+
theheader["dim"][4] = 1
|
|
281
|
+
motionr2filename = outputroot + "_desc-motionr2_map"
|
|
282
|
+
bidsdict = bidsbasedict.copy()
|
|
283
|
+
tide_io.writedicttojson(bidsdict, motionr2filename + ".json")
|
|
284
|
+
outarray = np.zeros((xsize, ysize, numslices), dtype=float)
|
|
285
|
+
outarray.reshape(numspatiallocs)[validprojvoxels] = confoundr2
|
|
286
|
+
tide_io.savetonifti(
|
|
287
|
+
outarray.reshape((xsize, ysize, numslices)), theheader, motionr2filename
|
|
288
|
+
)
|
|
276
289
|
if args.savemotionglmfilt:
|
|
277
290
|
motionfilteredfilename = outputroot + "_desc-motionfiltered_bold"
|
|
278
291
|
bidsdict = bidsbasedict.copy()
|
|
@@ -372,6 +385,7 @@ def happy_main(argparsingfunc):
|
|
|
372
385
|
# now get an estimate of the cardiac signal
|
|
373
386
|
print("estimating cardiac signal from fmri data")
|
|
374
387
|
tide_util.logmem("before cardiacfromimage")
|
|
388
|
+
tide_util.disablemkl(args.nprocs)
|
|
375
389
|
(
|
|
376
390
|
cardfromfmri_sliceres,
|
|
377
391
|
cardfromfmri_normfac,
|
|
@@ -402,6 +416,7 @@ def happy_main(argparsingfunc):
|
|
|
402
416
|
debug=args.debug,
|
|
403
417
|
verbose=args.verbose,
|
|
404
418
|
)
|
|
419
|
+
tide_util.enablemkl(args.mklthreads)
|
|
405
420
|
timings.append(
|
|
406
421
|
[
|
|
407
422
|
"Cardiac signal generated from image data" + passstring,
|
|
@@ -602,6 +617,15 @@ def happy_main(argparsingfunc):
|
|
|
602
617
|
)
|
|
603
618
|
thedlfilter = tide_dlfilt.DeepLearningFilter(modelpath=modelpath)
|
|
604
619
|
thedlfilter.loadmodel(args.modelname)
|
|
620
|
+
updatemodels = False
|
|
621
|
+
if updatemodels:
|
|
622
|
+
updatedmodelname = f"{args.modelname}_tf2"
|
|
623
|
+
newmodeldir = os.path.join(
|
|
624
|
+
"/Users/frederic/code/rapidtide/rapidtide/data/models", updatedmodelname
|
|
625
|
+
)
|
|
626
|
+
print(f"creating {newmodeldir}")
|
|
627
|
+
tide_util.makeadir(newmodeldir)
|
|
628
|
+
thedlfilter.savemodel(altname=newmodeldir)
|
|
605
629
|
infodict["dlfiltermodel"] = args.modelname
|
|
606
630
|
normdlfilteredcard_stdres = thedlfilter.apply(normcardfromfmri_stdres)
|
|
607
631
|
dlfilteredcard_stdres = thedlfilter.apply(cardfromfmri_stdres)
|
|
@@ -966,6 +990,24 @@ def happy_main(argparsingfunc):
|
|
|
966
990
|
append=True,
|
|
967
991
|
debug=args.debug,
|
|
968
992
|
)
|
|
993
|
+
badpointlist_stdres = np.round(
|
|
994
|
+
tide_resample.arbresample(
|
|
995
|
+
badpointlist,
|
|
996
|
+
slicesamplerate,
|
|
997
|
+
args.stdfreq,
|
|
998
|
+
decimate=True,
|
|
999
|
+
debug=False,
|
|
1000
|
+
),
|
|
1001
|
+
0,
|
|
1002
|
+
)
|
|
1003
|
+
tide_io.writebidstsv(
|
|
1004
|
+
outputroot + "_desc-stdrescardfromfmri_timeseries",
|
|
1005
|
+
badpointlist_stdres,
|
|
1006
|
+
args.stdfreq,
|
|
1007
|
+
columns=["badpts"],
|
|
1008
|
+
append=True,
|
|
1009
|
+
debug=args.debug,
|
|
1010
|
+
)
|
|
969
1011
|
|
|
970
1012
|
# extract the fundamental
|
|
971
1013
|
if args.forcedhr is not None:
|
|
@@ -1755,6 +1797,7 @@ def happy_main(argparsingfunc):
|
|
|
1755
1797
|
fitNorm = np.zeros(timepoints, dtype=np.float64)
|
|
1756
1798
|
datatoremove = 0.0 * fmri_data
|
|
1757
1799
|
print("Running spatial regression on", timepoints, "timepoints")
|
|
1800
|
+
tide_util.disablemkl(args.nprocs)
|
|
1758
1801
|
tide_linfitfiltpass.linfitfiltpass(
|
|
1759
1802
|
timepoints,
|
|
1760
1803
|
fmri_data[validlocs, :],
|
|
@@ -1771,6 +1814,7 @@ def happy_main(argparsingfunc):
|
|
|
1771
1814
|
procbyvoxel=False,
|
|
1772
1815
|
nprocs=args.nprocs,
|
|
1773
1816
|
)
|
|
1817
|
+
tide_util.enablemkl(args.mklthreads)
|
|
1774
1818
|
print(datatoremove.shape, cardiacnoise.shape, fitcoffs.shape)
|
|
1775
1819
|
# datatoremove[validlocs, :] = np.multiply(cardiacnoise[validlocs, :], fitcoffs[:, None])
|
|
1776
1820
|
filtereddata = fmri_data - datatoremove
|
|
@@ -1815,6 +1859,7 @@ def happy_main(argparsingfunc):
|
|
|
1815
1859
|
fitNorm = np.zeros(numspatiallocs, dtype=np.float64)
|
|
1816
1860
|
datatoremove = 0.0 * fmri_data
|
|
1817
1861
|
print("Running temporal regression on", numvalidspatiallocs, "voxels")
|
|
1862
|
+
tide_util.disablemkl(args.nprocs)
|
|
1818
1863
|
tide_linfitfiltpass.linfitfiltpass(
|
|
1819
1864
|
numvalidspatiallocs,
|
|
1820
1865
|
fmri_data[validlocs, :],
|
|
@@ -1830,6 +1875,7 @@ def happy_main(argparsingfunc):
|
|
|
1830
1875
|
procbyvoxel=True,
|
|
1831
1876
|
nprocs=args.nprocs,
|
|
1832
1877
|
)
|
|
1878
|
+
tide_util.enablemkl(args.mklthreads)
|
|
1833
1879
|
datatoremove[validlocs, :] = np.multiply(
|
|
1834
1880
|
cardiacnoise[validlocs, :], fitcoffs[validlocs, None]
|
|
1835
1881
|
)
|
rapidtide/workflows/happy2std.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 2019-
|
|
4
|
+
# Copyright 2019-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.
|
|
@@ -21,9 +21,11 @@ import argparse
|
|
|
21
21
|
import numpy as np
|
|
22
22
|
|
|
23
23
|
import rapidtide.io as tide_io
|
|
24
|
+
import rapidtide.multiproc as tide_multiproc
|
|
24
25
|
import rapidtide.workflows.parser_funcs as pf
|
|
25
26
|
|
|
26
27
|
DEFAULT_ALIASEDCORRELATIONWIDTH = 5.0
|
|
28
|
+
DEFAULT_DL_MODEL = "model_revised_tf2"
|
|
27
29
|
|
|
28
30
|
|
|
29
31
|
def _get_parser():
|
|
@@ -99,10 +101,10 @@ def _get_parser():
|
|
|
99
101
|
dest="modelname",
|
|
100
102
|
metavar="MODELNAME",
|
|
101
103
|
help=(
|
|
102
|
-
"Use model MODELNAME for dl filter (default is
|
|
104
|
+
f"Use model MODELNAME for dl filter (default is {DEFAULT_DL_MODEL} - "
|
|
103
105
|
"from the revised NeuroImage paper.) "
|
|
104
106
|
),
|
|
105
|
-
default=
|
|
107
|
+
default=DEFAULT_DL_MODEL,
|
|
106
108
|
)
|
|
107
109
|
|
|
108
110
|
# Performance
|
|
@@ -120,7 +122,20 @@ def _get_parser():
|
|
|
120
122
|
),
|
|
121
123
|
default=1,
|
|
122
124
|
)
|
|
123
|
-
|
|
125
|
+
performance_opts.add_argument(
|
|
126
|
+
"--nprocs",
|
|
127
|
+
dest="nprocs",
|
|
128
|
+
action="store",
|
|
129
|
+
metavar="NPROCS",
|
|
130
|
+
type=lambda x: pf.is_int(parser, x),
|
|
131
|
+
help=(
|
|
132
|
+
"Use NPROCS CPUs to accelerate processing (defaults to 1 - more "
|
|
133
|
+
"CPUs up to the number of cores can accelerate processing a lot, but "
|
|
134
|
+
"you need to remember to ask for this many CPUs on clusters.) Entering a mulitprocessor "
|
|
135
|
+
"routine disables mklthreads (otherwise there's chaos)."
|
|
136
|
+
),
|
|
137
|
+
default=1,
|
|
138
|
+
)
|
|
124
139
|
# Preprocessing
|
|
125
140
|
preprocessing_opts = parser.add_argument_group("Preprocessing")
|
|
126
141
|
preprocessing_opts.add_argument(
|
|
@@ -143,7 +158,7 @@ def _get_parser():
|
|
|
143
158
|
)
|
|
144
159
|
preprocessing_opts.add_argument(
|
|
145
160
|
"--motionfile",
|
|
146
|
-
dest="
|
|
161
|
+
dest="motionfilespec",
|
|
147
162
|
metavar="MOTFILE",
|
|
148
163
|
help=(
|
|
149
164
|
"Read 6 columns of motion regressors out of MOTFILE file (.par or BIDS .json) "
|
|
@@ -719,7 +734,6 @@ def process_args(inputargs=None):
|
|
|
719
734
|
args.outputlevel = 1
|
|
720
735
|
args.maskthreshpct = 10.0
|
|
721
736
|
args.domadnorm = True
|
|
722
|
-
args.nprocs = 1
|
|
723
737
|
args.verbose = False
|
|
724
738
|
args.smoothlen = 101
|
|
725
739
|
args.envthresh = 0.2
|
|
@@ -738,6 +752,16 @@ def process_args(inputargs=None):
|
|
|
738
752
|
if args.disablenotch:
|
|
739
753
|
args.notchpct = None
|
|
740
754
|
|
|
755
|
+
# process motionfile information
|
|
756
|
+
if args.motionfilespec is not None:
|
|
757
|
+
(args.motionfilename, args.motionfilecolspec) = tide_io.parsefilespec(args.motionfilespec)
|
|
758
|
+
else:
|
|
759
|
+
args.motionfilename = None
|
|
760
|
+
|
|
761
|
+
# set the number of worker processes if multiprocessing
|
|
762
|
+
if args.nprocs < 1:
|
|
763
|
+
args.nprocs = tide_multiproc.maxcpus()
|
|
764
|
+
|
|
741
765
|
# process infotags
|
|
742
766
|
args = pf.postprocesstagopts(args)
|
|
743
767
|
|
rapidtide/workflows/histnifti.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/histtc.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/localflow.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 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.
|
|
@@ -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/pairproc.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.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright 2018-
|
|
4
|
+
# Copyright 2018-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 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.
|
rapidtide/workflows/pixelcomp.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/polyfitim.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/proj2flow.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/rankimage.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.
|