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 curatestarts 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:
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fyron-0.2.7.tar.gz.
File metadata
- Download URL: fyron-0.2.7.tar.gz
- Upload date:
- Size: 3.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82988f69f33b249b7eb3a505bc2a80175c13557a4d7a1f183de1c35b48cc995e
|
|
| MD5 |
58c73e8a1f22c05ee3fac9ea60c5dd6d
|
|
| BLAKE2b-256 |
ebda4c2ddd9e87d5efa07c0ba4dd5c465f7c501034e6b237bec22719d9d34f4d
|
File details
Details for the file fyron-0.2.7-py3-none-any.whl.
File metadata
- Download URL: fyron-0.2.7-py3-none-any.whl
- Upload date:
- Size: 415.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bda233a56e1a07448662f9c69ae17ec04ba25ebe690c04aac72215e648263ad
|
|
| MD5 |
e0339752eb6f83eb9c262055ba0a13de
|
|
| BLAKE2b-256 |
0bbcab4c2b727426b9a36f3fc84f26fd6d6222d8d0e8ba5e6c7ef1f32a305bdf
|