{"id":34070135,"url":"https://github.com/danishm/mritopng","last_synced_at":"2025-12-14T07:02:42.504Z","repository":{"id":16610209,"uuid":"19365005","full_name":"danishm/mritopng","owner":"danishm","description":"A simple python module to make it easy to batch convert DICOM files to PNG images.","archived":false,"fork":false,"pushed_at":"2019-04-19T17:50:09.000Z","size":1048,"stargazers_count":146,"open_issues_count":5,"forks_count":50,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-08T22:14:08.978Z","etag":null,"topics":["dicom","dicom-converter","dicom-images","medical","medical-images","png","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danishm.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":"2014-05-02T03:30:11.000Z","updated_at":"2025-10-31T16:00:17.000Z","dependencies_parsed_at":"2022-08-27T16:00:31.128Z","dependency_job_id":null,"html_url":"https://github.com/danishm/mritopng","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/danishm/mritopng","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danishm%2Fmritopng","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danishm%2Fmritopng/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danishm%2Fmritopng/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danishm%2Fmritopng/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danishm","download_url":"https://codeload.github.com/danishm/mritopng/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danishm%2Fmritopng/sbom","scorecard":{"id":320921,"data":{"date":"2025-08-11","repo":{"name":"github.com/danishm/mritopng","commit":"db305de49919953cac0a9691c11b3a4bc488e0d0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":4,"reason":"Found 2/5 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating python:3.6 to python:3.6@sha256:f8652afaf88c25f0d22354d547d892591067aa4026a7fa9a6819df9f300af6fc","Warn: pipCommand not pinned by hash: Dockerfile:4","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: GHSA-6p56-wp2h-9hxr","Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T01:20:56.555Z","repository_id":16610209,"created_at":"2025-08-18T01:20:56.555Z","updated_at":"2025-08-18T01:20:56.555Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27720818,"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","status":"online","status_checked_at":"2025-12-14T02:00:11.348Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["dicom","dicom-converter","dicom-images","medical","medical-images","png","python"],"created_at":"2025-12-14T07:02:36.345Z","updated_at":"2025-12-14T07:02:42.498Z","avatar_url":"https://github.com/danishm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Convert DICOM Files to PNG\r\n===========================\r\n\r\n[![CircleCI](https://circleci.com/gh/danishm/mritopng.svg?style=shield)](https://circleci.com/gh/danishm/mritopng) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n\r\n*Important Changes*\r\n  - **8/26/2018** - Ability to apply auto-contrast to the converted images\r\n\r\nIntroduction\r\n------------\r\nA simple python module to make it easy to batch convert a binary DICOM file, which is usually an output from\r\nan MRI scan to a PNG image.\r\n\r\nThe MRI scanning facilities typically hand you a CD containing your MRI scans. This CD will typically not contain\r\nany image files in traditional formats that can be opened up by your default image viewing program. The CD contains\r\na list of DICOM files, which can only be viewed by the included viewer, which is mostly only supported on a Windows machine.\r\n\r\nThis module should help you convert all the DICOM based scans to PNG files. This tool can be used as a command line tools as well as a library in your python code\r\n\r\nInstallation\r\n------------\r\n\r\nTo have known to work dependencies use beforehand::\r\n\r\n    pip install -r requirements.txt\r\n\r\n`mritopng` comes with a `setup.py` script to use with distutils. After unpacking the distribution, `cd` into the directory and execute the command::\r\n\r\n    python setup.py install\r\n\r\n\r\nThis will install two things\r\n\r\n * The `mritopng` module will be installed; `import mritopng` will allow you to use it\r\n * A command line utility called `mritopng` which can be used from the console\r\n\r\nQuick Start\r\n-----------\r\n`mritopng` will install a command line utility that can be used to convert individual DICOM files or folders\r\n\r\n### Getting Help\r\n\r\n```\r\n$ mritopng --help\r\nusage: mritopng [-h] [-f] [-c] dicom_path png_path\r\n\r\nConvert a dicom MRI file to png. To conver a whole folder recursivly, use the\r\n-f option\r\n\r\npositional arguments:\r\n  dicom_path           Full path to the mri file\r\n  png_path             Full path to the generated png file\r\n\r\noptional arguments:\r\n  -h, --help           show this help message and exit\r\n  -f, --folder         Convert a whole folder instead of a single file\r\n  -c, --auto-contrast  Apply contrast after converting default image\r\n```\r\n\r\n### Convert Single File\r\n\r\n```sh\r\n# Converts the file /DICOM/SCAN1 to a file called output.png,\r\n# while applying auto contrast\r\n$ mritopng --auto-contrast /DICOM/SCAN1 output.png\r\n```\r\n\r\n**Note:** If file `output.png` already exists, it will be overwritten\r\n\r\n### Convert Folder Tree\r\n\r\nThe utility can also be used to convert a whole folder recursively by using the `-f` option::\r\n\r\n```sh\r\n# Takes all the files in /DICOM, converts the files to png and\r\n# puts them in the /PNG folder with the same structure as /DICOM. \r\n$ mritopng -f /DICOM /PNG\r\n```\r\n\r\n**Note:**\r\n - Existing top level folder will NOT be over-written e.g. the example above will fail of the folder `/PNG` already exists\r\n - The tool will try to convert as many files as it can, skipping the ones that it can't\r\n\r\nUsing it as a Library\r\n---------------------\r\n\r\nIt's pretty easy to get up and running with `mritopng` in your own project\r\n\r\n```py\r\nimport mritopng\r\n\r\n# Convert a single file with auto-contrast\r\nmritopng.convert_file('/home/user/DICOM/SCAN1', '/home/user/output.png', auto_contrast=True)\r\n\r\n# Convert a whole folder recursively\r\nmritopng.convert_folder('/home/user/DICOM/', '/home/user/PNG/')\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanishm%2Fmritopng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanishm%2Fmritopng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanishm%2Fmritopng/lists"}