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.
Files changed (231) hide show
  1. rapidtide/Colortables.py +1 -1
  2. rapidtide/DerivativeDelay.py +1 -1
  3. rapidtide/OrthoImageItem.py +1 -1
  4. rapidtide/RapidtideDataset.py +3 -1
  5. rapidtide/RegressorRefiner.py +1 -1
  6. rapidtide/calcandfitcorrpairs.py +1 -1
  7. rapidtide/calccoherence.py +1 -1
  8. rapidtide/calcnullsimfunc.py +1 -1
  9. rapidtide/calcsimfunc.py +1 -1
  10. rapidtide/correlate.py +1 -1
  11. rapidtide/data/examples/src/test_findmaxlag.py +1 -1
  12. rapidtide/data/examples/src/testfmri +3 -2
  13. rapidtide/data/examples/src/testfuncs +1 -1
  14. rapidtide/data/examples/src/testhappy +12 -1
  15. rapidtide/data/examples/src/testmodels +33 -0
  16. rapidtide/data/models/model_cnn_w064_l13_fn20_fl08/loss.png +0 -0
  17. rapidtide/data/models/model_cnn_w064_l13_fn20_fl08/loss.txt +1 -0
  18. rapidtide/data/models/model_cnn_w064_l13_fn20_fl08/model.keras +0 -0
  19. rapidtide/data/models/model_cnn_w064_l13_fn20_fl08/model_meta.json +167 -0
  20. rapidtide/data/models/model_revised_tf2/model.keras +0 -0
  21. rapidtide/data/models/{model_serdar → model_revised_tf2}/model_meta.json +1 -1
  22. rapidtide/data/models/model_serdar2_tf2/model.keras +0 -0
  23. rapidtide/data/models/{model_serdar2 → model_serdar2_tf2}/model_meta.json +1 -1
  24. rapidtide/data/models/model_serdar_tf2/model.keras +0 -0
  25. rapidtide/data/models/{model_revised → model_serdar_tf2}/model_meta.json +1 -1
  26. rapidtide/dlfilter.py +325 -241
  27. rapidtide/externaltools.py +1 -1
  28. rapidtide/fMRIData_class.py +1 -1
  29. rapidtide/filter.py +1 -8
  30. rapidtide/fit.py +1 -8
  31. rapidtide/happy_supportfuncs.py +30 -1
  32. rapidtide/helper_classes.py +1 -1
  33. rapidtide/io.py +1 -1
  34. rapidtide/linfitfiltpass.py +1 -1
  35. rapidtide/makelaggedtcs.py +1 -1
  36. rapidtide/maskutil.py +1 -1
  37. rapidtide/miscmath.py +1 -8
  38. rapidtide/multiproc.py +1 -1
  39. rapidtide/patchmatch.py +1 -1
  40. rapidtide/peakeval.py +1 -1
  41. rapidtide/qualitycheck.py +1 -1
  42. rapidtide/refinedelay.py +1 -3
  43. rapidtide/refineregressor.py +1 -1
  44. rapidtide/resample.py +1 -1
  45. rapidtide/scripts/adjustoffset.py +1 -1
  46. rapidtide/scripts/aligntcs.py +1 -1
  47. rapidtide/scripts/applydlfilter.py +1 -1
  48. rapidtide/scripts/atlasaverage.py +1 -1
  49. rapidtide/scripts/atlastool.py +1 -1
  50. rapidtide/scripts/calcicc.py +1 -1
  51. rapidtide/scripts/calctexticc.py +1 -1
  52. rapidtide/scripts/calcttest.py +1 -1
  53. rapidtide/scripts/ccorrica.py +1 -1
  54. rapidtide/scripts/delayvar.py +2 -2
  55. rapidtide/scripts/diffrois.py +1 -1
  56. rapidtide/scripts/endtidalproc.py +1 -1
  57. rapidtide/scripts/fdica.py +1 -1
  58. rapidtide/scripts/filtnifti.py +1 -1
  59. rapidtide/scripts/filttc.py +1 -1
  60. rapidtide/scripts/fingerprint.py +1 -1
  61. rapidtide/scripts/fixtr.py +1 -1
  62. rapidtide/scripts/gmscalc.py +1 -1
  63. rapidtide/scripts/happy.py +1 -1
  64. rapidtide/scripts/happy2std.py +1 -1
  65. rapidtide/scripts/happywarp.py +1 -1
  66. rapidtide/scripts/histnifti.py +1 -1
  67. rapidtide/scripts/histtc.py +1 -1
  68. rapidtide/scripts/linfitfilt.py +1 -1
  69. rapidtide/scripts/localflow.py +1 -1
  70. rapidtide/scripts/mergequality.py +1 -1
  71. rapidtide/scripts/pairproc.py +1 -1
  72. rapidtide/scripts/pairwisemergenifti.py +1 -1
  73. rapidtide/scripts/physiofreq.py +1 -1
  74. rapidtide/scripts/pixelcomp.py +1 -1
  75. rapidtide/scripts/plethquality.py +1 -1
  76. rapidtide/scripts/polyfitim.py +1 -1
  77. rapidtide/scripts/proj2flow.py +1 -1
  78. rapidtide/scripts/rankimage.py +1 -1
  79. rapidtide/scripts/rapidtide.py +1 -1
  80. rapidtide/scripts/rapidtide2std.py +1 -1
  81. rapidtide/scripts/resamplenifti.py +1 -1
  82. rapidtide/scripts/resampletc.py +1 -1
  83. rapidtide/scripts/retrolagtcs.py +1 -1
  84. rapidtide/scripts/retroregress.py +1 -1
  85. rapidtide/scripts/roisummarize.py +1 -1
  86. rapidtide/scripts/runqualitycheck.py +1 -1
  87. rapidtide/scripts/showarbcorr.py +1 -1
  88. rapidtide/scripts/showhist.py +1 -1
  89. rapidtide/scripts/showstxcorr.py +1 -1
  90. rapidtide/scripts/showtc.py +1 -1
  91. rapidtide/scripts/showxcorr_legacy.py +1 -1
  92. rapidtide/scripts/showxcorrx.py +1 -1
  93. rapidtide/scripts/showxy.py +1 -1
  94. rapidtide/scripts/simdata.py +1 -1
  95. rapidtide/scripts/spatialdecomp.py +1 -1
  96. rapidtide/scripts/spatialfit.py +1 -1
  97. rapidtide/scripts/spatialmi.py +1 -1
  98. rapidtide/scripts/spectrogram.py +1 -1
  99. rapidtide/scripts/stupidramtricks.py +1 -1
  100. rapidtide/scripts/synthASL.py +1 -1
  101. rapidtide/scripts/tcfrom2col.py +1 -1
  102. rapidtide/scripts/tcfrom3col.py +1 -1
  103. rapidtide/scripts/temporaldecomp.py +1 -1
  104. rapidtide/scripts/testhrv.py +1 -1
  105. rapidtide/scripts/threeD.py +1 -1
  106. rapidtide/scripts/tidepool.py +1 -1
  107. rapidtide/scripts/variabilityizer.py +1 -1
  108. rapidtide/simfuncfit.py +1 -1
  109. rapidtide/stats.py +1 -8
  110. rapidtide/tests/cleanposttest +1 -1
  111. rapidtide/tests/resethappytargets +1 -1
  112. rapidtide/tests/resetrapidtidetargets +1 -1
  113. rapidtide/tests/resettargets +1 -1
  114. rapidtide/tests/runlocaltest +1 -1
  115. rapidtide/tests/showkernels +1 -1
  116. rapidtide/tests/test_aliasedcorrelate.py +1 -1
  117. rapidtide/tests/test_aligntcs.py +1 -1
  118. rapidtide/tests/test_calcicc.py +1 -1
  119. rapidtide/tests/test_congrid.py +1 -1
  120. rapidtide/tests/test_correlate.py +1 -1
  121. rapidtide/tests/test_corrpass.py +1 -1
  122. rapidtide/tests/test_delayestimation.py +1 -1
  123. rapidtide/tests/test_doresample.py +1 -1
  124. rapidtide/tests/test_fastresampler.py +1 -1
  125. rapidtide/tests/test_findmaxlag.py +1 -1
  126. rapidtide/tests/test_fullrunhappy_v1.py +2 -2
  127. rapidtide/tests/test_fullrunhappy_v2.py +2 -2
  128. rapidtide/tests/test_fullrunhappy_v3.py +2 -2
  129. rapidtide/tests/test_fullrunhappy_v4.py +2 -2
  130. rapidtide/tests/test_fullrunhappy_v5.py +1 -3
  131. rapidtide/tests/test_fullrunrapidtide_v1.py +1 -1
  132. rapidtide/tests/test_fullrunrapidtide_v2.py +3 -1
  133. rapidtide/tests/test_fullrunrapidtide_v3.py +1 -1
  134. rapidtide/tests/test_fullrunrapidtide_v4.py +1 -1
  135. rapidtide/tests/test_fullrunrapidtide_v5.py +1 -1
  136. rapidtide/tests/test_fullrunrapidtide_v6.py +1 -1
  137. rapidtide/tests/test_io.py +1 -1
  138. rapidtide/tests/test_linfitfiltpass.py +1 -1
  139. rapidtide/tests/test_mi.py +1 -1
  140. rapidtide/tests/test_miscmath.py +1 -1
  141. rapidtide/tests/test_motionregress.py +1 -1
  142. rapidtide/tests/test_nullcorr.py +1 -1
  143. rapidtide/tests/test_padvec.py +1 -1
  144. rapidtide/tests/test_phaseanalysis.py +1 -1
  145. rapidtide/tests/test_rapidtideparser.py +1 -1
  146. rapidtide/tests/test_refinedelay.py +1 -2
  147. rapidtide/tests/test_runmisc.py +1 -1
  148. rapidtide/tests/test_sharedmem.py +1 -1
  149. rapidtide/tests/test_simulate.py +1 -1
  150. rapidtide/tests/test_stcorrelate.py +1 -1
  151. rapidtide/tests/test_timeshift.py +1 -1
  152. rapidtide/tests/test_valtoindex.py +1 -1
  153. rapidtide/tests/test_zRapidtideDataset.py +1 -1
  154. rapidtide/tests/utils.py +1 -1
  155. rapidtide/transformerdlfilter.py +2 -4
  156. rapidtide/util.py +37 -14
  157. rapidtide/voxelData.py +278 -0
  158. rapidtide/wiener.py +1 -1
  159. rapidtide/wiener2.py +1 -1
  160. rapidtide/workflows/adjustoffset.py +1 -1
  161. rapidtide/workflows/aligntcs.py +1 -1
  162. rapidtide/workflows/applydlfilter.py +20 -65
  163. rapidtide/workflows/atlasaverage.py +1 -1
  164. rapidtide/workflows/atlastool.py +1 -1
  165. rapidtide/workflows/calctexticc.py +1 -1
  166. rapidtide/workflows/ccorrica.py +1 -1
  167. rapidtide/workflows/cleanregressor.py +243 -0
  168. rapidtide/workflows/delayestimation.py +488 -0
  169. rapidtide/workflows/delayvar.py +1 -1
  170. rapidtide/workflows/diffrois.py +1 -1
  171. rapidtide/workflows/endtidalproc.py +1 -1
  172. rapidtide/workflows/fdica.py +1 -1
  173. rapidtide/workflows/filtnifti.py +1 -1
  174. rapidtide/workflows/filttc.py +1 -1
  175. rapidtide/workflows/fixtr.py +1 -1
  176. rapidtide/workflows/gmscalc.py +1 -1
  177. rapidtide/workflows/happy.py +49 -3
  178. rapidtide/workflows/happy2std.py +1 -1
  179. rapidtide/workflows/happy_parser.py +30 -6
  180. rapidtide/workflows/histnifti.py +1 -1
  181. rapidtide/workflows/histtc.py +1 -1
  182. rapidtide/workflows/linfitfilt.py +1 -1
  183. rapidtide/workflows/localflow.py +1 -1
  184. rapidtide/workflows/mergequality.py +1 -1
  185. rapidtide/workflows/niftidecomp.py +1 -1
  186. rapidtide/workflows/niftistats.py +1 -1
  187. rapidtide/workflows/pairproc.py +1 -1
  188. rapidtide/workflows/pairwisemergenifti.py +1 -1
  189. rapidtide/workflows/parser_funcs.py +1 -1
  190. rapidtide/workflows/physiofreq.py +1 -1
  191. rapidtide/workflows/pixelcomp.py +1 -1
  192. rapidtide/workflows/plethquality.py +1 -1
  193. rapidtide/workflows/polyfitim.py +1 -1
  194. rapidtide/workflows/proj2flow.py +1 -1
  195. rapidtide/workflows/rankimage.py +1 -1
  196. rapidtide/workflows/rapidtide.py +163 -679
  197. rapidtide/workflows/rapidtide2std.py +1 -1
  198. rapidtide/workflows/rapidtide_parser.py +1 -98
  199. rapidtide/workflows/regressfrommaps.py +4 -48
  200. rapidtide/workflows/resamplenifti.py +1 -1
  201. rapidtide/workflows/resampletc.py +1 -1
  202. rapidtide/workflows/retrolagtcs.py +1 -1
  203. rapidtide/workflows/retroregress.py +1 -1
  204. rapidtide/workflows/roisummarize.py +1 -1
  205. rapidtide/workflows/runqualitycheck.py +1 -1
  206. rapidtide/workflows/showarbcorr.py +1 -1
  207. rapidtide/workflows/showhist.py +1 -1
  208. rapidtide/workflows/showstxcorr.py +1 -1
  209. rapidtide/workflows/showtc.py +1 -1
  210. rapidtide/workflows/showxcorrx.py +1 -1
  211. rapidtide/workflows/showxy.py +1 -1
  212. rapidtide/workflows/simdata.py +1 -1
  213. rapidtide/workflows/spatialfit.py +1 -1
  214. rapidtide/workflows/spatialmi.py +1 -1
  215. rapidtide/workflows/spectrogram.py +1 -1
  216. rapidtide/workflows/synthASL.py +1 -1
  217. rapidtide/workflows/tcfrom2col.py +1 -1
  218. rapidtide/workflows/tcfrom3col.py +1 -1
  219. rapidtide/workflows/tidepool.py +2 -1
  220. rapidtide/workflows/utils.py +1 -1
  221. rapidtide/workflows/variabilityizer.py +1 -1
  222. {rapidtide-3.0a14.dist-info → rapidtide-3.0a15.dist-info}/METADATA +1 -1
  223. rapidtide-3.0a15.dist-info/RECORD +353 -0
  224. {rapidtide-3.0a14.dist-info → rapidtide-3.0a15.dist-info}/WHEEL +1 -1
  225. rapidtide/data/models/model_revised/model.h5 +0 -0
  226. rapidtide/data/models/model_serdar/model.h5 +0 -0
  227. rapidtide/data/models/model_serdar2/model.h5 +0 -0
  228. rapidtide-3.0a14.dist-info/RECORD +0 -345
  229. {rapidtide-3.0a14.dist-info → rapidtide-3.0a15.dist-info}/entry_points.txt +0 -0
  230. {rapidtide-3.0a14.dist-info → rapidtide-3.0a15.dist-info}/licenses/LICENSE +0 -0
  231. {rapidtide-3.0a14.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 2018-2024 Blaise Frederick
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
  )
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2016-2024 Blaise Frederick
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-2024 Blaise Frederick
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 model_revised - "
104
+ f"Use model MODELNAME for dl filter (default is {DEFAULT_DL_MODEL} - "
103
105
  "from the revised NeuroImage paper.) "
104
106
  ),
105
- default="model_revised",
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="motionfilename",
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
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2016-2024 Blaise Frederick
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-2024 Blaise Frederick
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-2024 Blaise Frederick
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-2024 Blaise Frederick
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-2024 Blaise Frederick
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-2024 Blaise Frederick
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-2024 Blaise Frederick
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-2024 Blaise Frederick
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-2024 Blaise Frederick
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-2024 Blaise Frederick
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-2024 Blaise Frederick
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-2024 Blaise Frederick
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-2024 Blaise Frederick
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-2024 Blaise Frederick
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-2024 Blaise Frederick
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-2024 Blaise Frederick
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.