Skip to main content

First release to test pypi

Project description

icon

nifti-snapshot

Tools used to summarize nifti files into figures.

git clone https://github.com/pnlbwh/nifti-snapshot

Contents

  • TODO
  • Dependencies
  • TBSS figures

TODO

  • test script
  • add different background image options
  • 4d map summary (diffusion)
  • ROI & multi ROI visualization
  • project wise examples

Dependencies

FSLDIR in PATH
ENIGMA_dir in PATH 
# download from http://enigma.ini.usc.edu/wp-content/uploads/2013/02/enigmaDTI.zip

python 3.7
scipy==1.3.3
nibabel==2.4.0
numpy==1.16.2
pathlib2==2.3.3
matplotlib==3.0.3

Single image examples

Link to a single image examples

Jupyter notebook link

TBSS figures

From commandline

Snapshot of an tbss_fill image

fw=tbss_FW_tfce_corrp_tstat2_filled.nii.gz

./nifti_snapshot \
    --input ${fw} \
    --tbss \
    --output_file cli_test_fw.png \
    --cmap "Blues_r" \
    --title "Significant changes in FW in group A" \
    --cbar_title 'Increased FW' 

output


Snapshot of two tbss_fill images with overlap highlight

fa=tbss_FA_tfce_corrp_tstat1_filled.nii.gz
fat=tbss_FAt_tfce_corrp_tstat1_filled.nii.gz

./nifti_snapshot \
    --input ${fa} ${fat} \
    --tbss \
    --output_file cli_test.png \
    --cmap "Blues_r" "autumn" \
    --title "Significant changes in FA and FAt in group A" \
    --cbar_title 'Reduced' 'Reduced FAt' 'Overlap' \
    --overlap \
    --overlap_cmap "summer" \
    --overlap_alpha 0.8

output


From python

Snapshot of an tbss_fill image

from nifti_snapshot import nifti_snapshot
fw = 'tbss_FA_tfce_corrp_tstat1_filled.nii.gz'
fw_color = 'Blues_r'

tbssFigure = nifti_snapshot.TbssFigure(
        image_files=[fw],
        output_file='docs/fw_example.png',
        cmap_list=[fw_color],
        cbar_titles=['Increased FW'],
        alpha_list=[0.8],
        title='Increased Freewater in group A',
        cbar_x=0.35, cbar_width=0.3)
tbssFigure.create_figure_one_map()

Snapshot of two tbss_fill images with overlap highlight

from nifti_snapshot import nifti_snapshot
fa = 'tbss_FA_tfce_corrp_tstat1_filled.nii.gz'
fat = 'tbss_FAt_tfce_corrp_tstat1_filled.nii.gz'

fa_color_1 = 'Blues_r'
fa_color_2 = 'autumn'
fa_color_overlap = 'summer'

tbssFigure = nifti_snapshot.TbssFigure(
    image_files=[fa, fat],
    output_file='docs/fa_fat_example.png',
    cmap_list=[fa_color_1, fa_color_2],
    overlap_cmap=fa_color_overlap,
    cbar_titles=[
        'Reduced FA',
        'Reduced FAt',
        'Overlap'],
    alpha_list=[1, 1, 0.8],
    title='Significant changes in FA and FAt in group A')
tbssFigure.create_figure_two_maps_and_overlap()

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

nifti_snapshot-0.1.9.tar.gz (9.6 kB view details)

Uploaded Source

File details

Details for the file nifti_snapshot-0.1.9.tar.gz.

File metadata

  • Download URL: nifti_snapshot-0.1.9.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.11

File hashes

Hashes for nifti_snapshot-0.1.9.tar.gz
Algorithm Hash digest
SHA256 016a8580668991d46c5ae796af29b0334ea7f3dd1b67b3707c202f5d66adb0d3
MD5 f273795a2ca9917260f5ab9409392bbc
BLAKE2b-256 14660700ac7c0ddcb0fdc65d9496097a221bd94340fcb34f6ab6ddccdcef9b61

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page