fmrireg
Specify, diagnose, fit, or export first-level task-fMRI GLMs with fmrireg, including HRFs, nuisance baselines, contrasts, and native batch jobs. Use independently of group analysis and reports; not for preprocessing.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- fmrireg
- license
- MIT
- metadata
- { "version": "0.1.0", "reviewed": "2026-09-28" }
- description
- Specify, diagnose, fit, or export first-level task-fMRI GLMs with fmrireg, including HRFs, nuisance baselines, contrasts, and native batch jobs. Use independently of group analysis and reports; not for preprocessing.
- compatibility
- Requires local filesystem access; R for package execution and Python 3.10+ for optional helpers.
02 资源文件 24
- 资产文件assets/first_level_template.R1.5 KB
- 许可证LICENSE1.1 KB
- 参考文档references/api.md3.8 KB
- 参考文档references/artifact-contracts.md3.8 KB
- 参考文档references/batch-and-export.md4.0 KB
- 参考文档references/capabilities.md2.7 KB
- 参考文档references/confounds.md2.7 KB
- 参考文档references/design-audits.md3.5 KB
- 参考文档references/design-decisions.md4.9 KB
- 参考文档references/events-to-design.md9.9 KB
- 参考文档references/existing-analyses.md5.7 KB
- 参考文档references/nifti-handoff.md9.9 KB
- 参考文档references/operating-contract.md5.1 KB
- 参考文档references/sources.md5.5 KB
- 参考文档references/trial-patterns-rsa.md4.9 KB
- 参考文档schemas/inventory.schema.json1.1 KB
- 参考文档schemas/plan.schema.json3.9 KB
- 参考文档schemas/preferences.schema.json1.4 KB
- 脚本scripts/probe_capabilities.R2.7 KB
- 脚本scripts/smoke_design.R4.7 KB
- 脚本scripts/smoke_first_level.R2.5 KB
- 脚本scripts/smoke_nifti_handoff.R8.9 KB
- 脚本scripts/workbench.py20.8 KB
- 其他SHA256SUMS2.2 KB
03 SKILL.md 正文
First-level fMRI with fmrireg
Start from preprocessed BOLD with aligned events/confounds, an fmri_frame, matrices, or validated bindings. This skill works without bidser, fmrigds, or neuromosaic. Do not import a whole cohort workflow for a formula/API question.
For an analysis, read the operating contract and reuse prior decisions. Verify the installed API and capabilities. Ask only unresolved first-level scientific questions; do not interview about group covariates or report atlases.
When adapting an existing script or joining bidser inputs to a manual model, use existing analysis patterns. Preserve the estimand and downstream outputs; verify historical workarounds against the selected package versions before retaining them.
Specify an estimable model
When the intended model is still open, inspect the event tables and use events to candidate designs to propose supported questions and contrasts before choosing a formula. For ambiguous timing, missing modulators or interactions, use the synthetic design audits. For trialwise/RSA work, read the specialist decision guide.
Record the event meaning and timing origin, duration/amplitude handling, HRF and basis interpretation, contrast sign/weights, run structure, scaling, nuisance, and temporal-noise model. Use design decisions and confounds only as needed. Inspect the realized matrix: matching rows, finite values, columns/condition counts per run, rank, conditioning, residual degrees of freedom, and contrast estimability. Plot a small design/timing sample. Treat a missing condition as unavailable, not zero. Do not silently delete nuisance columns, change contrasts, or simplify a preregistered model to make a fit run.
Use the public frame/design interfaces and fmri_lm(). For new repeated-fit workflows prefer
fmri_template() + explicit bindings + instantiate() + preflight(); read
batch and export. The from_bids() shortcut
requires a separately certified unambiguous dataset; its reviewed implementation
is not safe to assume for mixed TR, repeated run labels across sessions, or
multiple echoes/representations. Use as_manifest() for explicit bindings.
Test and fit
scripts/smoke_first_level.R is a small synthetic compatibility test, not a
production default. assets/first_level_template.R builds jobs from reviewed
bindings and explicit choices without launching them. Verify a representative
pilot (including known irregular runs and distinct acquisition strata), coefficient/contrast signs, residuals,
uncertainty, and execution resources before approved fan-out. Use native job
failure records and file-backed reducers; keep whole fits out of agent context.
The reviewed noise_spec(censor=...) is not regression-volume removal; it only
affects AR estimation/whitening and is inert for iid noise. Do not treat OLS, AR prewhitening, robust weighting, and accelerated engines as
statistically interchangeable. A fast engine needs its own validity check.
Export and stop at scope
Export unthresholded contrast estimates plus SE/variance and needed statistics/
df; carry coefficient order, contrast weights, masks/space, units, temporal-noise
settings, and complete provenance. See artifact contracts.
For group-ready results retain within-person covariance when required. Do not
average t/z maps as if they were effect estimates. For NIfTI inputs to fmrigds,
follow the subject-to-group recipe: separate contrast
beta/SE files, explicit contrast order, verified grids and coverage masks.
scripts/smoke_nifti_handoff.R checks this route on synthetic data when both
packages are available. Group inference is optional;
a first-level request ends with first-level outputs and QC.
Apply explicitly confirmed, applicable preferences, but never infer that examples such as motion24 or B-spline drift are a user's defaults. Freeze realized nuisance columns and drift basis details in the analysis record. Return exact outputs, failed units, and limitations; never claim a test ran when only source was read.
04 同仓库更多 Skills
neuromosaic
Create neuromosaic fMRI map montages, atlas-annotated cluster reports, or interactive explorers from existing statistical outputs. Use without refitting analyses; distinguish display thresholds from statistical inference.
fmrireg
Specify, diagnose, fit, or export first-level task-fMRI GLMs with fmrireg, including HRFs, nuisance baselines, contrasts, and native batch jobs. Use independently of group analysis and reports; not for preprocessing.
fmrigds
Build and validate group-level fMRI analyses with fmrigds from existing effect/statistic maps or tables: covariates, uncertainty, repeated measures, corrections, and cohort examination. Does not require first-level refitting.
fmri
Coordinate end-to-end task-fMRI analyses across BIDS discovery, fmrireg models, fmrigds group inference, and neuromosaic reports. Use for multi-stage analysis plans or execution, not a single-package question.
fmri-bids
Inspect and audit BIDS fMRI datasets with bidser: inherited metadata, derivatives, events, confounds, and acquisition matching. Use for dataset discovery or analysis readiness; do not fit models or preprocess images.
neuromosaic
Create neuromosaic fMRI map montages, atlas-annotated cluster reports, or interactive explorers from existing statistical outputs. Use without refitting analyses; distinguish display thresholds from statistical inference.