Skip to main content

Hypothalamus Automatic Segmentation Tool

Project description

HypAST - Hypothalamus Automatic Segmentation Tool

On this package you will find a trained model for hypothalamus segmentation on T1 MRI images and a trainable class, in case you wish to use your own data.

This tool is not suitable for clinical purposes.

HypAST requires Python 3.7 and PyTorch 1.9

To install PyTorch:

    # CUDA 10.2
    conda install pytorch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0 cudatoolkit=10.2 -c pytorch
    # CUDA 11.3
    install pytorch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0 cudatoolkit=11.3 -c pytorch -c conda-forge
    # CPU Only
    conda install pytorch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0 cpuonly -c pytorch

GETTING STARTED

HypAST works on .nii or .nii.gz input files for images and .nii, .nii.gz or .npy for annotations. Using HypAST you will be able to predict hypothalamus segmentation using our model or to train with your own data.

See more bellow:

Trainer

With Trainer you can train the model using your own data.

Example:

    import hypast as hyp
    train = hyp.Trainer(train_path, chkp_path, val_path, maxep=200, accum=16, weight=[1,4], lr=5e-3, bs=8)
    train.trainer()
  • Input:

    • train_path: path to h5py train set
    • chkp_path: checkpoint path
    • val_path: path to h5py val set
    • maxep: Maximum # of epochs in training (defaul = 200)
    • accum: Batch accumulation (defaul = 16)
    • weight: Cross Entropy Weight (defaul = [1,4])
    • lr: Learning Rate (defaul = 5e-3)
    • bs: Batch Size (defaul = 8)
  • Output:

    • Checkpoint file on defined path

CreateHDF5

To facilitate training using HypAST, CreateHDF5 will adjust your data for you.

Example:

    import hypast as hyp
    hyp.CreateHDF5(list_data, list_labels, out_path)
    create.create_links() 
  • Input:

    • list_data: List containing paths of .nii or .nii.gz images
    • list_labels: List containing paths of labels (.nii, .nii.gz or .npy)
    • out_path: Path were .hdf5 files will be saved
  • Output:

    • Return train.hdf5 and val.hdf5 on defined path

Predictor

With HypAST you can also generate hypothalamus segmentation using our trained model.

Example:

    import hypast as hyp
    pred = hyp.Predictor(list_data, out)
    pred.predictor()
  • Input:

    • list_data: List containing paths of .nii or .nii.gz files to be segmented
    • out: Path were segmentation will be saved
  • Output:

    • Segmentation files on defined path

CONTACT

For more information or suggestions, please contact liviamarodrigues@gmail.com

See more on https://github.com/MICLab-Unicamp/HypAST

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

hypast-0.0.7.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hypast-0.0.7-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file hypast-0.0.7.tar.gz.

File metadata

  • Download URL: hypast-0.0.7.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10

File hashes

Hashes for hypast-0.0.7.tar.gz
Algorithm Hash digest
SHA256 162ff19a2ac8f1cffb1b61c34090e83dca970494e9a6a04a7eb6e4700529fa25
MD5 530101420534a5221f1c9d0dbbc90a39
BLAKE2b-256 c5cd506f2078af8e59775878dab2f6b2df5365026a6e004d47f57d1ce30cb0ac

See more details on using hashes here.

File details

Details for the file hypast-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: hypast-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.10

File hashes

Hashes for hypast-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 acd3664a3867cba976e3df69cbe8f5849dd38d7a9f747783aad9faac75ea7936
MD5 5722aff91198f5d2dad51e965fe67352
BLAKE2b-256 dd7ffd98e3ff1369c922c9922dc4aa2b4c3a847945f028a26b604e5f1478c335

See more details on using hashes here.

Supported by

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