Skip to main content

Pyramid Focus Augmentation: Medical Image Segmentation with Step Wise Focus

Project description

pyra-pytorch

This is a package supporting Pytorch datasets. This implementation is based on the augmentation method discussed in the paper "Pyramid-Focus-Augmentation: Medical Image Segmentation with Step-Wise Focus" (PDF) and the original github repository: PYRA.

@article{thambawita2020pyramid,
  title={Pyramid-Focus-Augmentation: Medical Image Segmentation with Step-Wise Focus},
  author={Thambawita, Vajira and Hicks, Steven and Halvorsen, P{\aa}l and Riegler, Michael A},
  journal={arXiv preprint arXiv:2012.07430},
  year={2020}
}

How to use:

Install the package,

pip install pyra-pytorch

Creating a PYRA augmented dataset:

from pyra_pytorch import PYRADataset

dataset = PYRADataset("./image_path", # image folder
                      "./masks_path", # mask folder - files´s names of this folder should have image names as prefix to find correct image and mask pairs.
                      img_size = 256,  # height and width of image to resize
                      grid_sizes=[2,4,8,16,32,64,128,256] , # Gird sizes to use as grid augmentation. Note that, the image size after resizing ()
                      transforms = None
                      )
'''
./image_path" --> image folder

./masks_path" --> mask folder - files´s names of this folder should have image names as prefix to find correct image and mask pairs.

img_size = 256 --> height and width of image to resize

grid_sizes=[2,4,8,16,32,64,128,256]  --> Gird sizes to use as grid augmentation. Note that, the image size after resizing (in this case, it is 256) shoud be divisible by these grid sizes.

transforms = None --> Other type of transformations using in Pytorch. 

'''

Sample ipython notebook

notebook

Contact us:

vajira@simula.no | michael@simula.no

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

pyra-pytorch-0.0.5.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

pyra_pytorch-0.0.5-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

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