Metadata-Version: 2.5
Name: brainfc
Version: 0.3.0
Summary: Local fMRI to functional connectivity: Python API, offline GUI and eight-view brain networks
Project-URL: Homepage, https://github.com/hanxiangmin/brainfc
Project-URL: Source, https://github.com/hanxiangmin/brainfc
Project-URL: Issues, https://github.com/hanxiangmin/brainfc/issues
Project-URL: Documentation, https://github.com/hanxiangmin/brainfc/tree/main/docs
Author: BrainFC contributors
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
License-File: src/brainfc/web/static/THIRD_PARTY_NOTICES.txt
Keywords: bids,connectome,fmri,functional-connectivity,neuroimaging
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.11
Requires-Dist: fastapi>=0.115
Requires-Dist: matplotlib>=3.8
Requires-Dist: nibabel>=5.2
Requires-Dist: nilearn<0.15,>=0.14
Requires-Dist: numpy>=1.26
Requires-Dist: pandas>=2.1
Requires-Dist: python-multipart>=0.0.20
Requires-Dist: scikit-image>=0.23
Requires-Dist: scikit-learn>=1.4
Requires-Dist: scipy>=1.12
Requires-Dist: uvicorn>=0.30
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: hatchling>=1.27; extra == 'dev'
Requires-Dist: httpx>=0.27; extra == 'dev'
Requires-Dist: markdown>=3.6; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: pyyaml>=6; extra == 'dev'
Requires-Dist: ruff>=0.9; extra == 'dev'
Requires-Dist: twine>=6; extra == 'dev'
Description-Content-Type: text/markdown

![BrainFC: functional connectivity, made visible](https://raw.githubusercontent.com/hanxiangmin/brainfc/main/docs/assets/brainfc-hero.png)

# BrainFC

**fMRI → ROI time series → functional connectivity → matrix, eight-view and interactive 3D reports.**

BrainFC is a Python library with a command-line interface and a local graphical interface. Both interfaces use the same processing core. The default installation includes the GUI and an offline API manual. Python 3.11 or newer is required; ordinary users do not need Node.js.

## Install and launch

```shell
pip install brainfc
brainfc serve
```

The interface opens at `http://127.0.0.1:8766`. Choose the built-in demo to generate synthetic NIfTI inputs and a complete report without downloading participant data. The offline manual is available at `/reference/` and the HTTP API schema at `/docs`.

## Python API

```python
from brainfc import Config, extract_connectome

# A TSV with a header: rows are time points, columns are ROI signals.
result = extract_connectome(
    "signals.tsv",
    config=Config(detrend=False, standardize=False),
)
matrix = result.connectivity
result.save("results/run-001")
```

The destination must be new. For volume images, supply an integer-label atlas in the same explicitly named space and confirm that spatial preprocessing is complete. Filtering, confound regression and censoring must match the provenance of the input signals; the example above does not add temporal denoising.

## Capabilities

- Read supported NiBabel volume containers, CIFTI time series, paired GIFTI data/labels, and CSV/TSV/TXT/1D/NPY/NPZ/MAT tables (excluding MAT v7.3).
- Extract ROI means; apply confound regression, temporal cleaning and censoring while retaining original frame indices.
- Compute Pearson, Spearman or Ledoit-Wolf partial correlations, with a separate Fisher-z matrix.
- Export arrays, tables, quality records, input fingerprints, figures and an offline interactive report.
- Synchronize selected connections and display thresholds between the 3D viewer and eight anatomical views. Display filtering does not modify the complete signed matrix.

Raw DICOM/BIDS spatial preprocessing requires external dcm2niix/fMRIPrep. BrainFC provides command adapters; it does not implement that preprocessing itself. The complete external raw-data chain has not been validated in this release. This package does not provide disease diagnosis or cohort-level inference.

## Documentation and source

- [Quickstart](https://github.com/hanxiangmin/brainfc/blob/main/docs/quickstart.md)
- [Complete Python API](https://github.com/hanxiangmin/brainfc/blob/main/docs/api-reference.md)
- [Python usage guide](https://github.com/hanxiangmin/brainfc/blob/main/docs/python-api.md)
- [Input formats and processing contract](https://github.com/hanxiangmin/brainfc/blob/main/docs/formats.md)
- [Source code and issues](https://github.com/hanxiangmin/brainfc)

Licensed under Apache-2.0. The 3D viewer is adapted from Hyper-Brain; BrainFC runs independently. Dataset and atlas licenses remain with their original providers.
