|
28 | 28 | --input-dir /path/to/rbc_release --output-dir /path/to/fixed \\ |
29 | 29 | [--participant-label sub-X ...] [--bandpass 0.01 0.1] \\ |
30 | 30 | [--tr-override 2.0] [--runner auto] [--skip-metrics] \\ |
31 | | - [--overwrite] [--dry-run | --verify] |
| 31 | + [--work-dir /scratch] [--overwrite] [--dry-run | --verify] |
32 | 32 |
|
33 | 33 | Or standalone, no clone:: |
34 | 34 |
|
@@ -620,6 +620,15 @@ def _build_parser() -> argparse.ArgumentParser: |
620 | 620 | choices=["auto", "local", "docker", "podman", "singularity"], |
621 | 621 | help="NiWrap runner for AFNI 3dTproject (default: auto).", |
622 | 622 | ) |
| 623 | + parser.add_argument( |
| 624 | + "--work-dir", |
| 625 | + type=Path, |
| 626 | + default=None, |
| 627 | + help="Parent directory under which to create the (auto-cleaned) scratch " |
| 628 | + "folder for patched headers and niwrap exec dirs. Defaults to the " |
| 629 | + "system temp dir (honors $TMPDIR/$TEMP/$TMP). Point this at a roomy " |
| 630 | + "disk for multi-thousand-run releases.", |
| 631 | + ) |
623 | 632 | parser.add_argument( |
624 | 633 | "--skip-metrics", |
625 | 634 | action="store_true", |
@@ -729,7 +738,11 @@ def main(argv: list[str] | None = None) -> int: |
729 | 738 |
|
730 | 739 | args.output_dir.mkdir(parents=True, exist_ok=True) |
731 | 740 | atlases: Mapping[str, Path] = {} if args.skip_metrics else _resolve_atlases() |
732 | | - with tempfile.TemporaryDirectory(prefix="rbc_tr_fix_") as work_str: |
| 741 | + if args.work_dir is not None: |
| 742 | + args.work_dir.mkdir(parents=True, exist_ok=True) |
| 743 | + with tempfile.TemporaryDirectory( |
| 744 | + prefix="rbc_tr_fix_", dir=args.work_dir |
| 745 | + ) as work_str: |
733 | 746 | # Route niwrap exec folders under the same temp root so they get |
734 | 747 | # cleaned up; else ``generate_exec_folder`` accumulates GBs across |
735 | 748 | # a multi-thousand-run release. |
|
0 commit comments