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.

INSTALLATION

    pip install hypast==0.0.3

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.5.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.5-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hypast-0.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 0b692a92f87f9d0d00394f2e94c25e69c61a5d815a6cda47dcb396b34406e1f2
MD5 3fbf7420aebe8896545854786aee4b67
BLAKE2b-256 bf93e786e04ef7f5f7f30316874831050610b8708358fc5aee90b1fb12a4c68f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hypast-0.0.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1f3d32fcb99778ce1924c7b52f4d06e7bb7c3b3632a441f7b1a7ff2c6922b4c4
MD5 0fd4a9e8e20bc0ea361d74d0f978b9b3
BLAKE2b-256 957e2f9bc89e2b71650ad7097190b21af61b461478e79881b749b9173be2ca9b

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