rapidtide 3.0a10__py3-none-any.whl → 3.0a11__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 CHANGED
@@ -63,37 +63,55 @@ def setendalpha(thestate, alpha, debug=False):
63
63
  def gen_thermal_state():
64
64
  from pyqtgraph.graphicsItems.GradientEditorItem import Gradients
65
65
 
66
- return Gradients["thermal"]
66
+ thegradient = Gradients["thermal"]
67
+ thegradient["name"] = "thermal"
68
+ return thegradient
69
+ #return Gradients["thermal"]
67
70
 
68
71
 
69
72
  def gen_flame_state():
70
73
  from pyqtgraph.graphicsItems.GradientEditorItem import Gradients
71
74
 
72
- return Gradients["flame"]
75
+ thegradient = Gradients["flame"]
76
+ thegradient["name"] = "flame"
77
+ return thegradient
78
+ #return Gradients["flame"]
73
79
 
74
80
 
75
81
  def gen_yellowy_state():
76
82
  from pyqtgraph.graphicsItems.GradientEditorItem import Gradients
77
83
 
78
- return Gradients["yellowy"]
84
+ thegradient = Gradients["yellowy"]
85
+ thegradient["name"] = "yellowy"
86
+ return thegradient
87
+ #return Gradients["yellowy"]
79
88
 
80
89
 
81
90
  def gen_bipolar_state():
82
91
  from pyqtgraph.graphicsItems.GradientEditorItem import Gradients
83
92
 
84
- return Gradients["bipolar"]
93
+ thegradient = Gradients["bipolar"]
94
+ thegradient["name"] = "bipolar"
95
+ return thegradient
96
+ #return Gradients["bipolar"]
85
97
 
86
98
 
87
99
  def gen_spectrum_state():
88
100
  from pyqtgraph.graphicsItems.GradientEditorItem import Gradients
89
101
 
90
- return Gradients["spectrum"]
102
+ thegradient = Gradients["spectrum"]
103
+ thegradient["name"] = "spectrum"
104
+ return thegradient
105
+ #return Gradients["spectrum"]
91
106
 
92
107
 
93
108
  def gen_turbo_state():
94
109
  from pyqtgraph.graphicsItems.GradientEditorItem import Gradients
95
110
 
96
- return Gradients["turbo"]
111
+ thegradient = Gradients["turbo"]
112
+ thegradient["name"] = "turbo"
113
+ return thegradient
114
+ #return Gradients["turbo"]
97
115
 
98
116
 
99
117
  def gen_gray_state():
@@ -103,6 +121,7 @@ def gen_gray_state():
103
121
  (1.0000, (255, 255, 255, 255)),
104
122
  ],
105
123
  "mode": "rgb",
124
+ "name": "gray",
106
125
  }
107
126
 
108
127
 
@@ -113,31 +132,44 @@ def gen_grey_state():
113
132
  (1.0000, (255, 255, 255, 255)),
114
133
  ],
115
134
  "mode": "rgb",
135
+ "name": "grey",
116
136
  }
117
137
 
118
138
 
119
139
  def gen_viridis_state():
120
140
  from pyqtgraph.graphicsItems.GradientEditorItem import Gradients
121
141
 
122
- return Gradients["viridis"]
142
+ thegradient = Gradients["viridis"]
143
+ thegradient["name"] = "viridis"
144
+ return thegradient
145
+ #return Gradients["viridis"]
123
146
 
124
147
 
125
148
  def gen_inferno_state():
126
149
  from pyqtgraph.graphicsItems.GradientEditorItem import Gradients
127
150
 
128
- return Gradients["inferno"]
151
+ thegradient = Gradients["inferno"]
152
+ thegradient["name"] = "inferno"
153
+ return thegradient
154
+ #return Gradients["inferno"]
129
155
 
130
156
 
131
157
  def gen_plasma_state():
132
158
  from pyqtgraph.graphicsItems.GradientEditorItem import Gradients
133
159
 
134
- return Gradients["plasma"]
160
+ thegradient = Gradients["plasma"]
161
+ thegradient["name"] = "plasma"
162
+ return thegradient
163
+ #return Gradients["plasma"]
135
164
 
136
165
 
137
166
  def gen_magma_state():
138
167
  from pyqtgraph.graphicsItems.GradientEditorItem import Gradients
139
168
 
140
- return Gradients["magma"]
169
+ thegradient = Gradients["magma"]
170
+ thegradient["name"] = "magma"
171
+ return thegradient
172
+ #return Gradients["magma"]
141
173
 
142
174
 
143
175
  def gen_g2y2r_state():
@@ -150,6 +182,7 @@ def gen_g2y2r_state():
150
182
  (1.0000, (255, 0, 0, 0)),
151
183
  ],
152
184
  "mode": "rgb",
185
+ "name": "g2y2r",
153
186
  }
154
187
 
155
188
 
@@ -157,6 +190,7 @@ def gen_mask_state():
157
190
  return {
158
191
  "ticks": [(0.0000, (0, 0, 0, 255)), (1.0000, (255, 255, 255, 0))],
159
192
  "mode": "rgb",
193
+ "name": "mask",
160
194
  }
161
195
 
162
196
 
@@ -168,6 +202,7 @@ def gen_greyclip_state():
168
202
  (1.0, (255, 0, 0, 255)),
169
203
  ],
170
204
  "mode": "rgb",
205
+ "name": "greyclip",
171
206
  }
172
207
 
173
208
 
@@ -161,6 +161,7 @@ class Timecourse:
161
161
 
162
162
  class Overlay:
163
163
  "Store a data overlay and some information about it"
164
+ LUTname = None
164
165
 
165
166
  def __init__(
166
167
  self,
@@ -193,6 +194,7 @@ class Overlay:
193
194
  self.namebase = namebase
194
195
  if self.verbose > 1:
195
196
  print("reading map ", self.name, " from ", self.filename, "...")
197
+ self.maskhash = 0
196
198
  self.invertonload = invertonload
197
199
  self.readImageData(isaMask=isaMask)
198
200
  self.mask = None
@@ -277,6 +279,7 @@ class Overlay:
277
279
 
278
280
  def updateStats(self):
279
281
  calcmaskeddata = self.data[np.where(self.mask != 0)]
282
+
280
283
  self.minval = calcmaskeddata.min()
281
284
  self.maxval = calcmaskeddata.max()
282
285
  (
@@ -290,6 +293,7 @@ class Overlay:
290
293
  calcmaskeddata, bins=np.linspace(self.minval, self.maxval, 200)
291
294
  )
292
295
  self.quartiles = [self.pct25, self.pct50, self.pct75]
296
+
293
297
  if self.verbose > 1:
294
298
  print(
295
299
  self.name,
@@ -402,9 +406,17 @@ class Overlay:
402
406
 
403
407
  def maskData(self):
404
408
  self.mask = self.geommask * self.funcmask
405
- self.maskeddata = self.data.copy()
406
- self.maskeddata[np.where(self.mask < 0.5)] = 0.0
407
- self.updateStats()
409
+ maskhash = hash(self.mask.tostring())
410
+ # these operations are expensive, so only do them if the mask is changed
411
+ if (maskhash == self.maskhash) and (self.verbose > 1):
412
+ print("mask has not changed")
413
+ else:
414
+ if self.verbose > 1:
415
+ print("mask changed - recalculating")
416
+ self.maskeddata = self.data.copy()
417
+ self.maskeddata[np.where(self.mask < 0.5)] = 0.0
418
+ self.updateStats()
419
+ self.maskhash = maskhash
408
420
 
409
421
  def setReport(self, report):
410
422
  self.report = report
@@ -433,6 +445,7 @@ class Overlay:
433
445
  self.lut_state = setendalpha(lut_state, endalpha)
434
446
  self.gradient.restoreState(self.lut_state)
435
447
  self.theLUT = self.gradient.getLookupTable(512, alpha=True)
448
+ self.LUTname = lut_state["name"]
436
449
 
437
450
  def setisdisplayed(self, display_state):
438
451
  self.display_state = display_state
@@ -505,6 +518,7 @@ class RapidtideDataset:
505
518
  fileroot,
506
519
  anatname=None,
507
520
  geommaskname=None,
521
+ funcmaskname=None,
508
522
  graymaskspec=None,
509
523
  whitemaskspec=None,
510
524
  userise=False,
@@ -523,6 +537,7 @@ class RapidtideDataset:
523
537
  self.fileroot = fileroot
524
538
  self.anatname = anatname
525
539
  self.geommaskname = geommaskname
540
+ self.funcmaskname = funcmaskname
526
541
  self.graymaskspec = graymaskspec
527
542
  self.whitemaskspec = whitemaskspec
528
543
  self.userise = userise
@@ -1355,3 +1370,6 @@ class RapidtideDataset:
1355
1370
  self.focusmap = whichmap
1356
1371
  except KeyError:
1357
1372
  self.focusmap = "lagtimes"
1373
+
1374
+ def setFuncMaskName(self, maskname):
1375
+ self.funcmaskname = maskname
rapidtide/__init__.py CHANGED
@@ -1,4 +1,3 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  from . import _version
3
-
4
- __version__ = _version.get_versions()["version"]
3
+ __version__ = _version.get_versions()['version']
rapidtide/_version.py CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  # This file helps to compute a version number in source trees obtained from
2
3
  # git-archive tarball (such as those provided by githubs download-from-tag
3
4
  # feature). Distribution tarballs (built by setup.py sdist) and build
@@ -11,12 +12,12 @@
11
12
  """Git implementation of _version.py."""
12
13
 
13
14
  import errno
14
- import functools
15
15
  import os
16
16
  import re
17
17
  import subprocess
18
18
  import sys
19
19
  from typing import Any, Callable, Dict, List, Optional, Tuple
20
+ import functools
20
21
 
21
22
 
22
23
  def get_keywords() -> Dict[str, str]:
@@ -67,14 +68,12 @@ HANDLERS: Dict[str, Dict[str, Callable]] = {}
67
68
 
68
69
  def register_vcs_handler(vcs: str, method: str) -> Callable: # decorator
69
70
  """Create decorator to mark a method as the handler of a VCS."""
70
-
71
71
  def decorate(f: Callable) -> Callable:
72
72
  """Store f in HANDLERS[vcs][method]."""
73
73
  if vcs not in HANDLERS:
74
74
  HANDLERS[vcs] = {}
75
75
  HANDLERS[vcs][method] = f
76
76
  return f
77
-
78
77
  return decorate
79
78
 
80
79
 
@@ -101,14 +100,10 @@ def run_command(
101
100
  try:
102
101
  dispcmd = str([command] + args)
103
102
  # remember shell=False, so use git.cmd on windows, not just git
104
- process = subprocess.Popen(
105
- [command] + args,
106
- cwd=cwd,
107
- env=env,
108
- stdout=subprocess.PIPE,
109
- stderr=(subprocess.PIPE if hide_stderr else None),
110
- **popen_kwargs,
111
- )
103
+ process = subprocess.Popen([command] + args, cwd=cwd, env=env,
104
+ stdout=subprocess.PIPE,
105
+ stderr=(subprocess.PIPE if hide_stderr
106
+ else None), **popen_kwargs)
112
107
  break
113
108
  except OSError as e:
114
109
  if e.errno == errno.ENOENT:
@@ -146,21 +141,15 @@ def versions_from_parentdir(
146
141
  for _ in range(3):
147
142
  dirname = os.path.basename(root)
148
143
  if dirname.startswith(parentdir_prefix):
149
- return {
150
- "version": dirname[len(parentdir_prefix) :],
151
- "full-revisionid": None,
152
- "dirty": False,
153
- "error": None,
154
- "date": None,
155
- }
144
+ return {"version": dirname[len(parentdir_prefix):],
145
+ "full-revisionid": None,
146
+ "dirty": False, "error": None, "date": None}
156
147
  rootdirs.append(root)
157
148
  root = os.path.dirname(root) # up a level
158
149
 
159
150
  if verbose:
160
- print(
161
- "Tried directories %s but none started with prefix %s"
162
- % (str(rootdirs), parentdir_prefix)
163
- )
151
+ print("Tried directories %s but none started with prefix %s" %
152
+ (str(rootdirs), parentdir_prefix))
164
153
  raise NotThisMethod("rootdir doesn't start with parentdir_prefix")
165
154
 
166
155
 
@@ -223,7 +212,7 @@ def git_versions_from_keywords(
223
212
  # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
224
213
  # just "foo-1.0". If we see a "tag: " prefix, prefer those.
225
214
  TAG = "tag: "
226
- tags = {r[len(TAG) :] for r in refs if r.startswith(TAG)}
215
+ tags = {r[len(TAG):] for r in refs if r.startswith(TAG)}
227
216
  if not tags:
228
217
  # Either we're using git < 1.8.3, or there really are no tags. We use
229
218
  # a heuristic: assume all version tags have a digit. The old git %d
@@ -232,7 +221,7 @@ def git_versions_from_keywords(
232
221
  # between branches and tags. By ignoring refnames without digits, we
233
222
  # filter out many common branch names like "release" and
234
223
  # "stabilization", as well as "HEAD" and "master".
235
- tags = {r for r in refs if re.search(r"\d", r)}
224
+ tags = {r for r in refs if re.search(r'\d', r)}
236
225
  if verbose:
237
226
  print("discarding '%s', no digits" % ",".join(refs - tags))
238
227
  if verbose:
@@ -240,36 +229,32 @@ def git_versions_from_keywords(
240
229
  for ref in sorted(tags):
241
230
  # sorting will prefer e.g. "2.0" over "2.0rc1"
242
231
  if ref.startswith(tag_prefix):
243
- r = ref[len(tag_prefix) :]
232
+ r = ref[len(tag_prefix):]
244
233
  # Filter out refs that exactly match prefix or that don't start
245
234
  # with a number once the prefix is stripped (mostly a concern
246
235
  # when prefix is '')
247
- if not re.match(r"\d", r):
236
+ if not re.match(r'\d', r):
248
237
  continue
249
238
  if verbose:
250
239
  print("picking %s" % r)
251
- return {
252
- "version": r,
253
- "full-revisionid": keywords["full"].strip(),
254
- "dirty": False,
255
- "error": None,
256
- "date": date,
257
- }
240
+ return {"version": r,
241
+ "full-revisionid": keywords["full"].strip(),
242
+ "dirty": False, "error": None,
243
+ "date": date}
258
244
  # no suitable tags, so version is "0+unknown", but full hex is still there
259
245
  if verbose:
260
246
  print("no suitable tags, using unknown + full revision id")
261
- return {
262
- "version": "0+unknown",
263
- "full-revisionid": keywords["full"].strip(),
264
- "dirty": False,
265
- "error": "no suitable tags",
266
- "date": None,
267
- }
247
+ return {"version": "0+unknown",
248
+ "full-revisionid": keywords["full"].strip(),
249
+ "dirty": False, "error": "no suitable tags", "date": None}
268
250
 
269
251
 
270
252
  @register_vcs_handler("git", "pieces_from_vcs")
271
253
  def git_pieces_from_vcs(
272
- tag_prefix: str, root: str, verbose: bool, runner: Callable = run_command
254
+ tag_prefix: str,
255
+ root: str,
256
+ verbose: bool,
257
+ runner: Callable = run_command
273
258
  ) -> Dict[str, Any]:
274
259
  """Get version from 'git describe' in the root of the source tree.
275
260
 
@@ -288,7 +273,8 @@ def git_pieces_from_vcs(
288
273
  env.pop("GIT_DIR", None)
289
274
  runner = functools.partial(runner, env=env)
290
275
 
291
- _, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root, hide_stderr=not verbose)
276
+ _, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root,
277
+ hide_stderr=not verbose)
292
278
  if rc != 0:
293
279
  if verbose:
294
280
  print("Directory %s not under git control" % root)
@@ -296,19 +282,10 @@ def git_pieces_from_vcs(
296
282
 
297
283
  # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]
298
284
  # if there isn't one, this yields HEX[-dirty] (no NUM)
299
- describe_out, rc = runner(
300
- GITS,
301
- [
302
- "describe",
303
- "--tags",
304
- "--dirty",
305
- "--always",
306
- "--long",
307
- "--match",
308
- f"{tag_prefix}[[:digit:]]*",
309
- ],
310
- cwd=root,
311
- )
285
+ describe_out, rc = runner(GITS, [
286
+ "describe", "--tags", "--dirty", "--always", "--long",
287
+ "--match", f"{tag_prefix}[[:digit:]]*"
288
+ ], cwd=root)
312
289
  # --long was added in git-1.5.5
313
290
  if describe_out is None:
314
291
  raise NotThisMethod("'git describe' failed")
@@ -323,7 +300,8 @@ def git_pieces_from_vcs(
323
300
  pieces["short"] = full_out[:7] # maybe improved later
324
301
  pieces["error"] = None
325
302
 
326
- branch_name, rc = runner(GITS, ["rev-parse", "--abbrev-ref", "HEAD"], cwd=root)
303
+ branch_name, rc = runner(GITS, ["rev-parse", "--abbrev-ref", "HEAD"],
304
+ cwd=root)
327
305
  # --abbrev-ref was added in git-1.6.3
328
306
  if rc != 0 or branch_name is None:
329
307
  raise NotThisMethod("'git rev-parse --abbrev-ref' returned error")
@@ -363,16 +341,17 @@ def git_pieces_from_vcs(
363
341
  dirty = git_describe.endswith("-dirty")
364
342
  pieces["dirty"] = dirty
365
343
  if dirty:
366
- git_describe = git_describe[: git_describe.rindex("-dirty")]
344
+ git_describe = git_describe[:git_describe.rindex("-dirty")]
367
345
 
368
346
  # now we have TAG-NUM-gHEX or HEX
369
347
 
370
348
  if "-" in git_describe:
371
349
  # TAG-NUM-gHEX
372
- mo = re.search(r"^(.+)-(\d+)-g([0-9a-f]+)$", git_describe)
350
+ mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe)
373
351
  if not mo:
374
352
  # unparsable. Maybe git-describe is misbehaving?
375
- pieces["error"] = "unable to parse git-describe output: '%s'" % describe_out
353
+ pieces["error"] = ("unable to parse git-describe output: '%s'"
354
+ % describe_out)
376
355
  return pieces
377
356
 
378
357
  # tag
@@ -381,9 +360,10 @@ def git_pieces_from_vcs(
381
360
  if verbose:
382
361
  fmt = "tag '%s' doesn't start with prefix '%s'"
383
362
  print(fmt % (full_tag, tag_prefix))
384
- pieces["error"] = "tag '%s' doesn't start with prefix '%s'" % (full_tag, tag_prefix)
363
+ pieces["error"] = ("tag '%s' doesn't start with prefix '%s'"
364
+ % (full_tag, tag_prefix))
385
365
  return pieces
386
- pieces["closest-tag"] = full_tag[len(tag_prefix) :]
366
+ pieces["closest-tag"] = full_tag[len(tag_prefix):]
387
367
 
388
368
  # distance: number of commits since tag
389
369
  pieces["distance"] = int(mo.group(2))
@@ -432,7 +412,8 @@ def render_pep440(pieces: Dict[str, Any]) -> str:
432
412
  rendered += ".dirty"
433
413
  else:
434
414
  # exception #1
435
- rendered = "0+untagged.%d.g%s" % (pieces["distance"], pieces["short"])
415
+ rendered = "0+untagged.%d.g%s" % (pieces["distance"],
416
+ pieces["short"])
436
417
  if pieces["dirty"]:
437
418
  rendered += ".dirty"
438
419
  return rendered
@@ -461,7 +442,8 @@ def render_pep440_branch(pieces: Dict[str, Any]) -> str:
461
442
  rendered = "0"
462
443
  if pieces["branch"] != "master":
463
444
  rendered += ".dev0"
464
- rendered += "+untagged.%d.g%s" % (pieces["distance"], pieces["short"])
445
+ rendered += "+untagged.%d.g%s" % (pieces["distance"],
446
+ pieces["short"])
465
447
  if pieces["dirty"]:
466
448
  rendered += ".dirty"
467
449
  return rendered
@@ -622,13 +604,11 @@ def render_git_describe_long(pieces: Dict[str, Any]) -> str:
622
604
  def render(pieces: Dict[str, Any], style: str) -> Dict[str, Any]:
623
605
  """Render the given version pieces into the requested style."""
624
606
  if pieces["error"]:
625
- return {
626
- "version": "unknown",
627
- "full-revisionid": pieces.get("long"),
628
- "dirty": None,
629
- "error": pieces["error"],
630
- "date": None,
631
- }
607
+ return {"version": "unknown",
608
+ "full-revisionid": pieces.get("long"),
609
+ "dirty": None,
610
+ "error": pieces["error"],
611
+ "date": None}
632
612
 
633
613
  if not style or style == "default":
634
614
  style = "pep440" # the default
@@ -652,13 +632,9 @@ def render(pieces: Dict[str, Any], style: str) -> Dict[str, Any]:
652
632
  else:
653
633
  raise ValueError("unknown style '%s'" % style)
654
634
 
655
- return {
656
- "version": rendered,
657
- "full-revisionid": pieces["long"],
658
- "dirty": pieces["dirty"],
659
- "error": None,
660
- "date": pieces.get("date"),
661
- }
635
+ return {"version": rendered, "full-revisionid": pieces["long"],
636
+ "dirty": pieces["dirty"], "error": None,
637
+ "date": pieces.get("date")}
662
638
 
663
639
 
664
640
  def get_versions() -> Dict[str, Any]:
@@ -672,7 +648,8 @@ def get_versions() -> Dict[str, Any]:
672
648
  verbose = cfg.verbose
673
649
 
674
650
  try:
675
- return git_versions_from_keywords(get_keywords(), cfg.tag_prefix, verbose)
651
+ return git_versions_from_keywords(get_keywords(), cfg.tag_prefix,
652
+ verbose)
676
653
  except NotThisMethod:
677
654
  pass
678
655
 
@@ -681,16 +658,13 @@ def get_versions() -> Dict[str, Any]:
681
658
  # versionfile_source is the relative path from the top of the source
682
659
  # tree (where the .git directory might live) to this file. Invert
683
660
  # this to find the root from __file__.
684
- for _ in cfg.versionfile_source.split("/"):
661
+ for _ in cfg.versionfile_source.split('/'):
685
662
  root = os.path.dirname(root)
686
663
  except NameError:
687
- return {
688
- "version": "0+unknown",
689
- "full-revisionid": None,
690
- "dirty": None,
691
- "error": "unable to find root of source tree",
692
- "date": None,
693
- }
664
+ return {"version": "0+unknown", "full-revisionid": None,
665
+ "dirty": None,
666
+ "error": "unable to find root of source tree",
667
+ "date": None}
694
668
 
695
669
  try:
696
670
  pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose)
@@ -704,10 +678,6 @@ def get_versions() -> Dict[str, Any]:
704
678
  except NotThisMethod:
705
679
  pass
706
680
 
707
- return {
708
- "version": "0+unknown",
709
- "full-revisionid": None,
710
- "dirty": None,
711
- "error": "unable to compute version",
712
- "date": None,
713
- }
681
+ return {"version": "0+unknown", "full-revisionid": None,
682
+ "dirty": None,
683
+ "error": "unable to compute version", "date": None}
@@ -9,23 +9,29 @@
9
9
  # sub-RAPIDTIDETEST.nii.gz \
10
10
  # ../dst/sub-RAPIDTIDETEST_norefine
11
11
 
12
+ rapidtide \
13
+ --spatialfilt -1 \
14
+ --nprocs -1 \
15
+ --searchrange -5 20 \
16
+ --simcalcrange 50 -1 \
17
+ sub-RAPIDTIDETEST.nii.gz \
18
+ ../dst/sub-RAPIDTIDETEST_defaultfilt
19
+
12
20
  rapidtide \
13
21
  --spatialfilt 5 \
14
22
  --nprocs -1 \
15
23
  --searchrange -5 20 \
16
24
  --simcalcrange 50 -1 \
17
- --refinedelay \
18
25
  sub-RAPIDTIDETEST.nii.gz \
19
- ../dst/sub-RAPIDTIDETEST_filt
26
+ ../dst/sub-RAPIDTIDETEST_5mmfilt
20
27
 
21
28
  rapidtide \
22
29
  --spatialfilt 0 \
23
30
  --nprocs -1 \
24
31
  --searchrange -5 20 \
25
32
  --simcalcrange 50 -1 \
26
- --refinedelay \
27
33
  sub-RAPIDTIDETEST.nii.gz \
28
- ../dst/sub-RAPIDTIDETEST_nofilt
34
+ ../dst/sub-RAPIDTIDETEST_nospatialfilt
29
35
 
30
36
  #rapidtide \
31
37
  # --spatialfilt 5 \
@@ -65,10 +65,5 @@
65
65
  happy \
66
66
  sub-HAPPYTEST.nii.gz \
67
67
  sub-HAPPYTEST.json \
68
+ --spatialglm \
68
69
  ../dst/happy
69
-
70
- happy \
71
- sub-HAPPYTEST.nii.gz \
72
- sub-HAPPYTEST.json \
73
- ../dst/happy_aliasedcorrelation \
74
- --aliasedcorrelation
@@ -16,12 +16,15 @@
16
16
  # limitations under the License.
17
17
  #
18
18
  #
19
+ import os
20
+
19
21
  import matplotlib as mpl
20
22
  import matplotlib.pyplot as plt
21
23
  import numpy as np
22
24
 
23
25
  from rapidtide.resample import FastResampler, FastResamplerFromFile
24
26
  from rapidtide.tests.utils import mse
27
+ from rapidtide.tests.utils import get_test_temp_path
25
28
 
26
29
 
27
30
  def test_FastResampler(debug=False):
@@ -45,8 +48,9 @@ def test_FastResampler(debug=False):
45
48
  print(f"{genlaggedtc.hiresstart=}, {genlaggedtc.hiresend=}, {genlaggedtc.hiresstep=}")
46
49
 
47
50
  # save and reload with another name
48
- genlaggedtc.save("savedresampler")
49
- genlaggedtc2 = FastResamplerFromFile("savedresampler", padtime=padtime, debug=debug)
51
+ resamplername = os.path.join(get_test_temp_path(), "savedresampler")
52
+ genlaggedtc.save(resamplername)
53
+ genlaggedtc2 = FastResamplerFromFile(resamplername, padtime=padtime, debug=debug)
50
54
  if debug:
51
55
  print(f"{genlaggedtc2.initstart=}, {genlaggedtc2.initend=}, {genlaggedtc2.initstep=}")
52
56
  print(f"{genlaggedtc2.hiresstart=}, {genlaggedtc2.hiresend=}, {genlaggedtc2.hiresstep=}")
@@ -36,7 +36,6 @@ def test_fullrunhappy_v1(debug=False, displayplots=False):
36
36
  "--spatialglm",
37
37
  "--model",
38
38
  "model_revised",
39
- "--aliasedcorrelation",
40
39
  ]
41
40
  happy_workflow.happy_main(happy_parser.process_args(inputargs=inputargs))
42
41
 
@@ -41,6 +41,7 @@ def test_fullrunhappy_v4(debug=False, displayplots=False):
41
41
  "model_revised",
42
42
  "--motionfile",
43
43
  os.path.join(get_examples_path(), "sub-HAPPYTEST_mcf.par"),
44
+ "--aliasedcorrelation",
44
45
  ]
45
46
  happy_workflow.happy_main(happy_parser.process_args(inputargs=inputargs))
46
47
 
@@ -22,7 +22,7 @@ import matplotlib as mpl
22
22
 
23
23
  import rapidtide.workflows.parser_funcs as pf
24
24
  import rapidtide.workflows.showtc as showtc
25
- from rapidtide.tests.utils import get_examples_path
25
+ from rapidtide.tests.utils import get_examples_path, get_test_temp_path
26
26
 
27
27
 
28
28
  def test_runmisc(debug=False, displayplots=False):
@@ -35,7 +35,7 @@ def test_runmisc(debug=False, displayplots=False):
35
35
  "--sampletime",
36
36
  "12.5",
37
37
  "--tofile",
38
- "showtcout1.jpg",
38
+ os.path.join(get_test_temp_path(), "showtcout1.jpg"),
39
39
  "--starttime",
40
40
  "100",
41
41
  "--endtime",
@@ -55,7 +55,7 @@ def test_runmisc(debug=False, displayplots=False):
55
55
  "--displaytype",
56
56
  "power",
57
57
  "--tofile",
58
- "showtcout2.jpg",
58
+ os.path.join(get_test_temp_path(), "showtcout2.jpg"),
59
59
  "--noxax",
60
60
  "--noyax",
61
61
  "--nolegend",
@@ -90,7 +90,7 @@ def test_runmisc(debug=False, displayplots=False):
90
90
  "--displaytype",
91
91
  "phase",
92
92
  "--tofile",
93
- "showtcout3.jpg",
93
+ os.path.join(get_test_temp_path(), "showtcout3.jpg"),
94
94
  ]
95
95
  pf.generic_init(showtc._get_parser, showtc.showtc, inputargs=inputargs)
96
96
 
@@ -87,7 +87,7 @@ def _get_parser():
87
87
  "--dataset",
88
88
  nargs="*",
89
89
  help=(
90
- "Use this dataset root name (skip initial selection step). The root name is the entire path "
90
+ "Specify one or more dataset root names (skip initial selection step). The root name is the entire path "
91
91
  "to the rapidtide output data (including the underscore) that precedes 'desc-maxtime_map.nii.gz'"
92
92
  ),
93
93
  dest="datafileroot",
@@ -106,8 +106,12 @@ def _get_parser():
106
106
  "--uistyle",
107
107
  action="store",
108
108
  type=str,
109
- choices=["normal", "old", "big"],
110
- help="Set the window layout style. Default is 'normal'.",
109
+ choices=["normal", "big"],
110
+ help=(
111
+ "Set the window layout style. The 'normal' uistyle loads 8 data maps into display panes, "
112
+ "and fits comfortably on the screen of a 14in MacbookPro screen. The 'big' uistyle has 16 display "
113
+ "panes, and fits on a 16in MBP screen. Default is 'normal'."
114
+ ),
111
115
  default="normal",
112
116
  )
113
117
  parser.add_argument(
@@ -120,7 +124,7 @@ def _get_parser():
120
124
  )
121
125
  parser.add_argument(
122
126
  "--ignoredimmatch",
123
- help="Do not check to see if dataset sizes match",
127
+ help="Do not check to see if dataset sizes match. This is almost certainly a terrible idea.",
124
128
  dest="ignoredimmatch",
125
129
  action="store_true",
126
130
  default=False,
@@ -1114,6 +1118,7 @@ def setMask(maskname):
1114
1118
  }
1115
1119
  print(maskinfodicts[maskname]["msg"])
1116
1120
  ui.setMask_Button.setText(maskinfodicts[maskname]["label"])
1121
+ currentdataset.setFuncMaskName(maskname)
1117
1122
  for themap in currentdataset.loadedfuncmaps:
1118
1123
  if maskname == "nomask":
1119
1124
  overlays[themap].setFuncMask(None)
@@ -1149,16 +1154,19 @@ def overlay_radioButton_clicked(which, enabled):
1149
1154
  thedispmin = overlays[currentdataset.focusmap].dispmin
1150
1155
  thedispmax = overlays[currentdataset.focusmap].dispmax
1151
1156
  if verbosity > 1:
1152
- print("currentdataset.focusmap set to ", currentdataset.focusmap)
1153
- if overlays[currentdataset.focusmap].lut_state == gen_gray_state():
1157
+ print(f"currentdataset.focusmap set to {currentdataset.focusmap}")
1158
+ print(
1159
+ f"overlays[currentdataset.focusmap].LUTname set to {overlays[currentdataset.focusmap].LUTname}"
1160
+ )
1161
+ if overlays[currentdataset.focusmap].LUTname == "gray":
1154
1162
  ui.gray_radioButton.setChecked(True)
1155
- elif overlays[currentdataset.focusmap].lut_state == gen_thermal_state():
1163
+ elif overlays[currentdataset.focusmap].LUTname == "thermal":
1156
1164
  ui.thermal_radioButton.setChecked(True)
1157
- elif overlays[currentdataset.focusmap].lut_state == gen_plasma_state():
1165
+ elif overlays[currentdataset.focusmap].LUTname == "plasma":
1158
1166
  ui.plasma_radioButton.setChecked(True)
1159
- elif overlays[currentdataset.focusmap].lut_state == gen_viridis_state():
1167
+ elif overlays[currentdataset.focusmap].LUTname == "viridis":
1160
1168
  ui.viridis_radioButton.setChecked(True)
1161
- elif overlays[currentdataset.focusmap].lut_state == gen_turbo_state():
1169
+ elif overlays[currentdataset.focusmap].LUTname == "turbo":
1162
1170
  ui.turbo_radioButton.setChecked(True)
1163
1171
  else:
1164
1172
  ui.rainbow_radioButton.setChecked(True)
@@ -1563,9 +1571,10 @@ def activateDataset(currentdataset, ui, win, defaultdict, overlayGraphicsViews,
1563
1571
  overlays["atlas"].setGeomMask(thegeommask)
1564
1572
  overlays["atlas"].setFuncMask(overlays["atlasmask"].data)
1565
1573
 
1566
- if verbosity > 0:
1567
- for theoverlay in overlays:
1568
- overlays[theoverlay].summarize()
1574
+ if not panesinitialized:
1575
+ if verbosity > 0:
1576
+ for theoverlay in overlays:
1577
+ overlays[theoverlay].summarize()
1569
1578
 
1570
1579
  if verbosity > 1:
1571
1580
  print("focusmap is:", currentdataset.focusmap, "bgmap is:", bgmap)
@@ -1668,6 +1677,11 @@ def activateDataset(currentdataset, ui, win, defaultdict, overlayGraphicsViews,
1668
1677
  updateRegressor()
1669
1678
  updateRegressorSpectrum()
1670
1679
 
1680
+ # update the mask menu
1681
+ if currentdataset.funcmaskname is not None:
1682
+ print(f"updating the mask menu to {currentdataset.funcmaskname}")
1683
+ setMask(currentdataset.funcmaskname)
1684
+
1671
1685
 
1672
1686
  def loadpane(
1673
1687
  themap,
@@ -2457,4 +2471,9 @@ def tidepool(args):
2457
2471
  updateRegressorSpectrum()
2458
2472
  uiinitialized = True
2459
2473
 
2474
+ # for profiling
2475
+ """for i in range(20):
2476
+ selectDataset((i + 1) % 2)
2477
+ sys.exit(0)"""
2478
+
2460
2479
  QtWidgets.QApplication.instance().exec()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rapidtide
3
- Version: 3.0a10
3
+ Version: 3.0a11
4
4
  Summary: Tools for performing correlation analysis on fMRI data.
5
5
  Author: Taylor Salo, Daniel M. Drucker, Ph.D., Jeffrey N Stout, Yaroslav O. Halchenko, Derek Monroe
6
6
  Author-email: "Blaise deB. Frederick" <blaise.frederick@gmail.com>
@@ -6,11 +6,11 @@ cloud/mount-and-run,sha256=x6829t-u2vH1NpjxaaES39dv393E5EIv3S0WYdgLytY,2465
6
6
  cloud/rapidtide-HCPYA,sha256=e3GJeE2_O_x-eGqvPJ6qWp6g4T_askxrsM-PTpRdEjc,949
7
7
  cloud/rapidtide-cloud-test,sha256=SATOwGo4QYLvt-6hE0e3wyK9JjuDU5XzfLrfMoybvcY,466
8
8
  cloud/simple-cp-test,sha256=5ef8wmLfcKdny59BV6_DnAPj7O_mi0rOHdFZVN2iiLA,421
9
- rapidtide/Colortables.py,sha256=e3oktGI1OlC5NJSKzKiJG6dr_ONzm4uvyOo330IHh8w,4701
9
+ rapidtide/Colortables.py,sha256=AQC-aHwgemxZNKtf8du7Oe08IKKxuOsUF1bDEdSyleY,5804
10
10
  rapidtide/OrthoImageItem.py,sha256=uN-fMX4vVB00-AFoUnfOXXq1qjLXruzOqYttNJYpIpM,21669
11
- rapidtide/RapidtideDataset.py,sha256=-URtXq-cpI5VaG7ae-8iiZZReeR7DBQ-O0jMxKysFW8,51622
12
- rapidtide/__init__.py,sha256=cECnPfGNIWXETiummGLjKcNXLROSDiFlLp-RpZSavwc,97
13
- rapidtide/_version.py,sha256=DOQAt5wVTS8zfWbgneAVv-s1QG9aCJHhnH8kpwzkmH8,24559
11
+ rapidtide/RapidtideDataset.py,sha256=BEGznVDvLzL1Cd9TtuwicCYXcVug8hX1t-6qnEjMEDg,52239
12
+ rapidtide/__init__.py,sha256=DrceP8tLrtTWV8PwS7YAgw6NuFkKAREFM7FsTaZob-s,96
13
+ rapidtide/_version.py,sha256=cTDBv24D1_YgVeFU_x3GvlNlQD-clOji6E0Sb34osJY,24506
14
14
  rapidtide/calcandfitcorrpairs.py,sha256=UmCp9eSU--HCYd7frdO9ctnMeDK32D1Eb53b1hdzw9w,7397
15
15
  rapidtide/calccoherence.py,sha256=SjSWcqbyATKu5Hya5LgRCTfq2w9l7G9L_kZbol802sk,4512
16
16
  rapidtide/calcnullsimfunc.py,sha256=_L5Gxr1CI0GKmGmEjHzrYNufAzDchDsruYCzboSgw3s,7150
@@ -62,12 +62,12 @@ rapidtide/data/examples/src/testcomplex,sha256=PFY_d30eqYBx5K8cPP_WxsP2YPlYuawo8
62
62
  rapidtide/data/examples/src/testdecomp,sha256=xxxr510aOBjtpJy4aQNAFTyEFZD6QdHp6-Aa_esYalY,269
63
63
  rapidtide/data/examples/src/testfileorfloat,sha256=9r4mz7pBV_8iFZya9kmtfbnTRS3-94Cx9Q63Ni3mkZs,815
64
64
  rapidtide/data/examples/src/testfingerprint,sha256=RlAIC1lMDWMGzZKxY24DJRuaUEL0BenSFBey0gL5dqU,402
65
- rapidtide/data/examples/src/testfmri,sha256=BIrd4dFeOgu3s1DZt-msEiSk9C2hTvcPFhSV57wBlyg,3012
65
+ rapidtide/data/examples/src/testfmri,sha256=vLftCOpC0rWy0QNNv-7FdWvDQLBRPOYIEYlViXn2r8g,3161
66
66
  rapidtide/data/examples/src/testfmridocker,sha256=jjL7bK29rrcog6uO9BtvcyAU3Sv8_5cbw2nqKoiZ95o,1193
67
67
  rapidtide/data/examples/src/testfrozen,sha256=K3qUWDRKPPiCXRgIFuPdwUUjUTzf4QBW8UUhR75NzDM,283
68
68
  rapidtide/data/examples/src/testfuncs,sha256=QmVJP8vjr-HqKCAaIz7McdADVZru6Nvwq16h5KPs9ek,1551
69
69
  rapidtide/data/examples/src/testglmfilt,sha256=LD2cTB-7yyCc31jAr8UtYksf-Cn-YLC3ScnV3olvpFE,3333
70
- rapidtide/data/examples/src/testhappy,sha256=Qo-hNofuIYOj522PPtqR_5pePTTTyJTaOdAA18G3bkg,1817
70
+ rapidtide/data/examples/src/testhappy,sha256=7dKe3PM-nPRbsroGRq3RQFFABPdNuByS3aEddgu_Oyc,1712
71
71
  rapidtide/data/examples/src/testlinfit,sha256=oPnkHJ6lcwsuJhnSMMK7Gx3DHSCf6JK7CIYuIMHbyNA,471
72
72
  rapidtide/data/examples/src/testlocalflow,sha256=hEwstisbWVuALr_29fBJ2nHETKkEF_9qK8wJ4kzuiJk,596
73
73
  rapidtide/data/examples/src/testnoiseamp,sha256=ZRu3GstBhdnwZmDF7ExZynOXFFMElWiZuod8LbUKa-I,612
@@ -212,13 +212,13 @@ rapidtide/tests/test_correlate.py,sha256=GIbG5btp-dJS-cOyMrxPcweOWIa--zWVNSfrfnl
212
212
  rapidtide/tests/test_corrpass.py,sha256=eBNw1KBvjo9WgorR-7aPga3WIeQxckTGjPwv-kn6zBw,7836
213
213
  rapidtide/tests/test_delayestimation.py,sha256=2AeQcT_cFvvNvH0R-K9WNDDp66S-UjybfAqdfG0REYU,13460
214
214
  rapidtide/tests/test_doresample.py,sha256=ILQxH6UXtHZ9OwgTpbZE_bek_QKYGmmA6D70r6NqAoc,2716
215
- rapidtide/tests/test_fastresampler.py,sha256=UOWk2_GXEp0xT_gOkVnvg7yuQbbkZGHdljB6zh28OJQ,3763
215
+ rapidtide/tests/test_fastresampler.py,sha256=OIQFWJhSlENB2uoJdIEqYg5O1rzhBDxAbRuw-nyMOL0,3894
216
216
  rapidtide/tests/test_filter.py,sha256=_xhk3rbYFtuKgrDdgrrrlITtmQhOUUi5EhFcnxVUioA,10891
217
217
  rapidtide/tests/test_findmaxlag.py,sha256=x9mKQ8TmWW4jq8CrlfrX8zwO3n4pYa7aPgF3F1e0aPc,11551
218
- rapidtide/tests/test_fullrunhappy_v1.py,sha256=XuK90R4Ef7PIvJfyyXHqL__SvRjJUHtHX8PZYuJjEKo,1502
218
+ rapidtide/tests/test_fullrunhappy_v1.py,sha256=axS-rLLHUKT-VN-Vv2OVlGGra9x879X_twOAdgeCuhE,1470
219
219
  rapidtide/tests/test_fullrunhappy_v2.py,sha256=9_1sjtTP-4YVv-d86iL0hkm8T8ODQ1Ckumu-iFu2W8s,1935
220
220
  rapidtide/tests/test_fullrunhappy_v3.py,sha256=sEWV-Qf_13gJ9BnUmgIu-JtMAh1Jp0Qn8EhTEBU4YmU,1743
221
- rapidtide/tests/test_fullrunhappy_v4.py,sha256=_8ax0oEEdaSSRa-N-lGquWP4MfLj6DR-xy-NUZ3kuhM,1721
221
+ rapidtide/tests/test_fullrunhappy_v4.py,sha256=YL6FWWAL2eeNg-EdaOhdq6r4-84lF_f36hQoGYBl0f4,1753
222
222
  rapidtide/tests/test_fullrunhappy_v5.py,sha256=1otOjGN7PADurvB3PUqHq_FxCpd5vr3Q1KD8FrPGXlU,1721
223
223
  rapidtide/tests/test_fullrunrapidtide_v1.py,sha256=jO2PyPTvxfIYyzydQgxD812DRuzotCTFmnBqShRpa0M,2864
224
224
  rapidtide/tests/test_fullrunrapidtide_v2.py,sha256=RsMCrq-A4WzVzQxFnyvuotKCT4ipfyepM1RxGBpmMys,2881
@@ -236,7 +236,7 @@ rapidtide/tests/test_padvec.py,sha256=UKALfQyS9v87QiThxSu51Md3eXkChTpTfm-C0KdXcR
236
236
  rapidtide/tests/test_phaseanalysis.py,sha256=DMzB19c9rz3c5PSwXO4QYOEqNLR85YZLra4wV33O6uI,2150
237
237
  rapidtide/tests/test_rapidtideparser.py,sha256=HBoZdmS5UEGDFvlpueNhYXvVbq-pWrhNDCofkc2Tp98,5555
238
238
  rapidtide/tests/test_refinedelay.py,sha256=HMM8nb65LYLF8AIgnVTtNUVtf6lt4sc66q9T60WqflY,8460
239
- rapidtide/tests/test_runmisc.py,sha256=xeeE5AZc2naWfgX9izoLIwXTnU2kpD6QbRxzih61JFc,2727
239
+ rapidtide/tests/test_runmisc.py,sha256=rrhn_kAnid2c26WgCGr3Va3SfPo14m_bN2p9MOafUH8,2855
240
240
  rapidtide/tests/test_sharedmem.py,sha256=Yp5WuYMdKABfqYKvuayq5253pvOC05V_oUK-povjGV8,2026
241
241
  rapidtide/tests/test_simulate.py,sha256=m8oGp8qrxQv-FtxX6P3t_nu8bvSizWSZXIij5rtWB6k,3325
242
242
  rapidtide/tests/test_stcorrelate.py,sha256=jfg1t-tyfrU5ZmlFP9fjAfysnqJ2BTUFOI6cVBt8qHA,2493
@@ -325,12 +325,12 @@ rapidtide/workflows/spectrogram.py,sha256=ATe6baNL-Rv6rvV6rCcxcBO2naFu0v4UDJ2hX6
325
325
  rapidtide/workflows/synthASL.py,sha256=fRfu2lAQwC1Ahi_Sz-mvmp3yZCV_zUWFbu8F9-8RHxM,4971
326
326
  rapidtide/workflows/tcfrom2col.py,sha256=El9pjrCfxANFA3s60YvHOTUx3UYaavJgCOIYtMcvKlk,1936
327
327
  rapidtide/workflows/tcfrom3col.py,sha256=6tV2lGEtXpI4dn_8kcTCVzZxpJzmopuDwpXvOIE7vzQ,1938
328
- rapidtide/workflows/tidepool.py,sha256=8vM8fXmw9Zew-vUZRGjRPcNmCTxaH6YHINgb4JWemlA,85603
328
+ rapidtide/workflows/tidepool.py,sha256=14yrUQ87syFeTuU0lJBxVz3rBrwV9f4A4fGwVW5Bj_g,86399
329
329
  rapidtide/workflows/utils.py,sha256=k2m2F1-tWxhcUYvk5geO1yl-c5bKcDX7Jv7ohvJZaOk,5379
330
330
  rapidtide/workflows/variabilityizer.py,sha256=yQFDTBcGehxW44R_FQHeeKrTpeYrrh96xcW1uWbPtYo,3167
331
- rapidtide-3.0a10.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
332
- rapidtide-3.0a10.dist-info/METADATA,sha256=Jc1StyHH9MUs_GE6aj6wi3L1xnuMmwQSD61o4VQTNEA,15624
333
- rapidtide-3.0a10.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
334
- rapidtide-3.0a10.dist-info/entry_points.txt,sha256=76O4RdCVLd7YrASvmgJQWaRUlgmBzMDU5_XkGIlmuTk,3260
335
- rapidtide-3.0a10.dist-info/top_level.txt,sha256=MnNXGfbrIBc9RnAqzBHOWd3GQO-aIUDnRTz4_5VjH5g,16
336
- rapidtide-3.0a10.dist-info/RECORD,,
331
+ rapidtide-3.0a11.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
332
+ rapidtide-3.0a11.dist-info/METADATA,sha256=zVdYRWhcyzi1lh3_CiHvi_yduUOXQLzLep58HsqEQuA,15624
333
+ rapidtide-3.0a11.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
334
+ rapidtide-3.0a11.dist-info/entry_points.txt,sha256=76O4RdCVLd7YrASvmgJQWaRUlgmBzMDU5_XkGIlmuTk,3260
335
+ rapidtide-3.0a11.dist-info/top_level.txt,sha256=MnNXGfbrIBc9RnAqzBHOWd3GQO-aIUDnRTz4_5VjH5g,16
336
+ rapidtide-3.0a11.dist-info/RECORD,,