Coder Social home page Coder Social logo

cbica / figuregenerator Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 2.0 15.97 MB

This helps creating high quality figures for use in manuscripts and presentations.

License: Other

Python 100.00%
medical-imaging screenshots figures figure-maker screenshot-generator

figuregenerator's Introduction

Figure Generator

PyPi Conda Build & Tests Codacy Badge Codacy Badge Code style

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: [email protected]

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.