{"id":13934842,"url":"https://github.com/analysiscenter/radio","last_synced_at":"2026-01-21T02:38:53.714Z","repository":{"id":98860832,"uuid":"109618587","full_name":"analysiscenter/radio","owner":"analysiscenter","description":"RadIO is a library for data science research of computed tomography imaging","archived":false,"fork":false,"pushed_at":"2022-01-21T14:20:04.000Z","size":12406,"stargazers_count":220,"open_issues_count":1,"forks_count":52,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-08-08T23:19:00.361Z","etag":null,"topics":["computed-tomography","data-science","deep-learning","machine-learning","medical-imaging","neural-networks","tensorflow"],"latest_commit_sha":null,"homepage":"https://analysiscenter.github.io/radio/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/analysiscenter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-11-05T21:37:38.000Z","updated_at":"2024-04-25T02:14:39.000Z","dependencies_parsed_at":"2023-03-17T08:00:58.129Z","dependency_job_id":null,"html_url":"https://github.com/analysiscenter/radio","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analysiscenter%2Fradio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analysiscenter%2Fradio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analysiscenter%2Fradio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analysiscenter%2Fradio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/analysiscenter","download_url":"https://codeload.github.com/analysiscenter/radio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226666437,"owners_count":17665030,"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":["computed-tomography","data-science","deep-learning","machine-learning","medical-imaging","neural-networks","tensorflow"],"created_at":"2024-08-07T23:01:16.264Z","updated_at":"2026-01-21T02:38:53.708Z","avatar_url":"https://github.com/analysiscenter.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook"],"sub_categories":[],"readme":"# RadIO\n\n**RadIO** is a framework for data science research of computed tomography (CT) imaging.\n\nMain features:\n- Asynchronously load **DICOM** and **MetaImage** (mhd/raw) files\n- Dump files to [blosc](http://blosc.org/) to compress datasets and thus accelerate loading\n- Transform and augment CT-scans in parallel for faster preprocessing\n- Create concise chainable workflows with `actions` or use tailored [pipelines](https://analysiscenter.github.io/radio/intro/pipelines.html) for preprocessing or model training\n- Train with ease a zoo of state-of-the-art neural networks for classification or semantic segmentation\n- Sample crops of any size from CT-scans for comprehensive training\n- Customize distribution of crop [locations](https://analysiscenter.github.io/radio/intro/preprocessing.html?highlight=histogram#sample-crops-from-scan) for improved training\n- Predict [on the whole scan](https://analysiscenter.github.io/radio/api/masked_batch.html#radio.preprocessing.ct_masked_batch.CTImagesMaskedBatch.predict_on_scan)\n\n[The documentation](https://analysiscenter.github.io/radio) contains a comprehensive review of RadIO's capabilities. While [tutorials](https://github.com/analysiscenter/radio/tree/master/tutorials) provide ready-to-use code blocks and a practical demonstration of the most important RadIO features.\n\n\n## Tutorials\n\nThere are four tutorials available:\n\n- In the [first](https://github.com/analysiscenter/radio/tree/master/tutorials/RadIO.I.ipynb) one you can learn how to set up a dataset of CT-scans and define a basic preprocessing workflow.\n- The [second tutorial](https://github.com/analysiscenter/radio/tree/master/tutorials/RadIO.II.ipynb) contains in-depth discussion of preprocessing and augmentation actions.\n- The [third tutorial](https://github.com/analysiscenter/radio/tree/master/tutorials/RadIO.III.ipynb) explains how to generate batches to train a neural network.\n- The [fourth tutorial](https://github.com/analysiscenter/radio/tree/master/tutorials/RadIO.IV.ipynb)\nwill help you configure and train a neural network to detect cancer.\n\n\n## Preprocess scans with chained actions\n\nPreprocessing-module contains a set of [actions](https://github.com/analysiscenter/batchflow) to efficiently prepare a dataset of CT-scans for neural networks training.\n\nSay, you have a bunch of **DICOM** scans with varying shapes.\nFirst, you create an index and define a dataset:\n```python\nfrom radio import CTImagesBatch\nfrom radio.batchflow import FilesIndex, Dataset\n\ndicom_ix = FilesIndex(path='path/to/dicom/*', dirs=True)            # set up the index\ndicom_dataset = Dataset(index=dicom_ix, batch_class=CTImagesBatch) # init the dataset of dicom files\n```\n\nYou may want to resize the scans to equal shape **[128, 256, 256]**,\nnormalize voxel densities to range **[0, 255]** and dump transformed\nscans. This preprocessing can be easily performed with the following\npipeline:\n\n```python\npipeline = (\n    dicom_dataset.p\n    .load(fmt='dicom')\n    .resize(shape=(128, 256, 256))\n    .normalize_hu()\n    .dump('/path/to/preprocessed/scans/')\n)\npipeline.run(batch_size=20)\n```\n\nSee the [documentation](https://analysiscenter.github.io/radio/intro/preprocessing.html) for the description of\npreprocessing actions implemented in the module.\n\n\n## Preprocess scans using a pre-defined workflow\n\nPipelines module contains ready-to-use workflows for most frequent tasks.\nFor instance, if you want to preprocess a dataset of scans named ``dicom_dataset`` and\nprepare data for training a neural network, you can simply execute the following\npipeline creator (without spending much time on thinking what actions to choose for\na workflow):\n\n```python\nfrom radio.pipelines import get_crops\n\nnodata_pipeline = get_crops(fmt='raw', shape=(128, 256, 256),\n                            nodules=nodules, batch_size=20,\n                            share=0.6, nodule_shape=(32, 64, 64))\n\ndicom_pipeline = dicom_dataset \u003e\u003e nodata_pipeline\n\nfor batch in dicom_pipeline.gen_batch(batch_size=12, shuffle=True):\n    # ...\n    # train a model here\n```\nSee [pipelines section](https://analysiscenter.github.io/radio/intro/pipelines.html) for more information about\nready-to-use workflows.\n\n\n## Adding a neural network to a workflow\n\n`RadIO` contains proven architectures for classification, segmentation and detection, including neural networks designed specifically\nfor cancer detection (e.g. `DenseNoduleNet` inspired by the state-of-the-art DenseNet, but well suited for 3D CT scans):\n\n```python\nfrom radio.preprocessing import CTImagesMaskedBatch as CTIMB\nfrom radio.models import DenseNoduleNet\nfrom radio.batchflow import F\n\ntraining_pipeline = (\n    dicom_dataset.p\n      .load(fmt='raw')\n      .fetch_nodules_info(nodules_df)\n      .create_mask()\n      .sample_nodules(nodule_size=(32, 64, 64), batch_size=20)\n      .init_model('static', DenseNoduleNet, 'net')\n      .train_model('net', feed_dict={\n          'images': F(CTIMB.unpack, component='images'),\n          'labels': F(CTIMB.unpack, component='classification_targets')\n      })\n)\n\ntraining_pipeline.run(batch_size=10, shuffle=True)\n```\nThe [models documentation](https://analysiscenter.github.io/radio/intro/models.html) contains more information about implemented\narchitectures and their application to cancer detection.\n\n\n## Installation\n\n\u003e `RadIO` module is in the beta stage. Your suggestions and improvements are very welcome.\n\n\u003e `RadIO` supports python 3.5 or higher.\n\n\n### Installation as a python package\n\nWith [pipenv](https://docs.pipenv.org/):\n\n    pipenv install git+https://github.com/analysiscenter/radio.git#egg=radio\n\nWith [pip](https://pip.pypa.io/en/stable/):\n\n    pip3 install git+https://github.com/analysiscenter/radio.git\n\nAfter that just import `radio`:\n```python\nimport radio\n```\n\n\n### Installation as a project repository:\n\nWhen cloning repo from GitHub use flag ``--recursive`` to make sure that ``BatchFlow`` submodule is also cloned.\n\n    git clone --recursive https://github.com/analysiscenter/radio.git\n\n\n## Citing RadIO\n\nPlease cite RadIO in your publications if it helps your research.\n\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1156363.svg)](https://doi.org/10.5281/zenodo.1156363)\n\n    Khudorozhkov R., Emelyanov K., Koryagin A., Kozhevin A. RadIO library for data science research of CT images. 2017.\n\n```\n@misc{radio_2017_1156363,\n  author = {Khudorozhkov R., Emelyanov K., Koryagin A., Kozhevin A.},\n  title  = {RadIO library for data science research of CT images},\n  year   = 2017,\n  doi    = {10.5281/zenodo.1156363},\n  url    = {https://doi.org/10.5281/zenodo.1156363}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanalysiscenter%2Fradio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanalysiscenter%2Fradio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanalysiscenter%2Fradio/lists"}