{"id":28423807,"url":"https://github.com/bbuchsbaum/fmrihrf","last_synced_at":"2026-02-20T05:04:28.537Z","repository":{"id":296769632,"uuid":"994419804","full_name":"bbuchsbaum/fmrihrf","owner":"bbuchsbaum","description":"R library for hemodynamic response functions","archived":false,"fork":false,"pushed_at":"2026-02-10T11:15:32.000Z","size":25272,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-10T16:09:54.272Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://bbuchsbaum.github.io/fmrihrf/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbuchsbaum.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-01T22:22:06.000Z","updated_at":"2026-02-10T11:12:58.000Z","dependencies_parsed_at":"2025-06-02T08:35:09.922Z","dependency_job_id":"6c5dac6d-68ce-47d1-a4b0-f9acc173a8e2","html_url":"https://github.com/bbuchsbaum/fmrihrf","commit_stats":null,"previous_names":["bbuchsbaum/fmrihrf"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bbuchsbaum/fmrihrf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Ffmrihrf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Ffmrihrf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Ffmrihrf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Ffmrihrf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbuchsbaum","download_url":"https://codeload.github.com/bbuchsbaum/fmrihrf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Ffmrihrf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29641933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T03:21:14.183Z","status":"ssl_error","status_checked_at":"2026-02-20T03:18:24.455Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-06-05T09:09:35.516Z","updated_at":"2026-02-20T05:04:28.531Z","avatar_url":"https://github.com/bbuchsbaum.png","language":"R","readme":"\n# fmrihrf\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/fmrihrf)](https://CRAN.R-project.org/package=fmrihrf)\n[![R-CMD-check](https://github.com/bbuchsbaum/fmrihrf/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/bbuchsbaum/fmrihrf/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\nHemodynamic response functions and event-related regressors for fMRI analysis in R.\n\n**fmrihrf** provides a composable toolkit for constructing, modifying, and convolving HRFs with experimental designs. It ships with standard basis sets (SPM canonical, B-spline, Fourier, FIR, Gamma, Gaussian, and more), decorators for time-shifting and blocking, and a fast C++ convolution backend.\n\n## Installation\n\n```r\n# From CRAN\ninstall.packages(\"fmrihrf\")\n\n# Development version\nremotes::install_github(\"bbuchsbaum/fmrihrf\")\n```\n\n## Quick start\n\n```r\nlibrary(fmrihrf)\n\n# Evaluate the SPM canonical HRF over 0-30 seconds\nt \u003c- seq(0, 30, by = 0.1)\ny \u003c- evaluate(HRF_SPMG1, t)\nplot(t, y, type = \"l\", xlab = \"Time (s)\", ylab = \"Response\")\n\n# Build a regressor from event onsets\nreg \u003c- regressor(onsets = c(2, 10, 18), hrf = HRF_SPMG1,\n                 duration = 0, amplitude = 1,\n                 span = 24, sampling_frame = sampling_frame(blocklens = 100, TR = 1))\nplot(reg)\n```\n\n## Key features\n\n**Multiple basis sets** --- Use a single canonical HRF or a flexible basis set to capture response variability.\n\n```r\nHRF_SPMG1                                    # SPM canonical (double gamma)\nHRF_SPMG3                                    # canonical + temporal \u0026 dispersion derivatives\nhrf_bspline(t, N = 6)                        # B-spline basis\nhrf_fourier(t, N = 5)                        # Fourier basis\n```\n\n**Decorators** --- Modify any HRF through functional composition.\n\n```r\nlag_hrf(HRF_SPMG1, lag = 2)                  # shift peak by 2 s\nblock_hrf(HRF_SPMG1, width = 15)             # sustained/blocked response\nnormalise_hrf(HRF_SPMG1)                     # unit peak-normalised\n```\n\n**Custom HRFs** --- Wrap any `f(t)` into the HRF system.\n\n```r\nmy_hrf \u003c- as_hrf(function(t) exp(-t / 5), name = \"exponential\", span = 20)\nevaluate(my_hrf, seq(0, 20, by = 1))\n```\n\n**Regressor construction** --- Convolve events with HRFs to produce design-matrix columns, with support for variable durations, amplitudes, and multi-basis expansion.\n\n```r\nsf \u003c- sampling_frame(blocklens = c(200, 200), TR = 2)\nreg \u003c- regressor(onsets = c(10, 30, 50), hrf = HRF_SPMG1,\n                 duration = c(0, 5, 0), amplitude = c(1, 1.5, 1),\n                 sampling_frame = sf)\nevaluate(reg)\n```\n\n**Fast convolution** --- Core routines are implemented in C++ (Rcpp / RcppArmadillo) for efficient large-scale design matrix generation.\n\n## Documentation\n\nFull documentation is available at \u003chttps://bbuchsbaum.github.io/fmrihrf/\u003e.\n\nVignettes cover the main workflows:\n\n- [Hemodynamic Response Functions](https://bbuchsbaum.github.io/fmrihrf/articles/a_01_hemodynamic_response.html) --- overview of built-in HRFs and the basis-set system\n- [Building Regressors](https://bbuchsbaum.github.io/fmrihrf/articles/a_02_regressor.html) --- constructing design-matrix regressors from event timing\n- [HRF Generators](https://bbuchsbaum.github.io/fmrihrf/articles/a_03_hrf_generators.html) --- programmatically generating families of HRFs\n- [Advanced Modeling and Design](https://bbuchsbaum.github.io/fmrihrf/articles/a_04_advanced_modeling.html) --- multi-basis designs, trial-varying HRFs, and more\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbuchsbaum%2Ffmrihrf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbuchsbaum%2Ffmrihrf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbuchsbaum%2Ffmrihrf/lists"}