How to use the pylinac.core.io.retrieve_demo_file function in pylinac

To help you get started, we’ve selected a few pylinac examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jrkerns / pylinac / tests_basic / test_flatsym.py View on Github external
def get_filename(cls):
        return retrieve_demo_file(url='flatsym_demo.dcm')
github jrkerns / pylinac / pylinac / ct.py View on Github external
def from_demo_images(cls):
        """Construct a CBCT object from the demo images."""
        demo_file = retrieve_demo_file(url=cls._demo_url)
        return cls.from_zip(demo_file)
github jrkerns / pylinac / pylinac / watcher.py View on Github external
def get_image_classifier(img_type):
    """Load the CBCT HU slice classifier model. If the classifier is not locally available it will be downloaded."""
    if img_type == 'single':
        classifier = 'singleimage_classifier.pkl.gz'
    elif img_type == 'vmat':
        classifier = 'vmat_classifier.pkl.gz'
    classifier_file = osp.join(osp.dirname(__file__), 'demo_files', classifier)
    # get the classifier if it's not downloaded
    if not osp.isfile(classifier_file):
        logger.info("Downloading classifier from the internet...")
        classifier_file = retrieve_demo_file(classifier)
        logger.info("Done downloading")

    with gzip.open(classifier_file, mode='rb') as m:
        clf = pickle.load(m)
    return clf
github jrkerns / pylinac / pylinac / winston_lutz.py View on Github external
def from_demo_images(cls):
        """Instantiate using the demo images."""
        demo_file = retrieve_demo_file(url='winston_lutz.zip')
        return cls.from_zip(demo_file)
github jrkerns / pylinac / pylinac / planar_imaging.py View on Github external
def from_demo_image(cls):
        """Instantiate and load the demo image."""
        demo_file = retrieve_demo_file(url=cls._demo_filename)
        return cls(demo_file)
github jrkerns / pylinac / pylinac / log_analyzer.py View on Github external
def from_demo(cls, exclude_beam_off=True):
        """Load and instantiate from the demo trajetory log file included with the package."""
        demo_file = io.retrieve_demo_file(url='Tlog.bin')
        return cls(demo_file, exclude_beam_off)