Skip to main content

Fyron Banner

PyPI Python CI Security policy License Public beta FHIR DICOM Survival ML Docs

Fyron

Clinical data science, from source systems to evidence artifacts.

Fyron is an open Python toolkit for healthcare researchers, imaging AI teams, and clinical data scientists who need research workflows to be inspectable, reproducible, and ready for scientific review. It connects the practical pieces around clinical evidence generation: FHIR and DICOM acquisition, local imaging and BOA outputs, cohort construction, manuscript statistics, survival analysis, tabular machine learning, validation, explainability, paper-ready figures, and provenance manifests.

We developed Fyron from years of hands-on clinical data science work, where the hard part is rarely one isolated model or one isolated table. Real studies often span hospital systems, registries, PACS exports, segmentation folders, spreadsheets, notebooks, statistical scripts, figures, and reviewer questions. Fyron gives those steps a shared, explicit shape so assumptions are visible and outputs can be checked, saved, repeated, and cited.

Fyron is not a replacement for pandas, scikit-learn, lifelines, highdicom, MONAI, or FHIR/DICOM libraries. It is the pragmatic research layer around them: small APIs, explicit parameters, DataFrame-first outputs, Matplotlib figures, clinical workflow defaults, and audit artifacts that help a team move from raw clinical data to defensible scientific results.

Documentation · Public Beta · API Design · Example Gallery · Curate · Fyron Skill · Using Fyron In Research

What Fyron Enables

Research need Fyron support
Acquire clinical data FHIR REST/SQL workflows, FHIRPath extraction presets, DICOMweb downloads, document downloads
Build cohorts patient joins, endpoint construction, cohort profiles, filter-flow explainability
Work with imaging AI outputs DICOM/NIfTI utilities, BOA feature extraction, radiomics, DICOM SEG export, segmentation collages, Curate preview folders, CT/MR difference heatmaps
Prepare training datasets nnU-Net v2 segmentation folders, YOLO classification folders, YOLO detection labels
Produce manuscript statistics Table 1, missingness/QC tables, FDR correction, regression tables, model-comparison tests
Run survival and ML studies Kaplan-Meier, Cox, RMST, Schoenfeld diagnostics, classification pipelines, calibration, thresholds, subgroup metrics
Explain and review results feature importance, SHAP-ready summaries, patient-level prediction drivers, cohort flow charts, paper-ready plots
Preserve provenance analysis run manifests, file hashes, parameters, output paths, package/version metadata

Why We Built Fyron

Clinical research is full of valuable but fragmented work: a FHIR query in one place, an imaging export in another, a cohort spreadsheet, a survival notebook, a model validation script, and figures assembled late in the manuscript process. That fragmentation makes it difficult to answer simple but essential questions: Which patients entered the study? Which endpoint definition was used? Which features were excluded? Which parameters produced this figure?

Fyron is built for that middle layer. It makes the common clinical data science steps explicit, composable, and reviewable without turning them into a black box. The goal is not AutoML and not regulatory compliance software; the goal is practical scientific discipline: clear inputs, clear assumptions, clear outputs, and artifacts that can travel from notebook to manuscript to supplement.

From Clinical Data To Evidence

FHIR / DICOM / files
        -> cohort and endpoints
        -> feature tables and imaging measurements
        -> statistics, survival, and ML
        -> validation and explainability
        -> figures, reports, and provenance manifests
from fyron import FHIRRestClient
from fyron.fhir import get_fhir_path_preset
from fyron.cohort import build_time_to_event_endpoint, cohort_profile
from fyron.flow import FlowTracker
from fyron.audit import analysis_run_manifest, write_manifest

client = FHIRRestClient("https://hapi.fhir.org/baseR4")
observations = client.search_df(
    "Observation",
    params={"_count": 50, "code": "http://loinc.org|718-7"},
    fhir_paths=get_fhir_path_preset("Observation"),
    max_pages=1,
)

cohort = build_time_to_event_endpoint(
    cohort,
    index_date_col="diagnosis_date",
    event_date_col="death_date",
    censor_date_col="last_followup_date",
)

profile = cohort_profile(cohort, id_col="patient_id", endpoint_cols=["time", "event"])

flow = FlowTracker("NSCLC CT cohort")
flow.add_step("Reviewed export", cohort, reason="source cohort")

manifest = analysis_run_manifest(
    title="nsclc_ct_survival_model",
    inputs=["cohort.csv", "features.csv"],
    outputs=["table1.csv", "km.png", "model_metrics.csv"],
    parameters={"seed": 42, "endpoint": "overall_survival"},
)
write_manifest(manifest, "analysis_manifest.json")

The Example Gallery contains full synthetic workflows for FHIR-to-cohort, BOA/imaging validation, cohort-flow explainability, manuscript statistics, plotting, DICOM SEG export, and CT/MR difference heatmaps.

Built For Responsible Research

  • Local-first by default. Fyron sends no telemetry on import; external calls happen only when you configure a client or CLI command.
  • Inspectable outputs. Core helpers return DataFrames, dictionaries, named objects, Matplotlib figures, and JSON-compatible manifests.
  • Explicit clinical assumptions. Endpoints, censoring, event coding, FHIR paths, imaging geometry, p-value correction, and model validation choices are parameterized.
  • Synthetic examples. Documentation examples are designed to be runnable without PHI.
  • Research, not clinical deployment. Fyron is not a medical device, treatment recommendation system, or compliance platform.

For citation, security, and research-use expectations, see CITATION.cff, SECURITY.md, and Using Fyron In Research.

Install

uv add fyron

With pip:

pip install fyron

Useful extras:

Extra Install Adds
All features uv add "fyron[all]" Full local research environment with every optional dependency
Excel uv add "fyron[excel]" Excel read/write via openpyxl
Survival uv add "fyron[survival]" KM, RMST, Cox, Weibull AFT
Survival ML uv add "fyron[survival-ml]" Gradient survival boosting via scikit-survival
ML uv add "fyron[ml]" Random Forest, XGBoost, metrics, plots
Statistics uv add "fyron[statistics]" FDR correction, regression tables, QC tests
Feature selection uv add "fyron[feature-selection]" Univariate, model, permutation, Boruta, stability selection
Validation uv add "fyron[validation]" Thresholds, calibration, subgroups, decision curves
Explainability uv add "fyron[explainability]" Permutation importance, partial dependence, SHAP tables
Radiomics uv add "fyron[radiomics]" BOA radiomics via PyRadiomics
Visualization uv add "fyron[visualization]" BOA collages, Curate previews, and CT/MR difference heatmaps
S3 uv add "fyron[s3]" S3 and S3-compatible table/object storage
Curate uv add "fyron[curate]" Local Docker Compose image cohort review app

For a broad local analysis environment:

uv add "fyron[all]"

Modules

Module Purpose
fyron.fhir FHIR REST/SQL access, FHIRPath extraction, resource building, mapping, write-back
fyron.dicom DICOMweb downloads, study/series manifests, NIfTI conversion, DICOM SEG
fyron.boa_extraction BOA cohort feature tables from measurement JSON and NIfTI masks
fyron.boa_radiomics Radiomics extraction from BOA segmentations
fyron.datasets Synthetic demo data plus nnU-Net v2 and YOLO dataset preparation
fyron.cohort Patient joins, endpoint construction, cohort profiles, survival columns
fyron.flow Filter-flow tracking, Markdown flow charts, cohort inclusion explainability
fyron.statistics FDR correction, regression tables, model-comparison tests, QC tables
fyron.survival KM, RMST, Cox, Weibull AFT, PH checks, Schoenfeld residual diagnostics
fyron.ml Tabular classification pipelines, metrics, model plots
fyron.validation Bootstrap metrics, calibration, thresholding, subgroup and survival validation
fyron.explainability Feature importance, SHAP summaries, patient-level prediction explanations
fyron.reporting Table 1, metric tables, cohort-flow tables, Markdown report tables
fyron.audit Provenance manifests, file hashes, analysis run records
fyron.plotting Clinical and paper-ready plots across survival, ML, QC, and flow workflows

See the module documentation for workflow guides, tutorials, and the generated complete function reference.

Curate

Fyron Curate is the local image cohort review app that ships with Fyron. Use it when you need a fast, visual pass over image folders before downstream analysis: reject unusable scans, keep clean examples for figures, prepare manual QA sets, or review CT/MRI/X-ray previews without changing the original source files.

Curate runs locally through Docker Compose. It stores review metadata in PostgreSQL, keeps uploaded source files immutable, and exports a clean folder containing only accepted images.

Install the Curate extra:

uv add "fyron[curate]"

Docker Desktop or another Docker Compose runtime must be installed and running. Then start the app:

fyron curate

Open the local app at:

http://localhost:5174/

The review workflow is:

  1. Create a cohort.
  2. Drop an image or DICOM folder into the Add cohort dialog.
  3. Review the gallery thumbnails.
  4. Mark images or DICOM series as accepted or rejected.
  5. Export a clean accepted-image folder.

For CT/MRI volumes, DICOM series, X-rays, scout views, or topograms, you can prepare browser-friendly PNG previews first:

uv add "fyron[visualization,curate]"
fyron dataset-curate-previews --input-dir ct_exports/ --output-dir curate_previews/
fyron curate

Drop curate_previews/ into Curate. Three-dimensional volumes and DICOM series produce middle axial, coronal, and sagittal PNGs; 2D images such as X-rays or topograms produce one PNG. The preview command also writes a manifest so exported review images stay traceable to their source files.

See the full Curate documentation for startup options, supported formats, DICOM behavior, exports, and persistent Docker volumes.

Start with the Example Gallery for runnable synthetic workflows. It includes FHIR-to-cohort, BOA/imaging validation, cohort-flow explainability, manuscript statistics, plotting, DICOM SEG export, synthetic GAN volume export, and CT/MR difference heatmaps.

Several plotting examples render manuscript-style figures:

Risk score distribution Forest estimates

Public Beta

Fyron is in public beta. The main workflows are intended to be useful and reproducible, but some APIs may still evolve as researchers try the package on real projects. We try to make changes additive, document migration paths, and avoid surprising notebook breakage. See PUBLIC_BETA.md, SUPPORT.md, and the Open Source Release Checklist for the current readiness policy.

Privacy And Security

Fyron is local-first and sends no telemetry on import. External calls happen only when you configure a client or CLI command for systems such as FHIR, DICOMweb, S3, Teable, or document downloads. See SECURITY.md and Using Fyron In Research for healthcare data cautions.

Contributing

uv sync --all-extras --dev
uv run pytest

Preview the docs locally:

uv run python scripts/build_docs.py
uv run python -m http.server 8001 --directory site

For public support expectations and the 0.x compatibility policy, see SUPPORT.md. For research-use privacy notes, see Using Fyron In Research.

License

MIT. See LICENSE.

Release files for fyron 0.3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fyron 0.3.6
File Size Uploaded
fyron-0.3.6.tar.gz 4.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for fyron 0.3.6
File Interpreter ABI Platform
fyron-0.3.6-py3-none-any.whl Python 3 none any Details

Total release size: 5.3 MB

Release files / fyron-0.3.6.tar.gz

Download URL fyron-0.3.6.tar.gz
Size 4.8 MB
Tags Source
SHA-256 checksum
How to use checksums
f9559e66217998b0123d22d419daad1a994dbef02561fb15575d6416cf170678
BLAKE2b-256 checksum
How to use checksums
6567a47e9ac355da4ed1b28251d5a4073ca7a02d496ff22296d255672e563559
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.8

Release files / fyron-0.3.6-py3-none-any.whl

Download URL fyron-0.3.6-py3-none-any.whl
Size 465.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9992c67dbeaee30a8e935671f9ce219112e9677569044c952810df49cbef576b
BLAKE2b-256 checksum
How to use checksums
f3f6462192d5a515fc0ec64c9098f52f83a924c39084e9417b1adf7f3f28c556
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.8

Release history Release notifications | RSS feed

This release

0.3.6 This release

2 release files

0.3.5

2 release files

0.3.4

1 release file

0.3.3

1 release file

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page