{"id":28423836,"url":"https://github.com/bbuchsbaum/fmridataset","last_synced_at":"2025-06-25T18:31:01.275Z","repository":{"id":296591893,"uuid":"993782338","full_name":"bbuchsbaum/fmridataset","owner":"bbuchsbaum","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-17T21:15:36.000Z","size":2043,"stargazers_count":0,"open_issues_count":9,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-17T22:26:06.221Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://bbuchsbaum.github.io/fmridataset/","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":"NEWS.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":"codemeta.json","zenodo":null}},"created_at":"2025-05-31T14:10:02.000Z","updated_at":"2025-06-17T21:15:40.000Z","dependencies_parsed_at":"2025-06-17T22:22:55.207Z","dependency_job_id":"b4714ba3-83ab-4d59-a9ae-73ea8eeb19f4","html_url":"https://github.com/bbuchsbaum/fmridataset","commit_stats":null,"previous_names":["bbuchsbaum/fmridataset"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bbuchsbaum/fmridataset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Ffmridataset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Ffmridataset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Ffmridataset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Ffmridataset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbuchsbaum","download_url":"https://codeload.github.com/bbuchsbaum/fmridataset/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbuchsbaum%2Ffmridataset/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261930409,"owners_count":23231876,"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","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:38.970Z","updated_at":"2025-06-25T18:31:01.268Z","avatar_url":"https://github.com/bbuchsbaum.png","language":"R","readme":"# fmridataset \u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"139\" /\u003e\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/bbuchsbaum/fmridataset/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/bbuchsbaum/fmridataset/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/bbuchsbaum/fmridataset/branch/main/graph/badge.svg)](https://app.codecov.io/gh/bbuchsbaum/fmridataset?branch=main)\n[![lint](https://github.com/bbuchsbaum/fmridataset/actions/workflows/lint.yaml/badge.svg)](https://github.com/bbuchsbaum/fmridataset/actions/workflows/lint.yaml)\n[![pkgcheck](https://github.com/bbuchsbaum/fmridataset/workflows/pkgcheck/badge.svg)](https://github.com/bbuchsbaum/fmridataset/actions?query=workflow%3Apkgcheck)\n[![CRAN status](https://www.r-pkg.org/badges/version/fmridataset)](https://CRAN.R-project.org/package=fmridataset)\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)\n\u003c!-- badges: end --\u003e\n\n## Overview\n\n`fmridataset` provides a unified S3 class for representing functional magnetic resonance imaging (fMRI) data from various sources. The package supports multiple data backends and offers a consistent interface for working with fMRI datasets regardless of their underlying storage format.\n\n## Features\n\n- **Unified Interface**: Work with fMRI data from NIfTI files, BIDS projects, pre-loaded NeuroVec objects, and in-memory matrices through a single API\n- **Lazy Loading**: Efficient memory management with on-demand data loading\n- **Flexible Backends**: Pluggable storage backends for different data formats\n- **Data Chunking**: Built-in support for processing large datasets in chunks\n- **Temporal Structure**: Rich sampling frame representation for run lengths, TR, and temporal organization\n- **Integration Ready**: Seamlessly integrates with neuroimaging analysis workflows\n\n## Installation\n\nYou can install the development version of fmridataset from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"bbuchsbaum/fmridataset\")\n```\n\n## Quick Start\n\n### Creating Datasets\n\n```r\nlibrary(fmridataset)\n\n# From NIfTI files\ndataset \u003c- fmri_dataset(\n  scans = c(\"run1.nii\", \"run2.nii\"),\n  mask = \"mask.nii\", \n  TR = 2.0,\n  run_length = c(240, 240)\n)\n\n# From in-memory matrix\nmat_data \u003c- matrix(rnorm(1000), nrow = 100, ncol = 10)\ndataset \u003c- matrix_dataset(\n  datamat = mat_data,\n  TR = 1.5, \n  run_length = 100\n)\n\n# From pre-loaded NeuroVec objects  \ndataset \u003c- fmri_mem_dataset(\n  scans = list(neurovec1, neurovec2),\n  mask = mask_vol,\n  TR = 2.0\n)\n```\n\n### Data Access\n\n```r\n# Get full data matrix\ndata_matrix \u003c- get_data_matrix(dataset)\n\n# Get spatial mask\nmask \u003c- get_mask(dataset)\n\n# Access temporal properties\nn_timepoints(dataset$sampling_frame)\nn_runs(dataset$sampling_frame)\nget_TR(dataset$sampling_frame)\n```\n\n### Data Chunking\n\n```r\n# Process data in chunks\nchunks \u003c- data_chunks(dataset, nchunks = 5)\nfor (i in 1:5) {\n  chunk \u003c- chunks$nextElem()\n  # Process chunk$data, chunk$voxel_ind, etc.\n}\n\n# Run-wise processing\nrun_chunks \u003c- data_chunks(dataset, runwise = TRUE)\nrun1_data \u003c- run_chunks$nextElem()\n```\n\n### Type Conversions\n\n```r\n# Convert to matrix format\nmat_dataset \u003c- as.matrix_dataset(dataset)\n\n# All dataset types support the same interface\nprint(dataset)\nsummary(dataset$sampling_frame)\n```\n\n## Architecture\n\nThe package uses a modular architecture with the following key components:\n\n- **Storage Backends**: Pluggable data access layer (`matrix_backend`, `nifti_backend`)\n- **Dataset Constructors**: High-level dataset creation functions\n- **Sampling Frames**: Temporal structure representation\n- **Data Access Methods**: Consistent interface for data retrieval\n- **Chunking System**: Efficient processing of large datasets\n\n## Related Packages\n\n- [`neuroim2`](https://github.com/bbuchsbaum/neuroim2): Neuroimaging data structures\n- [`fmristore`](https://github.com/bbuchsbaum/fmristore): Advanced fMRI data storage\n- [`bidser`](https://github.com/bbuchsbaum/bidser): BIDS dataset utilities\n\n## Getting Help\n\n- Check the [package documentation](https://bbuchsbaum.github.io/fmridataset/) for detailed guides\n- Report bugs or request features on [GitHub Issues](https://github.com/bbuchsbaum/fmridataset/issues)\n- See the [vignettes](https://bbuchsbaum.github.io/fmridataset/articles/) for detailed examples\n\n## Contributing\n\nContributions are welcome! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n## License\n\nGPL (\u003e= 3) ","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbuchsbaum%2Ffmridataset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbuchsbaum%2Ffmridataset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbuchsbaum%2Ffmridataset/lists"}