Skip to main content

Fyron Banner

PyPI CI Python License 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 · API Design · Example Gallery · Curate · 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]"

Start the local cohort curation app after installing Docker Desktop:

fyron curate

Prepare CT/MRI folders for Curate review by rendering 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 the Curate Add cohort dialog. Three-dimensional volumes and DICOM series produce middle axial, coronal, and sagittal PNGs; 2D images such as X-rays or topograms produce one PNG.

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

Beta desktop tooling:

  • fyron curate starts the local image cohort review app.

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

Example Gallery

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.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fyron-0.2.9.tar.gz (4.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fyron-0.2.9-py3-none-any.whl (420.7 kB view details)

Uploaded Python 3

File details

Details for the file fyron-0.2.9.tar.gz.

File metadata

  • Download URL: fyron-0.2.9.tar.gz
  • Upload date:
  • Size: 4.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for fyron-0.2.9.tar.gz
Algorithm Hash digest
SHA256 99dd6458ed7ffe9225186999a6fde7d1a8eef9ef31c58f60603ab951b80d5592
MD5 7c3b8f89825fd61510bb2142b49ab2be
BLAKE2b-256 1a39761cecbc500ab36c1549a32f564b0ceece313d8aef160db7ea4f5f96ec9d

See more details on using hashes here.

File details

Details for the file fyron-0.2.9-py3-none-any.whl.

File metadata

  • Download URL: fyron-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 420.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for fyron-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 26f36c375ce9109dd79e6d325ee6a89e9ff4f0bfed906b17d8d66b5767db5348
MD5 53dd3400db625a216c94a453a9f71aab
BLAKE2b-256 5cb7c7f899a3cb65edbecba1926fb48ac8a7561c9f23c10016e83ececbf084fc

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.5

2 files

0.3.4

1 file

0.3.3

1 file

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

This release

0.2.9 This release

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 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