{"id":30805307,"url":"https://github.com/bbuchsbaum/afnireg","last_synced_at":"2025-09-06T00:55:22.460Z","repository":{"id":310395236,"uuid":"1039684079","full_name":"bbuchsbaum/afnireg","owner":"bbuchsbaum","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-28T18:58:40.000Z","size":3990,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-28T23:35:52.009Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbuchsbaum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-17T19:03:56.000Z","updated_at":"2025-08-28T18:56:01.000Z","dependencies_parsed_at":"2025-08-17T21:23:31.917Z","dependency_job_id":"88185a65-9fce-47fe-846c-293eda509c94","html_url":"https://github.com/bbuchsbaum/afnireg","commit_stats":null,"previous_names":["bbuchsbaum/afnireg"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bbuchsbaum/afnireg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Fafnireg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Fafnireg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Fafnireg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Fafnireg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbuchsbaum","download_url":"https://codeload.github.com/bbuchsbaum/afnireg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Fafnireg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273842848,"owners_count":25177921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-06T00:55:21.290Z","updated_at":"2025-09-06T00:55:22.418Z","avatar_url":"https://github.com/bbuchsbaum.png","language":"R","readme":"# afnireg\n\nAFNI Integration for fMRI Analysis in R\n\n## Overview\n\nThe `afnireg` package provides an R interface to AFNI's 3dDeconvolve program for fMRI analysis. It allows users to specify complex experimental designs and HRF models in R using the fmridesign framework and execute them using AFNI's optimized estimation routines.\n\n## Installation\n\n```r\n# Install from GitHub\nremotes::install_github(\"bbuchsbaum/afnireg\")\n```\n\n## Dependencies\n\nThis package depends on:\n- fmridesign: Event model specification\n- fmrihrf: HRF modeling\n- fmridataset: Dataset handling\n\n## Features\n\n- Native AFNI HRF specifications\n- Trialwise modulation support\n- Automatic contrast conversion to GLT format\n- Support for multiple HRF basis functions\n- Multi-run designs\n- Censoring and nuisance regression\n\n## Quick Start\n\nFor a comprehensive tutorial on using `afnireg` to translate fMRI models to AFNI's 3dDeconvolve format, see our [Getting Started vignette](https://bbuchsbaum.github.io/afnireg/articles/afni_tutorial.html).\n\n## Usage\n\n```r\nlibrary(afnireg)\nlibrary(fmridesign)\nlibrary(fmrihrf)\n\n# 1) Specify an event and baseline model in R\nTR \u003c- 2\nsframe \u003c- sampling_frame(blocklens = 140, TR = TR)\n\nemodel \u003c- event_model(\n  onset ~ hrf(stim),\n  data = events_df,       # data.frame with columns: onset, stim, run, ...\n  block = ~ run,\n  sampling_frame = sframe\n)\n\nbmodel \u003c- baseline_model(basis = \"bs\", degree = 5, sframe = sframe)\nfmodel \u003c- fmri_model(emodel, bmodel)\n\n# 2a) With scans: build an AFNI spec\ndset \u003c- fmridataset::fmri_dataset(\n  scans = c(\"run1.nii.gz\", \"run2.nii.gz\"),\n  mask  = \"mask.nii.gz\",\n  TR    = TR,\n  run_length = 140,\n  event_table = events_df\n)\n\nalm \u003c- afni_lm(fmodel, dset, options = list(bucket = \"stats_afni\"))\nrun(alm, outdir = \"glm_afni_output\")\n\n# 2b) Or do a dry run without data (writes .xmat.1D and script)\nalm_nodata \u003c- afni_lm(fmodel, dataset = NULL, nodata = c(140, TR), x1D_stop = TRUE)\nrun(alm_nodata, outdir = \"glm_afni_x1d\", execute = FALSE)\n\n# AFNI-native HRF example (uses -stim_times)\nemodel_afni \u003c- event_model(\n  onset ~ afni_hrf(stim, basis = \"block\", durations = 2),\n  data = events_df, block = ~ run, sampling_frame = sframe\n)\nfmodel_afni \u003c- fmri_model(emodel_afni, bmodel)\nalm_afni \u003c- afni_lm(fmodel_afni, dset)\n```\n\n## Documentation\n\n### Online Documentation\n- [Package documentation](https://bbuchsbaum.github.io/afnireg/)\n- [Getting Started: Translating to AFNI 3dDeconvolve](https://bbuchsbaum.github.io/afnireg/articles/afni_tutorial.html)\n\n### Vignettes\nView the vignette locally after installation:\n```r\nvignette(\"afni_tutorial\", package = \"afnireg\")\n```\n\n## License\n\nGPL (\u003e= 2)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbuchsbaum%2Fafnireg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbuchsbaum%2Fafnireg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbuchsbaum%2Fafnireg/lists"}