61a0663a45beb2e59f6a549c51d55940c80734e3,niftynet/io/image_as_nibabel.py,,,#,11

Before Change



from PIL import Image

try:
    // Check whether scikit-image is installed in the system and use it.
    // It loads images slightly faster then PIL.
    // Only use scikit-image if installed version is 0.13.0 or newer
    from niftynet.utilities.util_import import require_module
    SKIO = require_module("skimage.io", (0, 13, 0))
    USE_SKIMAGE = True
    tf.logging.info("+++ Using SKIMAGE as Image Loading backend")
except (ImportError, AssertionError):
    tf.logging.info("+++ Using PIL as Image Loading backend")
    USE_SKIMAGE = False


def image2nibabel(filename):
    
    Loads a RGB or Grayscale Image from a file and stores it in a 5D array,
    moving the color channels to the last axis for color images.

After Change


AVAILABLE_LOADER = OrderedDict()

for loader in EXTERNAL_LOADERS:
    try:
        // Default params
        min_ver = loader.get("version", None)
        args = loader.get("args", tuple())
        kwargs = loader.get("kwargs", dict())
        // Retrieve external function
        external_module = require_module(loader["module"], min_version=min_ver)
        external_function = getattr(external_module, loader["method"])
        // Save loader params
        loader_dict = dict(fn=external_function, args=args, kwargs=kwargs)
    except (ImportError, AssertionError, AttributeError):
        continue

    AVAILABLE_LOADER[loader["name"]] = loader_dict


tf.logging.info("+++ Available Image Loaders {}:"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 10

Instances


Project Name: NifTK/NiftyNet
Commit Name: 61a0663a45beb2e59f6a549c51d55940c80734e3
Time: 2018-03-05
Author: rmaplue@ucl.ac.uk
File Name: niftynet/io/image_as_nibabel.py
Class Name:
Method Name:


Project Name: fxsjy/jieba
Commit Name: 99d0fb1a8a00c80c97271b2cc58d52c4fcff0032
Time: 2015-11-09
Author: abcdoyle888@gmail.com
File Name: jieba/__init__.py
Class Name: Tokenizer
Method Name: load_userdict


Project Name: tensorly/tensorly
Commit Name: 65a9c6274b4b13ae45a03e91dd5d655da16304fc
Time: 2021-03-23
Author: caglayan.tuna@irisa.fr
File Name: tensorly/decomposition/_cp.py
Class Name:
Method Name: initialize_cp


Project Name: OpenMined/PySyft
Commit Name: 4cf7f921f08d59ad28bd41c058a5ae2dd39a2b98
Time: 2020-09-16
Author: me@madhavajay.com
File Name: src/syft/lib/generic.py
Class Name: ObjectConstructor
Method Name: install_id_attribute