rapidtide 2.9.5__py3-none-any.whl → 3.1.3__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/mount-and-run +2 -0
- cloud/rapidtide-HCPYA +3 -3
- rapidtide/Colortables.py +538 -38
- rapidtide/OrthoImageItem.py +1094 -51
- rapidtide/RapidtideDataset.py +1709 -114
- rapidtide/__init__.py +0 -8
- rapidtide/_version.py +4 -4
- rapidtide/calccoherence.py +242 -97
- rapidtide/calcnullsimfunc.py +240 -140
- rapidtide/calcsimfunc.py +314 -129
- rapidtide/correlate.py +1211 -389
- rapidtide/data/examples/src/testLD +56 -0
- rapidtide/data/examples/src/test_findmaxlag.py +2 -2
- rapidtide/data/examples/src/test_mlregressallt.py +32 -17
- rapidtide/data/examples/src/testalign +1 -1
- rapidtide/data/examples/src/testatlasaverage +35 -7
- rapidtide/data/examples/src/testboth +21 -0
- rapidtide/data/examples/src/testcifti +11 -0
- rapidtide/data/examples/src/testdelayvar +13 -0
- rapidtide/data/examples/src/testdlfilt +25 -0
- rapidtide/data/examples/src/testfft +35 -0
- rapidtide/data/examples/src/testfileorfloat +37 -0
- rapidtide/data/examples/src/testfmri +94 -27
- rapidtide/data/examples/src/testfuncs +3 -3
- rapidtide/data/examples/src/testglmfilt +8 -6
- rapidtide/data/examples/src/testhappy +84 -51
- rapidtide/data/examples/src/testinitdelay +19 -0
- rapidtide/data/examples/src/testmodels +33 -0
- rapidtide/data/examples/src/testnewrefine +26 -0
- rapidtide/data/examples/src/testnoiseamp +21 -0
- rapidtide/data/examples/src/testppgproc +17 -0
- rapidtide/data/examples/src/testrefineonly +22 -0
- rapidtide/data/examples/src/testretro +26 -13
- rapidtide/data/examples/src/testretrolagtcs +16 -0
- rapidtide/data/examples/src/testrolloff +11 -0
- rapidtide/data/examples/src/testsimdata +45 -28
- rapidtide/data/models/model_cnn_pytorch/loss.png +0 -0
- rapidtide/data/models/model_cnn_pytorch/loss.txt +1 -0
- rapidtide/data/models/model_cnn_pytorch/model.pth +0 -0
- rapidtide/data/models/model_cnn_pytorch/model_meta.json +68 -0
- rapidtide/data/models/model_cnn_pytorch_fulldata/loss.png +0 -0
- rapidtide/data/models/model_cnn_pytorch_fulldata/loss.txt +1 -0
- rapidtide/data/models/model_cnn_pytorch_fulldata/model.pth +0 -0
- rapidtide/data/models/model_cnn_pytorch_fulldata/model_meta.json +80 -0
- rapidtide/data/models/model_cnnbp_pytorch_fullldata/loss.png +0 -0
- rapidtide/data/models/model_cnnbp_pytorch_fullldata/loss.txt +1 -0
- rapidtide/data/models/model_cnnbp_pytorch_fullldata/model.pth +0 -0
- rapidtide/data/models/model_cnnbp_pytorch_fullldata/model_meta.json +138 -0
- rapidtide/data/models/model_cnnfft_pytorch_fulldata/loss.png +0 -0
- rapidtide/data/models/model_cnnfft_pytorch_fulldata/loss.txt +1 -0
- rapidtide/data/models/model_cnnfft_pytorch_fulldata/model.pth +0 -0
- rapidtide/data/models/model_cnnfft_pytorch_fulldata/model_meta.json +128 -0
- rapidtide/data/models/model_ppgattention_pytorch_w128_fulldata/loss.png +0 -0
- rapidtide/data/models/model_ppgattention_pytorch_w128_fulldata/loss.txt +1 -0
- rapidtide/data/models/model_ppgattention_pytorch_w128_fulldata/model.pth +0 -0
- rapidtide/data/models/model_ppgattention_pytorch_w128_fulldata/model_meta.json +49 -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/data/reference/HCP1200v2_MTT_2mm.nii.gz +0 -0
- rapidtide/data/reference/HCP1200v2_binmask_2mm.nii.gz +0 -0
- rapidtide/data/reference/HCP1200v2_csf_2mm.nii.gz +0 -0
- rapidtide/data/reference/HCP1200v2_gray_2mm.nii.gz +0 -0
- rapidtide/data/reference/HCP1200v2_graylaghist.json +7 -0
- rapidtide/data/reference/HCP1200v2_graylaghist.tsv.gz +0 -0
- rapidtide/data/reference/HCP1200v2_laghist.json +7 -0
- rapidtide/data/reference/HCP1200v2_laghist.tsv.gz +0 -0
- rapidtide/data/reference/HCP1200v2_mask_2mm.nii.gz +0 -0
- rapidtide/data/reference/HCP1200v2_maxcorr_2mm.nii.gz +0 -0
- rapidtide/data/reference/HCP1200v2_maxtime_2mm.nii.gz +0 -0
- rapidtide/data/reference/HCP1200v2_maxwidth_2mm.nii.gz +0 -0
- rapidtide/data/reference/HCP1200v2_negmask_2mm.nii.gz +0 -0
- rapidtide/data/reference/HCP1200v2_timepercentile_2mm.nii.gz +0 -0
- rapidtide/data/reference/HCP1200v2_white_2mm.nii.gz +0 -0
- rapidtide/data/reference/HCP1200v2_whitelaghist.json +7 -0
- rapidtide/data/reference/HCP1200v2_whitelaghist.tsv.gz +0 -0
- rapidtide/data/reference/JHU-ArterialTerritoriesNoVent-LVL1-seg2.xml +131 -0
- rapidtide/data/reference/JHU-ArterialTerritoriesNoVent-LVL1-seg2_regions.txt +60 -0
- rapidtide/data/reference/JHU-ArterialTerritoriesNoVent-LVL1-seg2_space-MNI152NLin6Asym_2mm.nii.gz +0 -0
- rapidtide/data/reference/JHU-ArterialTerritoriesNoVent-LVL1_space-MNI152NLin2009cAsym_2mm.nii.gz +0 -0
- rapidtide/data/reference/JHU-ArterialTerritoriesNoVent-LVL1_space-MNI152NLin2009cAsym_2mm_mask.nii.gz +0 -0
- rapidtide/data/reference/JHU-ArterialTerritoriesNoVent-LVL1_space-MNI152NLin6Asym_2mm_mask.nii.gz +0 -0
- rapidtide/data/reference/JHU-ArterialTerritoriesNoVent-LVL2_space-MNI152NLin6Asym_2mm_mask.nii.gz +0 -0
- rapidtide/data/reference/MNI152_T1_1mm_Brain_FAST_seg.nii.gz +0 -0
- rapidtide/data/reference/MNI152_T1_1mm_Brain_Mask.nii.gz +0 -0
- rapidtide/data/reference/MNI152_T1_2mm_Brain_FAST_seg.nii.gz +0 -0
- rapidtide/data/reference/MNI152_T1_2mm_Brain_Mask.nii.gz +0 -0
- rapidtide/decorators.py +91 -0
- rapidtide/dlfilter.py +2553 -414
- rapidtide/dlfiltertorch.py +5201 -0
- rapidtide/externaltools.py +328 -13
- rapidtide/fMRIData_class.py +178 -0
- rapidtide/ffttools.py +168 -0
- rapidtide/filter.py +2704 -1462
- rapidtide/fit.py +2361 -579
- rapidtide/genericmultiproc.py +197 -0
- rapidtide/happy_supportfuncs.py +3255 -548
- rapidtide/helper_classes.py +590 -1181
- rapidtide/io.py +2569 -468
- rapidtide/linfitfiltpass.py +784 -0
- rapidtide/makelaggedtcs.py +267 -97
- rapidtide/maskutil.py +555 -25
- rapidtide/miscmath.py +867 -137
- rapidtide/multiproc.py +217 -44
- rapidtide/patchmatch.py +752 -0
- rapidtide/peakeval.py +32 -32
- rapidtide/ppgproc.py +2205 -0
- rapidtide/qualitycheck.py +353 -40
- rapidtide/refinedelay.py +854 -0
- rapidtide/refineregressor.py +939 -0
- rapidtide/resample.py +725 -204
- rapidtide/scripts/__init__.py +1 -0
- rapidtide/scripts/{adjustoffset → adjustoffset.py} +7 -2
- rapidtide/scripts/{aligntcs → aligntcs.py} +7 -2
- rapidtide/scripts/{applydlfilter → applydlfilter.py} +7 -2
- rapidtide/scripts/applyppgproc.py +28 -0
- rapidtide/scripts/{atlasaverage → atlasaverage.py} +7 -2
- rapidtide/scripts/{atlastool → atlastool.py} +7 -2
- rapidtide/scripts/{calcicc → calcicc.py} +7 -2
- rapidtide/scripts/{calctexticc → calctexticc.py} +7 -2
- rapidtide/scripts/{calcttest → calcttest.py} +7 -2
- rapidtide/scripts/{ccorrica → ccorrica.py} +7 -2
- rapidtide/scripts/delayvar.py +28 -0
- rapidtide/scripts/{diffrois → diffrois.py} +7 -2
- rapidtide/scripts/{endtidalproc → endtidalproc.py} +7 -2
- rapidtide/scripts/{fdica → fdica.py} +7 -2
- rapidtide/scripts/{filtnifti → filtnifti.py} +7 -2
- rapidtide/scripts/{filttc → filttc.py} +7 -2
- rapidtide/scripts/{fingerprint → fingerprint.py} +20 -16
- rapidtide/scripts/{fixtr → fixtr.py} +7 -2
- rapidtide/scripts/{gmscalc → gmscalc.py} +7 -2
- rapidtide/scripts/{happy → happy.py} +7 -2
- rapidtide/scripts/{happy2std → happy2std.py} +7 -2
- rapidtide/scripts/{happywarp → happywarp.py} +8 -4
- rapidtide/scripts/{histnifti → histnifti.py} +7 -2
- rapidtide/scripts/{histtc → histtc.py} +7 -2
- rapidtide/scripts/{glmfilt → linfitfilt.py} +7 -4
- rapidtide/scripts/{localflow → localflow.py} +7 -2
- rapidtide/scripts/{mergequality → mergequality.py} +7 -2
- rapidtide/scripts/{pairproc → pairproc.py} +7 -2
- rapidtide/scripts/{pairwisemergenifti → pairwisemergenifti.py} +7 -2
- rapidtide/scripts/{physiofreq → physiofreq.py} +7 -2
- rapidtide/scripts/{pixelcomp → pixelcomp.py} +7 -2
- rapidtide/scripts/{plethquality → plethquality.py} +7 -2
- rapidtide/scripts/{polyfitim → polyfitim.py} +7 -2
- rapidtide/scripts/{proj2flow → proj2flow.py} +7 -2
- rapidtide/scripts/{rankimage → rankimage.py} +7 -2
- rapidtide/scripts/{rapidtide → rapidtide.py} +7 -2
- rapidtide/scripts/{rapidtide2std → rapidtide2std.py} +7 -2
- rapidtide/scripts/{resamplenifti → resamplenifti.py} +7 -2
- rapidtide/scripts/{resampletc → resampletc.py} +7 -2
- rapidtide/scripts/retrolagtcs.py +28 -0
- rapidtide/scripts/retroregress.py +28 -0
- rapidtide/scripts/{roisummarize → roisummarize.py} +7 -2
- rapidtide/scripts/{runqualitycheck → runqualitycheck.py} +7 -2
- rapidtide/scripts/{showarbcorr → showarbcorr.py} +7 -2
- rapidtide/scripts/{showhist → showhist.py} +7 -2
- rapidtide/scripts/{showstxcorr → showstxcorr.py} +7 -2
- rapidtide/scripts/{showtc → showtc.py} +7 -2
- rapidtide/scripts/{showxcorr_legacy → showxcorr_legacy.py} +8 -8
- rapidtide/scripts/{showxcorrx → showxcorrx.py} +7 -2
- rapidtide/scripts/{showxy → showxy.py} +7 -2
- rapidtide/scripts/{simdata → simdata.py} +7 -2
- rapidtide/scripts/{spatialdecomp → spatialdecomp.py} +7 -2
- rapidtide/scripts/{spatialfit → spatialfit.py} +7 -2
- rapidtide/scripts/{spatialmi → spatialmi.py} +7 -2
- rapidtide/scripts/{spectrogram → spectrogram.py} +7 -2
- rapidtide/scripts/stupidramtricks.py +238 -0
- rapidtide/scripts/{synthASL → synthASL.py} +7 -2
- rapidtide/scripts/{tcfrom2col → tcfrom2col.py} +7 -2
- rapidtide/scripts/{tcfrom3col → tcfrom3col.py} +7 -2
- rapidtide/scripts/{temporaldecomp → temporaldecomp.py} +7 -2
- rapidtide/scripts/{testhrv → testhrv.py} +1 -1
- rapidtide/scripts/{threeD → threeD.py} +7 -2
- rapidtide/scripts/{tidepool → tidepool.py} +7 -2
- rapidtide/scripts/{variabilityizer → variabilityizer.py} +7 -2
- rapidtide/simFuncClasses.py +2113 -0
- rapidtide/simfuncfit.py +312 -108
- rapidtide/stats.py +579 -247
- rapidtide/tests/.coveragerc +27 -6
- rapidtide-2.9.5.data/scripts/fdica → rapidtide/tests/cleanposttest +4 -6
- rapidtide/tests/happycomp +9 -0
- rapidtide/tests/resethappytargets +1 -1
- rapidtide/tests/resetrapidtidetargets +1 -1
- rapidtide/tests/resettargets +1 -1
- rapidtide/tests/runlocaltest +3 -3
- rapidtide/tests/showkernels +1 -1
- rapidtide/tests/test_aliasedcorrelate.py +4 -4
- rapidtide/tests/test_aligntcs.py +1 -1
- rapidtide/tests/test_calcicc.py +1 -1
- rapidtide/tests/test_cleanregressor.py +184 -0
- rapidtide/tests/test_congrid.py +70 -81
- rapidtide/tests/test_correlate.py +1 -1
- rapidtide/tests/test_corrpass.py +4 -4
- rapidtide/tests/test_delayestimation.py +54 -59
- rapidtide/tests/test_dlfiltertorch.py +437 -0
- rapidtide/tests/test_doresample.py +2 -2
- rapidtide/tests/test_externaltools.py +69 -0
- rapidtide/tests/test_fastresampler.py +9 -5
- rapidtide/tests/test_filter.py +96 -57
- rapidtide/tests/test_findmaxlag.py +50 -19
- rapidtide/tests/test_fullrunhappy_v1.py +15 -10
- rapidtide/tests/test_fullrunhappy_v2.py +19 -13
- rapidtide/tests/test_fullrunhappy_v3.py +28 -13
- rapidtide/tests/test_fullrunhappy_v4.py +30 -11
- rapidtide/tests/test_fullrunhappy_v5.py +62 -0
- rapidtide/tests/test_fullrunrapidtide_v1.py +61 -7
- rapidtide/tests/test_fullrunrapidtide_v2.py +27 -15
- rapidtide/tests/test_fullrunrapidtide_v3.py +28 -8
- rapidtide/tests/test_fullrunrapidtide_v4.py +16 -8
- rapidtide/tests/test_fullrunrapidtide_v5.py +15 -6
- rapidtide/tests/test_fullrunrapidtide_v6.py +142 -0
- rapidtide/tests/test_fullrunrapidtide_v7.py +114 -0
- rapidtide/tests/test_fullrunrapidtide_v8.py +66 -0
- rapidtide/tests/test_getparsers.py +158 -0
- rapidtide/tests/test_io.py +59 -18
- rapidtide/tests/{test_glmpass.py → test_linfitfiltpass.py} +10 -10
- rapidtide/tests/test_mi.py +1 -1
- rapidtide/tests/test_miscmath.py +1 -1
- rapidtide/tests/test_motionregress.py +5 -5
- rapidtide/tests/test_nullcorr.py +6 -9
- rapidtide/tests/test_padvec.py +216 -0
- rapidtide/tests/test_parserfuncs.py +101 -0
- rapidtide/tests/test_phaseanalysis.py +1 -1
- rapidtide/tests/test_rapidtideparser.py +59 -53
- rapidtide/tests/test_refinedelay.py +296 -0
- rapidtide/tests/test_runmisc.py +5 -5
- rapidtide/tests/test_sharedmem.py +60 -0
- rapidtide/tests/test_simroundtrip.py +132 -0
- rapidtide/tests/test_simulate.py +1 -1
- rapidtide/tests/test_stcorrelate.py +4 -2
- rapidtide/tests/test_timeshift.py +2 -2
- rapidtide/tests/test_valtoindex.py +1 -1
- rapidtide/tests/test_zRapidtideDataset.py +5 -3
- rapidtide/tests/utils.py +10 -9
- rapidtide/tidepoolTemplate.py +88 -70
- rapidtide/tidepoolTemplate.ui +60 -46
- rapidtide/tidepoolTemplate_alt.py +88 -53
- rapidtide/tidepoolTemplate_alt.ui +62 -52
- rapidtide/tidepoolTemplate_alt_qt6.py +921 -0
- rapidtide/tidepoolTemplate_big.py +1125 -0
- rapidtide/tidepoolTemplate_big.ui +2386 -0
- rapidtide/tidepoolTemplate_big_qt6.py +1129 -0
- rapidtide/tidepoolTemplate_qt6.py +793 -0
- rapidtide/util.py +1389 -148
- rapidtide/voxelData.py +1048 -0
- rapidtide/wiener.py +138 -25
- rapidtide/wiener2.py +114 -8
- rapidtide/workflows/adjustoffset.py +107 -5
- rapidtide/workflows/aligntcs.py +86 -3
- rapidtide/workflows/applydlfilter.py +231 -89
- rapidtide/workflows/applyppgproc.py +540 -0
- rapidtide/workflows/atlasaverage.py +309 -48
- rapidtide/workflows/atlastool.py +130 -9
- rapidtide/workflows/calcSimFuncMap.py +490 -0
- rapidtide/workflows/calctexticc.py +202 -10
- rapidtide/workflows/ccorrica.py +123 -15
- rapidtide/workflows/cleanregressor.py +415 -0
- rapidtide/workflows/delayvar.py +1268 -0
- rapidtide/workflows/diffrois.py +84 -6
- rapidtide/workflows/endtidalproc.py +149 -9
- rapidtide/workflows/fdica.py +197 -17
- rapidtide/workflows/filtnifti.py +71 -4
- rapidtide/workflows/filttc.py +76 -5
- rapidtide/workflows/fitSimFuncMap.py +578 -0
- rapidtide/workflows/fixtr.py +74 -4
- rapidtide/workflows/gmscalc.py +116 -6
- rapidtide/workflows/happy.py +1242 -480
- rapidtide/workflows/happy2std.py +145 -13
- rapidtide/workflows/happy_parser.py +277 -59
- rapidtide/workflows/histnifti.py +120 -4
- rapidtide/workflows/histtc.py +85 -4
- rapidtide/workflows/{glmfilt.py → linfitfilt.py} +128 -14
- rapidtide/workflows/localflow.py +329 -29
- rapidtide/workflows/mergequality.py +80 -4
- rapidtide/workflows/niftidecomp.py +323 -19
- rapidtide/workflows/niftistats.py +178 -8
- rapidtide/workflows/pairproc.py +99 -5
- rapidtide/workflows/pairwisemergenifti.py +86 -3
- rapidtide/workflows/parser_funcs.py +1488 -56
- rapidtide/workflows/physiofreq.py +139 -12
- rapidtide/workflows/pixelcomp.py +211 -9
- rapidtide/workflows/plethquality.py +105 -23
- rapidtide/workflows/polyfitim.py +159 -19
- rapidtide/workflows/proj2flow.py +76 -3
- rapidtide/workflows/rankimage.py +115 -8
- rapidtide/workflows/rapidtide.py +1833 -1919
- rapidtide/workflows/rapidtide2std.py +101 -3
- rapidtide/workflows/rapidtide_parser.py +607 -372
- rapidtide/workflows/refineDelayMap.py +249 -0
- rapidtide/workflows/refineRegressor.py +1215 -0
- rapidtide/workflows/regressfrommaps.py +308 -0
- rapidtide/workflows/resamplenifti.py +86 -4
- rapidtide/workflows/resampletc.py +92 -4
- rapidtide/workflows/retrolagtcs.py +442 -0
- rapidtide/workflows/retroregress.py +1501 -0
- rapidtide/workflows/roisummarize.py +176 -7
- rapidtide/workflows/runqualitycheck.py +72 -7
- rapidtide/workflows/showarbcorr.py +172 -16
- rapidtide/workflows/showhist.py +87 -3
- rapidtide/workflows/showstxcorr.py +161 -4
- rapidtide/workflows/showtc.py +172 -10
- rapidtide/workflows/showxcorrx.py +250 -62
- rapidtide/workflows/showxy.py +186 -16
- rapidtide/workflows/simdata.py +418 -112
- rapidtide/workflows/spatialfit.py +83 -8
- rapidtide/workflows/spatialmi.py +252 -29
- rapidtide/workflows/spectrogram.py +306 -33
- rapidtide/workflows/synthASL.py +157 -6
- rapidtide/workflows/tcfrom2col.py +77 -3
- rapidtide/workflows/tcfrom3col.py +75 -3
- rapidtide/workflows/tidepool.py +3829 -666
- rapidtide/workflows/utils.py +45 -19
- rapidtide/workflows/utils_doc.py +293 -0
- rapidtide/workflows/variabilityizer.py +118 -5
- {rapidtide-2.9.5.dist-info → rapidtide-3.1.3.dist-info}/METADATA +30 -223
- rapidtide-3.1.3.dist-info/RECORD +393 -0
- {rapidtide-2.9.5.dist-info → rapidtide-3.1.3.dist-info}/WHEEL +1 -1
- rapidtide-3.1.3.dist-info/entry_points.txt +65 -0
- rapidtide-3.1.3.dist-info/top_level.txt +2 -0
- rapidtide/calcandfitcorrpairs.py +0 -262
- rapidtide/data/examples/src/testoutputsize +0 -45
- 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/data/reference/ASPECTS_nlin_asym_09c_2mm.nii.gz +0 -0
- rapidtide/data/reference/ASPECTS_nlin_asym_09c_2mm_mask.nii.gz +0 -0
- rapidtide/data/reference/ATTbasedFlowTerritories_split_nlin_asym_09c_2mm.nii.gz +0 -0
- rapidtide/data/reference/ATTbasedFlowTerritories_split_nlin_asym_09c_2mm_mask.nii.gz +0 -0
- rapidtide/data/reference/HCP1200_binmask_2mm_2009c_asym.nii.gz +0 -0
- rapidtide/data/reference/HCP1200_lag_2mm_2009c_asym.nii.gz +0 -0
- rapidtide/data/reference/HCP1200_mask_2mm_2009c_asym.nii.gz +0 -0
- rapidtide/data/reference/HCP1200_negmask_2mm_2009c_asym.nii.gz +0 -0
- rapidtide/data/reference/HCP1200_sigma_2mm_2009c_asym.nii.gz +0 -0
- rapidtide/data/reference/HCP1200_strength_2mm_2009c_asym.nii.gz +0 -0
- rapidtide/glmpass.py +0 -434
- rapidtide/refine_factored.py +0 -641
- rapidtide/scripts/retroglm +0 -23
- rapidtide/workflows/glmfrommaps.py +0 -202
- rapidtide/workflows/retroglm.py +0 -643
- rapidtide-2.9.5.data/scripts/adjustoffset +0 -23
- rapidtide-2.9.5.data/scripts/aligntcs +0 -23
- rapidtide-2.9.5.data/scripts/applydlfilter +0 -23
- rapidtide-2.9.5.data/scripts/atlasaverage +0 -23
- rapidtide-2.9.5.data/scripts/atlastool +0 -23
- rapidtide-2.9.5.data/scripts/calcicc +0 -22
- rapidtide-2.9.5.data/scripts/calctexticc +0 -23
- rapidtide-2.9.5.data/scripts/calcttest +0 -22
- rapidtide-2.9.5.data/scripts/ccorrica +0 -23
- rapidtide-2.9.5.data/scripts/diffrois +0 -23
- rapidtide-2.9.5.data/scripts/endtidalproc +0 -23
- rapidtide-2.9.5.data/scripts/filtnifti +0 -23
- rapidtide-2.9.5.data/scripts/filttc +0 -23
- rapidtide-2.9.5.data/scripts/fingerprint +0 -593
- rapidtide-2.9.5.data/scripts/fixtr +0 -23
- rapidtide-2.9.5.data/scripts/glmfilt +0 -24
- rapidtide-2.9.5.data/scripts/gmscalc +0 -22
- rapidtide-2.9.5.data/scripts/happy +0 -25
- rapidtide-2.9.5.data/scripts/happy2std +0 -23
- rapidtide-2.9.5.data/scripts/happywarp +0 -350
- rapidtide-2.9.5.data/scripts/histnifti +0 -23
- rapidtide-2.9.5.data/scripts/histtc +0 -23
- rapidtide-2.9.5.data/scripts/localflow +0 -23
- rapidtide-2.9.5.data/scripts/mergequality +0 -23
- rapidtide-2.9.5.data/scripts/pairproc +0 -23
- rapidtide-2.9.5.data/scripts/pairwisemergenifti +0 -23
- rapidtide-2.9.5.data/scripts/physiofreq +0 -23
- rapidtide-2.9.5.data/scripts/pixelcomp +0 -23
- rapidtide-2.9.5.data/scripts/plethquality +0 -23
- rapidtide-2.9.5.data/scripts/polyfitim +0 -23
- rapidtide-2.9.5.data/scripts/proj2flow +0 -23
- rapidtide-2.9.5.data/scripts/rankimage +0 -23
- rapidtide-2.9.5.data/scripts/rapidtide +0 -23
- rapidtide-2.9.5.data/scripts/rapidtide2std +0 -23
- rapidtide-2.9.5.data/scripts/resamplenifti +0 -23
- rapidtide-2.9.5.data/scripts/resampletc +0 -23
- rapidtide-2.9.5.data/scripts/retroglm +0 -23
- rapidtide-2.9.5.data/scripts/roisummarize +0 -23
- rapidtide-2.9.5.data/scripts/runqualitycheck +0 -23
- rapidtide-2.9.5.data/scripts/showarbcorr +0 -23
- rapidtide-2.9.5.data/scripts/showhist +0 -23
- rapidtide-2.9.5.data/scripts/showstxcorr +0 -23
- rapidtide-2.9.5.data/scripts/showtc +0 -23
- rapidtide-2.9.5.data/scripts/showxcorr_legacy +0 -536
- rapidtide-2.9.5.data/scripts/showxcorrx +0 -23
- rapidtide-2.9.5.data/scripts/showxy +0 -23
- rapidtide-2.9.5.data/scripts/simdata +0 -23
- rapidtide-2.9.5.data/scripts/spatialdecomp +0 -23
- rapidtide-2.9.5.data/scripts/spatialfit +0 -23
- rapidtide-2.9.5.data/scripts/spatialmi +0 -23
- rapidtide-2.9.5.data/scripts/spectrogram +0 -23
- rapidtide-2.9.5.data/scripts/synthASL +0 -23
- rapidtide-2.9.5.data/scripts/tcfrom2col +0 -23
- rapidtide-2.9.5.data/scripts/tcfrom3col +0 -23
- rapidtide-2.9.5.data/scripts/temporaldecomp +0 -23
- rapidtide-2.9.5.data/scripts/threeD +0 -236
- rapidtide-2.9.5.data/scripts/tidepool +0 -23
- rapidtide-2.9.5.data/scripts/variabilityizer +0 -23
- rapidtide-2.9.5.dist-info/RECORD +0 -357
- rapidtide-2.9.5.dist-info/top_level.txt +0 -86
- {rapidtide-2.9.5.dist-info → rapidtide-3.1.3.dist-info/licenses}/LICENSE +0 -0
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.
|
|
@@ -17,15 +17,44 @@
|
|
|
17
17
|
#
|
|
18
18
|
#
|
|
19
19
|
import argparse
|
|
20
|
+
from argparse import Namespace
|
|
21
|
+
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
|
20
22
|
|
|
21
23
|
import numpy as np
|
|
22
24
|
from matplotlib.pyplot import bar, legend, plot, savefig, show, title, xlabel, ylabel
|
|
25
|
+
from numpy.typing import NDArray
|
|
23
26
|
|
|
24
27
|
import rapidtide.io as tide_io
|
|
25
28
|
import rapidtide.stats as tide_stats
|
|
26
29
|
|
|
27
30
|
|
|
28
|
-
def _get_parser():
|
|
31
|
+
def _get_parser() -> Any:
|
|
32
|
+
"""
|
|
33
|
+
Create and configure an argument parser for the showhist command-line tool.
|
|
34
|
+
|
|
35
|
+
This function sets up an `argparse.ArgumentParser` with specific arguments
|
|
36
|
+
to control the behavior of the histogram plotting script. It defines
|
|
37
|
+
required and optional parameters for input file, axis labels, title,
|
|
38
|
+
output file, plot style, and debugging options.
|
|
39
|
+
|
|
40
|
+
Returns
|
|
41
|
+
-------
|
|
42
|
+
argparse.ArgumentParser
|
|
43
|
+
Configured argument parser object with defined arguments for
|
|
44
|
+
controlling histogram plotting behavior.
|
|
45
|
+
|
|
46
|
+
Notes
|
|
47
|
+
-----
|
|
48
|
+
The parser is configured with `allow_abbrev=False` to prevent
|
|
49
|
+
abbreviated argument names from being accepted.
|
|
50
|
+
|
|
51
|
+
Examples
|
|
52
|
+
--------
|
|
53
|
+
>>> parser = _get_parser()
|
|
54
|
+
>>> args = parser.parse_args(['data.txt'])
|
|
55
|
+
>>> print(args.infilename)
|
|
56
|
+
'data.txt'
|
|
57
|
+
"""
|
|
29
58
|
# get the command line parameters
|
|
30
59
|
parser = argparse.ArgumentParser(
|
|
31
60
|
prog="showhist",
|
|
@@ -90,7 +119,62 @@ def _get_parser():
|
|
|
90
119
|
return parser
|
|
91
120
|
|
|
92
121
|
|
|
93
|
-
def showhist(args):
|
|
122
|
+
def showhist(args: Any) -> None:
|
|
123
|
+
"""
|
|
124
|
+
Display or save a histogram or line plot based on input data and arguments.
|
|
125
|
+
|
|
126
|
+
This function reads data from a specified input file, computes a histogram if
|
|
127
|
+
requested, and visualizes the results using matplotlib. The plot can be displayed
|
|
128
|
+
on screen or saved to a file depending on the provided arguments.
|
|
129
|
+
|
|
130
|
+
Parameters
|
|
131
|
+
----------
|
|
132
|
+
args : Any
|
|
133
|
+
An object containing the following attributes:
|
|
134
|
+
- infilename : str
|
|
135
|
+
Path to the input file containing data to be plotted.
|
|
136
|
+
- debug : bool
|
|
137
|
+
If True, prints the args object for debugging purposes.
|
|
138
|
+
- calcdist : bool
|
|
139
|
+
If True, computes a histogram from the input data.
|
|
140
|
+
- dobars : bool
|
|
141
|
+
If True, displays the histogram as bars; otherwise, as a line plot.
|
|
142
|
+
- thetitle : str, optional
|
|
143
|
+
Title for the plot.
|
|
144
|
+
- thexlabel : str, optional
|
|
145
|
+
Label for the x-axis.
|
|
146
|
+
- theylabel : str, optional
|
|
147
|
+
Label for the y-axis.
|
|
148
|
+
- outputfile : str, optional
|
|
149
|
+
Path to save the plot. If None, the plot is displayed on screen.
|
|
150
|
+
|
|
151
|
+
Returns
|
|
152
|
+
-------
|
|
153
|
+
None
|
|
154
|
+
This function does not return any value. It either displays the plot
|
|
155
|
+
or saves it to a file.
|
|
156
|
+
|
|
157
|
+
Notes
|
|
158
|
+
-----
|
|
159
|
+
- The function uses `tide_io.readvecs` to read input data.
|
|
160
|
+
- If `calcdist` is True, `tide_stats.makehistogram` is used to compute the histogram.
|
|
161
|
+
- The histogram is displayed as either bars or a line, depending on the `dobars` flag.
|
|
162
|
+
- If `outputfile` is provided, the plot is saved using `savefig`; otherwise, `show()` is called.
|
|
163
|
+
|
|
164
|
+
Examples
|
|
165
|
+
--------
|
|
166
|
+
>>> args = type('Args', (), {
|
|
167
|
+
... 'infilename': 'data.txt',
|
|
168
|
+
... 'debug': False,
|
|
169
|
+
... 'calcdist': True,
|
|
170
|
+
... 'dobars': True,
|
|
171
|
+
... 'thetitle': 'Sample Histogram',
|
|
172
|
+
... 'thexlabel': 'Values',
|
|
173
|
+
... 'theylabel': 'Frequency',
|
|
174
|
+
... 'outputfile': 'output.png'
|
|
175
|
+
... })()
|
|
176
|
+
>>> showhist(args)
|
|
177
|
+
"""
|
|
94
178
|
if args.debug:
|
|
95
179
|
print(args)
|
|
96
180
|
if args.calcdist:
|
|
@@ -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.
|
|
@@ -18,11 +18,14 @@
|
|
|
18
18
|
#
|
|
19
19
|
import argparse
|
|
20
20
|
import sys
|
|
21
|
+
from argparse import Namespace
|
|
22
|
+
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
|
21
23
|
|
|
22
24
|
import nibabel as nib
|
|
23
25
|
import numpy as np
|
|
24
26
|
import pandas as pd
|
|
25
27
|
from numpy.polynomial import Polynomial
|
|
28
|
+
from numpy.typing import NDArray
|
|
26
29
|
|
|
27
30
|
import rapidtide.correlate as tide_corr
|
|
28
31
|
import rapidtide.fit as tide_fit
|
|
@@ -32,7 +35,36 @@ import rapidtide.resample as tide_resamp
|
|
|
32
35
|
import rapidtide.workflows.parser_funcs as pf
|
|
33
36
|
|
|
34
37
|
|
|
35
|
-
def _get_parser():
|
|
38
|
+
def _get_parser() -> Any:
|
|
39
|
+
"""
|
|
40
|
+
Create and configure an argument parser for the showstxcorr tool.
|
|
41
|
+
|
|
42
|
+
This function sets up an `argparse.ArgumentParser` with various required and
|
|
43
|
+
optional arguments to control the behavior of the cross-correlation plotting
|
|
44
|
+
tool. It includes options for input files, sampling parameters, correlation
|
|
45
|
+
settings, display control, and preprocessing steps.
|
|
46
|
+
|
|
47
|
+
Returns
|
|
48
|
+
-------
|
|
49
|
+
argparse.ArgumentParser
|
|
50
|
+
Configured argument parser object with all necessary arguments added.
|
|
51
|
+
|
|
52
|
+
Notes
|
|
53
|
+
-----
|
|
54
|
+
The parser is configured with:
|
|
55
|
+
- Two required input text files (`infilename1`, `infilename2`)
|
|
56
|
+
- Output filename root
|
|
57
|
+
- Sampling rate or time step options (mutually exclusive)
|
|
58
|
+
- Correlation threshold and window parameters
|
|
59
|
+
- Time range and display options
|
|
60
|
+
- Preprocessing options like detrending and correlation weighting
|
|
61
|
+
- Filtering and windowing options
|
|
62
|
+
|
|
63
|
+
Examples
|
|
64
|
+
--------
|
|
65
|
+
>>> parser = _get_parser()
|
|
66
|
+
>>> args = parser.parse_args()
|
|
67
|
+
"""
|
|
36
68
|
parser = argparse.ArgumentParser(
|
|
37
69
|
prog="showstxcorr",
|
|
38
70
|
description="Plots the data in text files.",
|
|
@@ -187,13 +219,138 @@ def _get_parser():
|
|
|
187
219
|
return parser
|
|
188
220
|
|
|
189
221
|
|
|
190
|
-
def printthresholds(pcts, thepercentiles, labeltext):
|
|
222
|
+
def printthresholds(pcts: Any, thepercentiles: Any, labeltext: Any) -> None:
|
|
223
|
+
"""
|
|
224
|
+
Print thresholds with corresponding percentile values.
|
|
225
|
+
|
|
226
|
+
This function prints a formatted list of thresholds where each threshold
|
|
227
|
+
corresponds to a specific percentile. The output shows the probability
|
|
228
|
+
threshold for which the percentile is less than the given value.
|
|
229
|
+
|
|
230
|
+
Parameters
|
|
231
|
+
----------
|
|
232
|
+
pcts : Any
|
|
233
|
+
Array-like object containing the percentile values to be printed.
|
|
234
|
+
thepercentiles : Any
|
|
235
|
+
Array-like object containing the corresponding percentile thresholds.
|
|
236
|
+
labeltext : Any
|
|
237
|
+
Text label to be printed before the threshold values.
|
|
238
|
+
|
|
239
|
+
Returns
|
|
240
|
+
-------
|
|
241
|
+
None
|
|
242
|
+
This function prints to stdout and does not return any value.
|
|
243
|
+
|
|
244
|
+
Notes
|
|
245
|
+
-----
|
|
246
|
+
The function assumes that both `pcts` and `thepercentiles` have the same length
|
|
247
|
+
and that the percentiles are ordered in ascending order.
|
|
248
|
+
|
|
249
|
+
Examples
|
|
250
|
+
--------
|
|
251
|
+
>>> pcts = [0.05, 0.01, 0.001]
|
|
252
|
+
>>> thepercentiles = [0.95, 0.99, 0.999]
|
|
253
|
+
>>> labeltext = "Significance thresholds:"
|
|
254
|
+
>>> printthresholds(pcts, thepercentiles, labeltext)
|
|
255
|
+
Significance thresholds:
|
|
256
|
+
p < 0.05 : 0.05
|
|
257
|
+
p < 0.01 : 0.01
|
|
258
|
+
p < 0.001 : 0.001
|
|
259
|
+
"""
|
|
191
260
|
print(labeltext)
|
|
192
261
|
for i in range(0, len(pcts)):
|
|
193
262
|
print("\tp <", 1.0 - thepercentiles[i], ": ", pcts[i])
|
|
194
263
|
|
|
195
264
|
|
|
196
|
-
def showstxcorr(args):
|
|
265
|
+
def showstxcorr(args: Any) -> None:
|
|
266
|
+
"""
|
|
267
|
+
Compute and display short-term cross-correlations between two time series.
|
|
268
|
+
|
|
269
|
+
This function performs short-term cross-correlation analysis on two input time series,
|
|
270
|
+
applying optional filtering, detrending, and time-warping. It supports both single
|
|
271
|
+
correlation output and matrix output modes, and can generate plots and save results
|
|
272
|
+
to files.
|
|
273
|
+
|
|
274
|
+
Parameters
|
|
275
|
+
----------
|
|
276
|
+
args : argparse.Namespace
|
|
277
|
+
Command-line arguments containing the following attributes:
|
|
278
|
+
- infilename1 : str
|
|
279
|
+
Path to the first input file.
|
|
280
|
+
- infilename2 : str
|
|
281
|
+
Path to the second input file.
|
|
282
|
+
- samplerate : float or str
|
|
283
|
+
Sampling rate of the data. Must be set if 'auto'.
|
|
284
|
+
- starttime : float
|
|
285
|
+
Start time for data trimming.
|
|
286
|
+
- duration : float
|
|
287
|
+
Duration of the data to process.
|
|
288
|
+
- stepsize : float
|
|
289
|
+
Step size for correlation computation.
|
|
290
|
+
- windowwidth : float
|
|
291
|
+
Width of the analysis window in seconds.
|
|
292
|
+
- lagmin : float
|
|
293
|
+
Minimum lag for correlation search.
|
|
294
|
+
- lagmax : float
|
|
295
|
+
Maximum lag for correlation search.
|
|
296
|
+
- corrweighting : str
|
|
297
|
+
Type of weighting for correlation.
|
|
298
|
+
- windowfunc : str
|
|
299
|
+
Window function to apply.
|
|
300
|
+
- detrendorder : int
|
|
301
|
+
Order of detrending to apply.
|
|
302
|
+
- invert : bool
|
|
303
|
+
Whether to invert the second signal.
|
|
304
|
+
- display : bool
|
|
305
|
+
Whether to display plots.
|
|
306
|
+
- debug : bool
|
|
307
|
+
Whether to enable debug output.
|
|
308
|
+
- outfilename : str
|
|
309
|
+
Base name for output files.
|
|
310
|
+
- corrthresh : float
|
|
311
|
+
Threshold for correlation significance.
|
|
312
|
+
- filter : dict
|
|
313
|
+
Filter parameters.
|
|
314
|
+
|
|
315
|
+
Returns
|
|
316
|
+
-------
|
|
317
|
+
None
|
|
318
|
+
This function does not return a value but saves output files and displays plots
|
|
319
|
+
if requested.
|
|
320
|
+
|
|
321
|
+
Notes
|
|
322
|
+
-----
|
|
323
|
+
The function applies a prefilter to the data and trims the input time series to
|
|
324
|
+
the specified duration. It supports both single correlation and matrix correlation
|
|
325
|
+
modes. In matrix mode, all components are correlated against each other and
|
|
326
|
+
results are saved to NIfTI files and CSV tables. In single mode, correlations are
|
|
327
|
+
computed between two time series and results are saved to text files.
|
|
328
|
+
|
|
329
|
+
Examples
|
|
330
|
+
--------
|
|
331
|
+
>>> import argparse
|
|
332
|
+
>>> args = argparse.Namespace(
|
|
333
|
+
... infilename1='data1.txt',
|
|
334
|
+
... infilename2='data2.txt',
|
|
335
|
+
... samplerate=100,
|
|
336
|
+
... starttime=0,
|
|
337
|
+
... duration=1000,
|
|
338
|
+
... stepsize=10,
|
|
339
|
+
... windowwidth=20,
|
|
340
|
+
... lagmin=-5,
|
|
341
|
+
... lagmax=5,
|
|
342
|
+
... corrweighting='uniform',
|
|
343
|
+
... windowfunc='hanning',
|
|
344
|
+
... detrendorder=1,
|
|
345
|
+
... invert=False,
|
|
346
|
+
... display=False,
|
|
347
|
+
... debug=False,
|
|
348
|
+
... outfilename='output',
|
|
349
|
+
... corrthresh=0.3,
|
|
350
|
+
... filter={}
|
|
351
|
+
... )
|
|
352
|
+
>>> showstxcorr(args)
|
|
353
|
+
"""
|
|
197
354
|
# get the command line parameters
|
|
198
355
|
verbose = True
|
|
199
356
|
matrixoutput = False
|
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.
|
|
@@ -21,10 +21,12 @@ import warnings
|
|
|
21
21
|
warnings.simplefilter(action="ignore", category=FutureWarning)
|
|
22
22
|
import argparse
|
|
23
23
|
import sys
|
|
24
|
+
from argparse import Namespace
|
|
24
25
|
|
|
25
26
|
import matplotlib.cm as cm
|
|
26
27
|
import numpy as np
|
|
27
28
|
from matplotlib.pyplot import figure, savefig, setp, show
|
|
29
|
+
from numpy.typing import NDArray
|
|
28
30
|
|
|
29
31
|
import rapidtide.filter as tide_filt
|
|
30
32
|
import rapidtide.fit as tide_fit
|
|
@@ -41,11 +43,79 @@ except ImportError:
|
|
|
41
43
|
haveseaborn = False
|
|
42
44
|
|
|
43
45
|
|
|
44
|
-
def phase(mcv):
|
|
46
|
+
def phase(mcv: NDArray[np.complex128]) -> NDArray[np.float64]:
|
|
47
|
+
"""
|
|
48
|
+
Compute the phase angle of complex numbers.
|
|
49
|
+
|
|
50
|
+
This function calculates the phase angle (also known as the argument) of complex numbers
|
|
51
|
+
using the arctan2 function, which correctly handles all quadrants and avoids division
|
|
52
|
+
by zero errors that could occur with the standard arctan function.
|
|
53
|
+
|
|
54
|
+
Parameters
|
|
55
|
+
----------
|
|
56
|
+
mcv : ndarray of complex128
|
|
57
|
+
Input array of complex numbers for which to compute the phase angles.
|
|
58
|
+
|
|
59
|
+
Returns
|
|
60
|
+
-------
|
|
61
|
+
ndarray of float64
|
|
62
|
+
Array of phase angles in radians, with values in the range [-π, π].
|
|
63
|
+
The phase angle is computed as atan2(imaginary_part, real_part).
|
|
64
|
+
|
|
65
|
+
Notes
|
|
66
|
+
-----
|
|
67
|
+
The phase angle is computed using `np.arctan2(mcv.imag, mcv.real)` which correctly
|
|
68
|
+
handles the quadrant determination and avoids ambiguity that would occur with
|
|
69
|
+
`np.arctan(mcv.imag / mcv.real)`.
|
|
70
|
+
|
|
71
|
+
Examples
|
|
72
|
+
--------
|
|
73
|
+
>>> import numpy as np
|
|
74
|
+
>>> z = np.array([1+0j, 0+1j, -1+0j, 0-1j])
|
|
75
|
+
>>> phase(z)
|
|
76
|
+
array([ 0. , 1.57079633, 3.14159265, -1.57079633])
|
|
77
|
+
|
|
78
|
+
>>> z = np.array([1+1j, -1+1j, -1-1j, 1-1j])
|
|
79
|
+
>>> phase(z)
|
|
80
|
+
array([ 0.78539816, 2.35619449, -2.35619449, -0.78539816])
|
|
81
|
+
"""
|
|
45
82
|
return np.arctan2(mcv.imag, mcv.real)
|
|
46
83
|
|
|
47
84
|
|
|
48
|
-
def _get_parser():
|
|
85
|
+
def _get_parser() -> argparse.ArgumentParser:
|
|
86
|
+
"""
|
|
87
|
+
Create and configure an argument parser for the showtc command-line tool.
|
|
88
|
+
|
|
89
|
+
This function constructs an `argparse.ArgumentParser` object with a set of
|
|
90
|
+
predefined arguments for plotting data from text files. It supports various
|
|
91
|
+
display modes, sampling options, and plotting configurations.
|
|
92
|
+
|
|
93
|
+
Returns
|
|
94
|
+
-------
|
|
95
|
+
argparse.ArgumentParser
|
|
96
|
+
Configured argument parser for the showtc tool.
|
|
97
|
+
|
|
98
|
+
Notes
|
|
99
|
+
-----
|
|
100
|
+
The parser includes support for:
|
|
101
|
+
|
|
102
|
+
- Input file specification with optional column selections
|
|
103
|
+
- Sampling rate or sample time configuration
|
|
104
|
+
- Display mode options: time series, power spectrum, or phase spectrum
|
|
105
|
+
- Plot format options: overlaid, separate, or separately linked
|
|
106
|
+
- Waterfall plotting for multiple timecourses
|
|
107
|
+
- Data normalization and transposition
|
|
108
|
+
- Plot appearance customization via `pf.addplotopts`
|
|
109
|
+
- Time range selection and header skipping
|
|
110
|
+
- Debugging and version information
|
|
111
|
+
|
|
112
|
+
Examples
|
|
113
|
+
--------
|
|
114
|
+
>>> parser = _get_parser()
|
|
115
|
+
>>> args = parser.parse_args(['file1.txt', 'file2.txt'])
|
|
116
|
+
>>> print(args.textfilenames)
|
|
117
|
+
['file1.txt', 'file2.txt']
|
|
118
|
+
"""
|
|
49
119
|
parser = argparse.ArgumentParser(
|
|
50
120
|
prog="showtc",
|
|
51
121
|
description="Plots the data in text files.",
|
|
@@ -165,6 +235,13 @@ def _get_parser():
|
|
|
165
235
|
help="Skip NUM lines at the beginning of each file (to get past header lines).",
|
|
166
236
|
default=0,
|
|
167
237
|
)
|
|
238
|
+
parser.add_argument(
|
|
239
|
+
"--fullxrange",
|
|
240
|
+
dest="fullxrange",
|
|
241
|
+
action="store_true",
|
|
242
|
+
help="Set xrange to be the overall range of all files.",
|
|
243
|
+
default=False,
|
|
244
|
+
)
|
|
168
245
|
parser.add_argument(
|
|
169
246
|
"--debug",
|
|
170
247
|
dest="debug",
|
|
@@ -179,7 +256,93 @@ def _get_parser():
|
|
|
179
256
|
return parser
|
|
180
257
|
|
|
181
258
|
|
|
182
|
-
def showtc(args):
|
|
259
|
+
def showtc(args: Namespace) -> None:
|
|
260
|
+
"""
|
|
261
|
+
Display time series or spectral data from text files with customizable plotting options.
|
|
262
|
+
|
|
263
|
+
This function reads time series data from one or more text files and plots it
|
|
264
|
+
in either time domain or frequency domain (power or phase). It supports various
|
|
265
|
+
display modes, plot formatting options, and customization of colors, legends,
|
|
266
|
+
and axis labels.
|
|
267
|
+
|
|
268
|
+
Parameters
|
|
269
|
+
----------
|
|
270
|
+
args : argparse.Namespace
|
|
271
|
+
A namespace object containing the following attributes:
|
|
272
|
+
- samplerate : float or str
|
|
273
|
+
Sampling rate of the data. If "auto", defaults to 1.0.
|
|
274
|
+
- displaymode : str
|
|
275
|
+
Display mode: "time", "power", or "phase".
|
|
276
|
+
- plotformat : str
|
|
277
|
+
Plot formatting: "overlaid", "separate", or "separatelinked".
|
|
278
|
+
- colors : str, optional
|
|
279
|
+
Comma-separated list of color names for the lines.
|
|
280
|
+
- legends : str, optional
|
|
281
|
+
Comma-separated list of legend labels.
|
|
282
|
+
- dolegend : bool
|
|
283
|
+
Whether to display legends.
|
|
284
|
+
- linewidths : str, optional
|
|
285
|
+
Comma-separated list of line widths.
|
|
286
|
+
- legendloc : int
|
|
287
|
+
Legend location (0-10).
|
|
288
|
+
- thestarttime : float, optional
|
|
289
|
+
Start time for data selection.
|
|
290
|
+
- theendtime : float, optional
|
|
291
|
+
End time for data selection.
|
|
292
|
+
- textfilenames : list of str
|
|
293
|
+
List of text file names to read data from.
|
|
294
|
+
- dotranspose : bool
|
|
295
|
+
Whether to transpose the input data.
|
|
296
|
+
- normall : bool
|
|
297
|
+
Whether to normalize all data.
|
|
298
|
+
- fullxrange : bool
|
|
299
|
+
Whether to use full x-axis range.
|
|
300
|
+
- voffset : float
|
|
301
|
+
Vertical offset for overlaid plots.
|
|
302
|
+
- dowaterfall : bool
|
|
303
|
+
Whether to create a waterfall plot.
|
|
304
|
+
- fontscalefac : float
|
|
305
|
+
Font scaling factor.
|
|
306
|
+
- thetitle : str, optional
|
|
307
|
+
Title for the plot.
|
|
308
|
+
- xlabel : str, optional
|
|
309
|
+
X-axis label.
|
|
310
|
+
- ylabel : str, optional
|
|
311
|
+
Y-axis label.
|
|
312
|
+
- showxax : bool
|
|
313
|
+
Whether to show x-axis labels.
|
|
314
|
+
- showyax : bool
|
|
315
|
+
Whether to show y-axis labels.
|
|
316
|
+
- outputfile : str, optional
|
|
317
|
+
Output file name for saving the plot.
|
|
318
|
+
- saveres : int
|
|
319
|
+
Resolution for saved plots.
|
|
320
|
+
- debug : bool
|
|
321
|
+
Whether to print debug information.
|
|
322
|
+
|
|
323
|
+
Returns
|
|
324
|
+
-------
|
|
325
|
+
None
|
|
326
|
+
This function does not return a value but displays or saves the plot.
|
|
327
|
+
|
|
328
|
+
Notes
|
|
329
|
+
-----
|
|
330
|
+
- The function handles multiple input files and concatenates data.
|
|
331
|
+
- Spectral data is computed using Hamming windowing by default.
|
|
332
|
+
- Time series data is plotted with time on x-axis and values on y-axis.
|
|
333
|
+
- Spectral data is plotted with frequency on x-axis and either power or phase on y-axis.
|
|
334
|
+
- The function supports automatic detection of file types and column specifications.
|
|
335
|
+
|
|
336
|
+
Examples
|
|
337
|
+
--------
|
|
338
|
+
>>> import argparse
|
|
339
|
+
>>> args = argparse.Namespace()
|
|
340
|
+
>>> args.samplerate = 1.0
|
|
341
|
+
>>> args.displaymode = "time"
|
|
342
|
+
>>> args.plotformat = "separate"
|
|
343
|
+
>>> args.textfilenames = ["data1.txt", "data2.txt"]
|
|
344
|
+
>>> showtc(args)
|
|
345
|
+
"""
|
|
183
346
|
# set the sample rate
|
|
184
347
|
if args.samplerate == "auto":
|
|
185
348
|
samplerate = 1.0
|
|
@@ -399,11 +562,7 @@ def showtc(args):
|
|
|
399
562
|
else:
|
|
400
563
|
linelabels.append(thisfilename)
|
|
401
564
|
else:
|
|
402
|
-
linelabels.append(legends[
|
|
403
|
-
"""if invecs.shape[0] > 1:
|
|
404
|
-
linelabels.append(legends[i % len(legends)] + '_column' + str(j).zfill(2))
|
|
405
|
-
else:
|
|
406
|
-
linelabels.append(legends[i % len(legends)])"""
|
|
565
|
+
linelabels.append(legends[j % len(legends)])
|
|
407
566
|
samplerates.append(thissamplerate + 0.0)
|
|
408
567
|
if args.debug:
|
|
409
568
|
print(
|
|
@@ -429,7 +588,10 @@ def showtc(args):
|
|
|
429
588
|
for thevec in xvecs:
|
|
430
589
|
overallxmax = np.max([np.max(thevec), overallxmax])
|
|
431
590
|
overallxmin = np.min([np.min(thevec), overallxmin])
|
|
432
|
-
|
|
591
|
+
if args.fullxrange:
|
|
592
|
+
xrange = (overallxmin, overallxmax)
|
|
593
|
+
else:
|
|
594
|
+
xrange = (np.max([overallxmin, args.thestarttime]), np.min([overallxmax, args.theendtime]))
|
|
433
595
|
ymins = []
|
|
434
596
|
ymaxs = []
|
|
435
597
|
for thevec in yvecs:
|