Figure Generator
This project helps create high quality figures for medical images for use in presentations and/or manuscripts.
Installation
git clone https://github.com/CBICA/FigureGenerator.git
cd screenshot_maker
conda create -n venv_screenshot python=3.7 -y
conda activate venv_screenshot
pip install -e .
OR directly via Pip:
pip install FigureGenerator
Usage
python ./figure_generator -h
usage: FigureGenerator [-h] -images IMAGES [-masks MASKS] [-opacity OPACITY]
[-ylabels YLABELS] -output OUTPUT [-axisrow AXISROW]
[-boundtype BOUNDTYPE] [-fontsize FONTSIZE]
[-borderpc BORDERPC] [-v]
Constructing screenshots from medical images.
Contact: software@cbica.upenn.edu
This program is NOT FDA/CE approved and NOT intended for clinical use.
Copyright (c) 2021 University of Pennsylvania. All rights reserved.
optional arguments:
-h, --help show this help message and exit
-images IMAGES Input image files (comma-separated without any spaces in path and co-registered)
-masks MASKS Mask files (comma-separated without any spaces in path and co-registered with images); if multiple files are passed, first is ground truth
-opacity OPACITY Mask opacity between 0-1
-ylabels YLABELS The comma-separated ylabels that will be displayed on the subplots' y-axis
-output OUTPUT Output screenshot file
-axisrow AXISROW Put all axes views across each column and stack images and blends in rows, defaults to False
-boundtype BOUNDTYPE Construct bounding box around specified region; can be 'none, image or mask'
-fontsize FONTSIZE Font size for all text on the figure
-borderpc BORDERPC Percentage of size to use as border around bounding box (used only when mask and bounded are defined)
-v, --version Show program's version number and exit.
Examples
Vertical screenshot of multiple images without bounding:
python ./figure_generator \
-images C:/input/subject_001_flair.nii.gz,C:/input/subject_001_t1ce.nii.gz,C:/input/subject_001_t1.nii.gz,C:/input/subject_001_t2.nii.gz \
-masks C:/input/subject_001_seg.nii.gz \
-axisrow False \
-output C:/input/fig.png
Gives the following output:
Horizontal screenshot of multiple images without bounding:
python ./figure_generator \
-images C:/input/subject_001_flair.nii.gz,C:/input/subject_001_t1ce.nii.gz,C:/input/subject_001_t1.nii.gz,C:/input/subject_001_t2.nii.gz \
-masks C:/input/subject_001_seg.nii.gz \
-axisrow True \
-output C:/input/fig.png
Gives the following output:
Horizontal screenshot of multiple images with image-based bounding:
python ./figure_generator \
-images C:/input/subject_001_flair.nii.gz,C:/input/subject_001_t1ce.nii.gz,C:/input/subject_001_t1.nii.gz,C:/input/subject_001_t2.nii.gz \
-masks C:/input/subject_001_seg.nii.gz \
-axisrow True \
-boundtype image \
-output C:/input/fig.png
Gives the following output:
Note: This can be used with vertical orientation as well, by passing -axisrow False to the command.
Horizontal screenshot of multiple images with mask-based bounding:
python ./figure_generator \
-images C:/input/subject_001_flair.nii.gz,C:/input/subject_001_t1ce.nii.gz,C:/input/subject_001_t1.nii.gz,C:/input/subject_001_t2.nii.gz \
-masks C:/input/subject_001_seg.nii.gz \
-axisrow True \
-boundtype mask \
-borderpc 0.001 \
-output C:/input/fig.png
Gives the following output:
Note: This can be used with vertical orientation as well, by passing -axisrow False to the command.
Feedback
Please post on GitHub Discussions or post an issue.
Metadata
Release files for FigureGenerator 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| figuregenerator-0.0.5.tar.gz | 14.3 kB | Without provenance | Details for figuregenerator-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| figuregenerator-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for figuregenerator-0.0.5-py3-none-any.whl |
Total release size: 27.3 kB
Release files / figuregenerator-0.0.5.tar.gz
| Download URL | figuregenerator-0.0.5.tar.gz |
|---|---|
| Size | 14.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47833dd207cdcd3a7745400b2f107e0db0de34115a061d207ccefab024dd0731
|
|
BLAKE2b-256 checksum How to use checksums |
6b5f678d4ba39e1efd0a21c5f178e5276f1261f6357d282ed283a1f4bcfaa5ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.22
|
Release files / figuregenerator-0.0.5-py3-none-any.whl
| Download URL | figuregenerator-0.0.5-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
12bfaeb465f9d883a059a24cf222064e225b2c55b395ba2dcd740137998b443c
|
|
BLAKE2b-256 checksum How to use checksums |
56c4e042ab98dfe94ab9c90903d842d906f00de25112c8e33dc44c4c558a15d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.22
|
Security for FigureGenerator 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.