Package medpicpy
MedPicPy provides a simple API for loading medical imaging datasets for use in deep learning projects.
The documentation for the functions shows example usages, see the wiki for examples of how the library is used on real datasets or check out the GitHub page to install/contribute.
Expand source code
"""
MedPicPy provides a simple API for loading medical
imaging datasets for use in deep learning projects.
The documentation for the functions shows example usages,
see [the wiki](https://github.com/cdmacfadyen/MedPicPy/wiki)
for examples of how the library is used on real datasets
or check out the [GitHub page](https://github.com/cdmacfadyen/MedPicPy) to install/contribute.
"""
import os
import shutil
from .parsing import *
from .io import allocate_array
from .io import load_image
from .io import load_series
from .paths import *
from . import config
cache_dir = config.cache_location + "/medpicpy_cache/"
if not os.path.exists(cache_dir):
os.mkdir(cache_dir)
else:
for cache_file in os.listdir(cache_dir):
if os.path.isfile(cache_file):
os.remove(cache_dir + cache_file)
def clear_cache():
for cache_file in os.listdir(cache_dir):
os.remove(cache_dir + cache_file)
Sub-modules
medpicpy.config
-
This module allows setting of some global values that medpicpy references internally …
medpicpy.io
-
medpicpy's lower level functions for reading individual images.
medpicpy.parsing
-
medpicpy's higher level functions to abstract over reading in medical imaging data
medpicpy.paths
-
medpicpy's functions for finding and filtering paths to image data.
medpicpy.utils
-
Utility functions for the package that the user shouldn't need.
Functions
def clear_cache()
-
Expand source code
def clear_cache(): for cache_file in os.listdir(cache_dir): os.remove(cache_dir + cache_file)