AGENT SKILL

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

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

bbuchsbaum
bbuchsbaum/brbskills

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.

★ 0
bbuchsbaum
bbuchsbaum/brbskills

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.

★ 0
bbuchsbaum
bbuchsbaum/brbskills

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.

★ 0
bbuchsbaum
bbuchsbaum/brbskills

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.

★ 0
bbuchsbaum
bbuchsbaum/brbskills

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.

★ 0
bbuchsbaum
bbuchsbaum/brbskills

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.

★ 0