Making screenshots for presentations and manuscripts.
Project description
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.
Project details
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
File details
Details for the file FigureGenerator-0.0.4.tar.gz
.
File metadata
- Download URL: FigureGenerator-0.0.4.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96322e6a616d5697bd8ae1ab080d1cb4b3a4bb4720ce6343f576d37b74d1ac4d |
|
MD5 | e248dec27033802cd6fc7d53cc28f8f1 |
|
BLAKE2b-256 | cca45a670d207a6b5a60c4316e3d50743053bf074d44b6a9d04d7cae559fe976 |
File details
Details for the file FigureGenerator-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: FigureGenerator-0.0.4-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ab88cd97471925ab21ac73e7671dc5b8ffb93288fc67378217ee628a4bf0539 |
|
MD5 | 6de69058e60c29aaba7dda50e3e728f0 |
|
BLAKE2b-256 | 4fd665dc83597d99c8c153918efd662993ca2287ab6302e41ae4626b2b17e5fa |