nifti-snapshot


Namenifti-snapshot JSON
Version 0.1.20 PyPI version JSON
download
home_pagehttps://github.com/pnlbwh/nifti-snapshot
SummaryFirst release to test pypi
upload_time2023-06-27 18:52:13
maintainer
docs_urlNone
authorkcho
requires_python>=3.7
license
keywords nifti snapshot
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![icon](docs/source/images/icon_resize.png) 

# nifti-snapshot

`nifti-snapshot` is a tool to quickly capture nifti image as a `png` or
`jpeg` figures.


```sh
$ pip install nifti_snapshot
```

For full documentation: [Here](https://nifti-snapshot.readthedocs.io/en/latest/)


## TBSS figures

### From commandline

#### Snapshot of an `tbss_fill` image

```sh
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](docs/fw_example.png)


<br>

#### Snapshot of two `tbss_fill` images with overlap highlight

```shell
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](docs/fa_fat_example.png)



---


### From python

#### Snapshot of an `tbss_fill` image

```py
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

```py
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()
```





            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pnlbwh/nifti-snapshot",
    "name": "nifti-snapshot",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "nifti,snapshot",
    "author": "kcho",
    "author_email": "kevincho@bwh.harvard.edu",
    "download_url": "https://files.pythonhosted.org/packages/18/94/e81e1d14f4f034cbab8b7ee879c964384549f0c26724fc38708096974d3b/nifti_snapshot-0.1.20.tar.gz",
    "platform": null,
    "description": "![icon](docs/source/images/icon_resize.png) \n\n# nifti-snapshot\n\n`nifti-snapshot` is a tool to quickly capture nifti image as a `png` or\n`jpeg` figures.\n\n\n```sh\n$ pip install nifti_snapshot\n```\n\nFor full documentation: [Here](https://nifti-snapshot.readthedocs.io/en/latest/)\n\n\n## TBSS figures\n\n### From commandline\n\n#### Snapshot of an `tbss_fill` image\n\n```sh\nfw=tbss_FW_tfce_corrp_tstat2_filled.nii.gz\n\n./nifti_snapshot \\\n    --input ${fw} \\\n    --tbss \\\n    --output_file cli_test_fw.png \\\n    --cmap \"Blues_r\" \\\n    --title \"Significant changes in FW in group A\" \\\n    --cbar_title 'Increased FW' \n```\n\n![output](docs/fw_example.png)\n\n\n<br>\n\n#### Snapshot of two `tbss_fill` images with overlap highlight\n\n```shell\nfa=tbss_FA_tfce_corrp_tstat1_filled.nii.gz\nfat=tbss_FAt_tfce_corrp_tstat1_filled.nii.gz\n\n./nifti_snapshot \\\n    --input ${fa} ${fat} \\\n    --tbss \\\n    --output_file cli_test.png \\\n    --cmap \"Blues_r\" \"autumn\" \\\n    --title \"Significant changes in FA and FAt in group A\" \\\n    --cbar_title 'Reduced' 'Reduced FAt' 'Overlap' \\\n    --overlap \\\n    --overlap_cmap \"summer\" \\\n    --overlap_alpha 0.8\n```\n\n![output](docs/fa_fat_example.png)\n\n\n\n---\n\n\n### From python\n\n#### Snapshot of an `tbss_fill` image\n\n```py\nfrom nifti_snapshot import nifti_snapshot\nfw = 'tbss_FA_tfce_corrp_tstat1_filled.nii.gz'\nfw_color = 'Blues_r'\n\ntbssFigure = nifti_snapshot.TbssFigure(\n        image_files=[fw],\n        output_file='docs/fw_example.png',\n        cmap_list=[fw_color],\n        cbar_titles=['Increased FW'],\n        alpha_list=[0.8],\n        title='Increased Freewater in group A',\n        cbar_x=0.35, cbar_width=0.3)\ntbssFigure.create_figure_one_map()\n```\n\n#### Snapshot of two `tbss_fill` images with overlap highlight\n\n```py\nfrom nifti_snapshot import nifti_snapshot\nfa = 'tbss_FA_tfce_corrp_tstat1_filled.nii.gz'\nfat = 'tbss_FAt_tfce_corrp_tstat1_filled.nii.gz'\n\nfa_color_1 = 'Blues_r'\nfa_color_2 = 'autumn'\nfa_color_overlap = 'summer'\n\ntbssFigure = nifti_snapshot.TbssFigure(\n    image_files=[fa, fat],\n    output_file='docs/fa_fat_example.png',\n    cmap_list=[fa_color_1, fa_color_2],\n    overlap_cmap=fa_color_overlap,\n    cbar_titles=[\n        'Reduced FA',\n        'Reduced FAt',\n        'Overlap'],\n    alpha_list=[1, 1, 0.8],\n    title='Significant changes in FA and FAt in group A')\ntbssFigure.create_figure_two_maps_and_overlap()\n```\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "First release to test pypi",
    "version": "0.1.20",
    "project_urls": {
        "Download": "https://github.com/pnlbwh/nifti-snapshot/archive/refs/tags/0.1.20.zip",
        "Homepage": "https://github.com/pnlbwh/nifti-snapshot"
    },
    "split_keywords": [
        "nifti",
        "snapshot"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1894e81e1d14f4f034cbab8b7ee879c964384549f0c26724fc38708096974d3b",
                "md5": "da806854dc3d28b3b66576f7191e4aae",
                "sha256": "f9e86d63b9cfcf7f5898a010e4ae6b53673d47124ac8bbe95fea87dbe3f145c4"
            },
            "downloads": -1,
            "filename": "nifti_snapshot-0.1.20.tar.gz",
            "has_sig": false,
            "md5_digest": "da806854dc3d28b3b66576f7191e4aae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 9679,
            "upload_time": "2023-06-27T18:52:13",
            "upload_time_iso_8601": "2023-06-27T18:52:13.049253Z",
            "url": "https://files.pythonhosted.org/packages/18/94/e81e1d14f4f034cbab8b7ee879c964384549f0c26724fc38708096974d3b/nifti_snapshot-0.1.20.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-27 18:52:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pnlbwh",
    "github_project": "nifti-snapshot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "nifti-snapshot"
}
        
Elapsed time: 1.17845s