Skip to content

ldctbench.utils.auxiliaries

apply_center_width(x, center, width, out_range=(0, 1))

Apply some center and width to an image

Parameters:

  • x (ndarray) –

    Image array of arbitrary dimension

  • center (float) –

    Float indicating the center

  • width (float) –

    Float indicating the width

  • out_range (Tuple, default: (0, 1) ) –

    Desired output range, by default (0, 1)

Returns:

  • ndarray

    Copy of input array with center and width applied

dump_config(args, path)

Save argparse.Namespace to yaml file

load_json(path)

Load python object from json file

load_obj(path)

Load python object from pickle file

load_yaml(path)

Load python object from yaml file

save_json(content, path)

Save python object to json file

save_obj(obj, path)

Save python object to pickle file

save_yaml(content, path)

Save python object to yaml file