{"id":26236793,"url":"https://github.com/radxtools/collageradiomics","last_synced_at":"2025-04-22T19:20:50.805Z","repository":{"id":37214420,"uuid":"272271183","full_name":"radxtools/collageradiomics","owner":"radxtools","description":"Python Implementation of the CoLlAGe radiomics descriptor. CoLlAGe captures subtle anisotropic differences in disease pathologies by measuring entropy of co-occurrences of voxel-level gradient orientations on imaging computed within a local neighborhood.","archived":false,"fork":false,"pushed_at":"2023-08-14T23:08:48.000Z","size":2964,"stargazers_count":17,"open_issues_count":31,"forks_count":11,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-25T00:47:51.111Z","etag":null,"topics":["3d-slicer-extension","cancer-imaging","cancer-imaging-research","computational-imaging","docker","feature-extraction","itcr","python","radiomics","radiomics-feature-extraction","radiomics-features"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/radxtools.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}},"created_at":"2020-06-14T19:39:52.000Z","updated_at":"2025-03-23T16:48:43.000Z","dependencies_parsed_at":"2022-06-22T14:11:46.545Z","dependency_job_id":null,"html_url":"https://github.com/radxtools/collageradiomics","commit_stats":null,"previous_names":["ccipd/collageradiomics"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radxtools%2Fcollageradiomics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radxtools%2Fcollageradiomics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radxtools%2Fcollageradiomics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radxtools%2Fcollageradiomics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/radxtools","download_url":"https://codeload.github.com/radxtools/collageradiomics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250306601,"owners_count":21408927,"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":["3d-slicer-extension","cancer-imaging","cancer-imaging-research","computational-imaging","docker","feature-extraction","itcr","python","radiomics","radiomics-feature-extraction","radiomics-features"],"created_at":"2025-03-13T04:18:38.902Z","updated_at":"2025-04-22T19:20:50.774Z","avatar_url":"https://github.com/radxtools.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Continuous Delivery](https://github.com/radxtools/collageradiomics/workflows/Continuous%20Delivery/badge.svg) [![Documentation Status](https://readthedocs.org/projects/collageradiomics/badge/?version=latest)](https://collageradiomics.readthedocs.io/en/latest/?badge=latest) [![doi](https://img.shields.io/badge/doi-10.1038/srep37241-brightgreen.svg)](https://doi.org/10.1038/srep37241)\n\n# Co-occurrence of Local Anisotropic Gradient Orientations (CoLlAGe)\n\n# Table of Contents\n- [Science](#science)\n  - [Overview](#overview)\n  - [References](#references)\n- [Code](#code)\n- [Installation \u0026 Setup](#installation--setup)\n  - [Pip Usage](#pip-usage)\n  - [Docker Notebooks](#docker-notebooks)\n  - [Docker Sandbox](#docker-sandbox)\n- [Python Usage](#python-usage)\n\n# Science\n## Overview\n_[Back to **Table of Contents**](#table-of-contents)_\n\n**CoLlAGe** captures subtle anisotropic differences in disease pathologies by measuring entropy of co-occurrences of voxel-level gradient orientations on imaging computed within a local neighborhood.\n\n**CoLlAGe** is based on the hypothesis that disruption in tissue microarchitecture can be quantified on imaging by measuring the disorder in voxel-wise gradient orientations. CoLlAGe involves assigning every image voxel a ‘disorder value’ associated with the co-occurrence matrix of gradient orientations computed around every voxel.\n\nDetails on extraction of **CoLlAGe** features are included in [\\[1\\]](#references). After feature extraction, the subsequent distribution or different statistics such as mean, median, variance etc can be computed and used in conjunction with a machine learning classifier to distinguish similar appearing pathologies. The feasibility of CoLlAGe in distinguishing cancer from treatment confounders/benign conditions and characterizing molecular subtypes of cancers has been demonstrated in the context of multiple challenging clinical problems.\n\nEach of the 13 **CoLlAGe** correlate to one of the 13 Haralick texture features[\\[2\\]](#references):\n1. _AngularSecondMoment_\n2. _Contrast_\n3. _Correlation_\n4. _SumOfSquareVariance_\n5. _SumAverage_\n6. _SumVariance_\n7. _SumEntropy_\n8. _Entropy_\n9. _DifferenceVariance_\n10. _DifferenceEntropy_\n11. _InformationMeasureOfCorrelation1_\n12. _InformationMeasureOfCorrelation2_\n13. _MaximalCorrelationCoefficient_\n\n## References\n_[Back to **Table of Contents**](#table-of-contents)_\n\n\u003ca href=\"http://bric-lab.com\"\u003e\u003cimg align=\"right\" height=100 src=\"https://static.wixstatic.com/media/a0e8e5_809a649f13254ff293405c7476004e20~mv2.png/v1/fill/w_248,h_240,al_c,usm_0.66_1.00_0.01/a0e8e5_809a649f13254ff293405c7476004e20~mv2.png\"\u003e\u003c/a\u003e\n\nIf you make use of this implementation, please cite the following paper:\n\n[1] Prasanna, P., Tiwari, P., \u0026 Madabhushi, A. (2016). \"Co-occurrence of Local Anisotropic Gradient Orientations (CoLlAGe): A new radiomics descriptor. Scientific Reports\", 6:37241.\n\n[2] R. M. Haralick, K. Shanmugam and I. Dinstein, \"Textural Features for Image Classification,\" in IEEE Transactions on Systems, Man, and Cybernetics, vol. SMC-3, no. 6, pp. 610-621, Nov. 1973, [doi: 10.1109/TSMC.1973.4309314](https://doi.org/10.1109/TSMC.1973.4309314).\n\n# Code\n_[Back to **Table of Contents**](#table-of-contents)_\n\nWe made the collage object idempotent Our **CoLlAGe** module includes parameter tuning information in the output. It contains the image(s) and mask(s), and the settings applied upon them. This allows multiple fully reproducible runs without having to remember or find the original parameters.\n\nDocumentation can be found at\nhttp://collageradiomics.rtfd.io/\n\nWe depend on the following libraries:\n- `matplotlib`\n- `numpy`\n- `scikit-learn`\n- `scikit-build`\n- `mahotas`\n- `scipy`\n\n# Installation \u0026 Setup\n_[Back to **Table of Contents**](#table-of-contents)_\n\n## Pip Usage\n```console\npip3 install --upgrade collageradiomics\n\npython3 -c 'import collageradiomics; print(collageradiomics.__name__)'\n```\n\n## Local usage\n```shell\n# get the code\ngit clone https://github.com/radxtools/collageradiomics\ncd collageradiomics\n\n# set up virtual environment\npython3 -m venv collageenv\nsource collageenv/bin/activate\n\n# install requirements\nsudo apt -y install build-essential gcc gfortran python-dev libopenblas-dev liblapack-dev cython libjpeg-dev zlib1g-dev\npip3 install -r requirements.txt\n\n# run test script\ncd modules\npython3 test_script.py\n```\n\n## Docker Sandbox\n_[Back to **Table of Contents**](#table-of-contents)_\n\nThis is the most straightforward way to start playing with the code. And it does not require the `git` commands that the **Jupyter** examples require. This is simply a pre-built container that lets you start trying out the module in **Python** immediately.\n\n```console\nsudo docker pull radxtools/collageradiomics-pip:latest\nsudo docker run -it -v $PWD:/root radxtools/collageradiomics-pip\n```\nIf your terminal prompt changes to `root@[random_string]:/#` then you are now working inside the standardized **Docker** sandbox container environment.\n\nThen you can try to import collage:\n```shell\npython3 -c 'import collageradiomics; print(collageradiomics.__name__)'\n```\n\n## Docker Notebooks\n\n### Prepare Jupyter Notebooks\nTo load the example jupyter notebooks, run the following commands (with or without `sudo` depending on your environment):\n```console\nsudo docker pull radxtools/collageradiomics-pip:latest\nsudo docker run -it radxtools/collageradiomics-pip\n\ngit clone https://github.com/radxtools/collageradiomics.git\nsudo docker pull radxtools/collageradiomics-examples:latest\nsudo docker run -it -p 8888:8888 -v $PWD:/root radxtools/collageradiomics-examples\n```\n\n### Exploring The Examples\n_[Back to **Table of Contents**](#table-of-contents)_\n\n1. Open up a web browser to http://localhost:8888  \n![Jupyter Home](https://i.imgur.com/0XQ8OlT.png)\n2. Navigate to the _Jupyter_ :arrow_right: _Examples_ directory.  \n![Jupyter Examples](https://i.imgur.com/NjdMlOr.png)\n3. Click on one of the example `*.ipynb` files.\n4. Run _Cell_ :arrow_right: _Run all_.  \n![Jupyter Run Cells](https://i.imgur.com/GaAaNAS.png)\n![Jupyter Output](https://i.imgur.com/PapCcsg.png)\n5. Feel free to add your own cells and run them to get familiar with the **CoLlAGe** code.\n6. To stop the **Jupyter** notebook and exit the **Docker** image, press `Ctrl+C` twice:\n\nTo run python code with collage:\n```console\nroot@12b12d2bff59:/# python\nPython 3.8.2 (default, Apr 27 2020, 15:53:34) \n[GCC 9.3.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e import collageradiomics\n\u003e\u003e\u003e collageradiomics.__name__\n'collageradiomics'\n```\n\n# Python Usage\n_[Back to **Table of Contents**](#table-of-contents)_\n```python\n\n##################################################\n# imports\nimport collageradiomics\nimport pydicom\nimport logging\nfrom pydicom.pixel_data_handlers.util import apply_modality_lut, apply_voi_lut\nfrom skimage.exposure import equalize_hist\nimport numpy as np\nfrom sklearn.preprocessing import minmax_scale\nfrom random import randint\n##################################################\n\n\n##################################################\n# logging\nlevel = logging.INFO\nlogging.basicConfig(level=level)\nlogger = logging.getLogger()\nlogger.setLevel(level)\nlogger.info('Hello, world.')\n##################################################\n\n\n##################################################\n# loading data\nlocal_dcm_file = 'test.dcm'\ninstance = pydicom.dcmread(local_dcm_file)\nslice_instance_uid = instance.SOPInstanceUID\nlogger.debug(f'slice_instance_uid  = {slice_instance_uid}')\n##################################################\n\n\n##################################################\n# preprocessing\nlogger.info('Correcting image...')\nnp_array = instance.pixel_array\ncorrected = apply_modality_lut(np_array, instance)\ncorrected = apply_voi_lut(corrected, instance)\nscaled_array = equalize_hist(corrected)\nlogger.debug(f'np.histogram(scaled_array) = {np.histogram(scaled_array)}')\nlogger.info('done.')\n##################################################\n\n\n##################################################\n# rectangular selection\nwidth = 50\nheight = 50\nmin_row = randint(30,300)\nmax_row = min_row + height\nmin_col = randint(30,300)\nmax_col = min_col + width\n\noriginal_shape = np_array.shape\nlogger.debug(f'original_shape = {original_shape}')\nlogger.info('Calculating collage features...')\nmask_array = np.zeros(original_shape, dtype='int')\nmask_array[min_row:max_row, min_col:max_col] = 1\n##################################################\n\n\n##################################################\n# run collage\ntextures = collageradiomics.Collage(scaled_array, mask_array).execute()\n\nlogger.debug(f'textures.shape = {textures.shape}')\nlogger.debug(f'textures.dtype = {textures.dtype}')\nlogger.debug(f'np.histogram(textures.flatten()) = {np.histogram(textures.flatten(), range=(np.nanmin(textures), np.nanmax(textures)))}')\n##################################################\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradxtools%2Fcollageradiomics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fradxtools%2Fcollageradiomics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradxtools%2Fcollageradiomics/lists"}