def pad_nd_image_and_seg(data, seg, new_shape=None, must_be_divisible_by=None, pad_mode_data='constant', np_pad_kwargs_data=None, pad_mode_seg='constant', np_pad_kwargs_seg=None):
    '\n    Pads data and seg to new_shape. new_shape is thereby understood as min_shape (if data/seg is already larger then\n    new_shape the shape stays the same for the dimensions this applies)\n    :param data:\n    :param seg:\n    :param new_shape: if none then only must_be_divisible_by is applied\n    :param must_be_divisible_by: UNet like architectures sometimes require the input to be divisibly by some number. This\n    will modify new_shape if new_shape is not divisibly by this (by increasing it accordingly).\n    must_be_divisible_by should be a list of int (one for each spatial dimension) and this list must have the same\n    length as new_shape\n    :param pad_mode_data: see np.pad\n    :param np_pad_kwargs_data:see np.pad\n    :param pad_mode_seg:see np.pad\n    :param np_pad_kwargs_seg:see np.pad\n    :return:\n    '
    sample_data = pad_nd_image(data, new_shape, mode=pad_mode_data, kwargs=np_pad_kwargs_data, return_slicer=False, shape_must_be_divisible_by=must_be_divisible_by)
    if (seg is not None):
        sample_seg = pad_nd_image(seg, new_shape, mode=pad_mode_seg, kwargs=np_pad_kwargs_seg, return_slicer=False, shape_must_be_divisible_by=must_be_divisible_by)
    else:
        sample_seg = None
    return (sample_data, sample_seg)
Pads data and seg to new_shape. new_shape is thereby understood as min_shape (if data/seg is already larger then
new_shape the shape stays the same for the dimensions this applies)
:param data:
:param seg:
:param new_shape: if none then only must_be_divisible_by is applied
:param must_be_divisible_by: UNet like architectures sometimes require the input to be divisibly by some number. This
will modify new_shape if new_shape is not divisibly by this (by increasing it accordingly).
must_be_divisible_by should be a list of int (one for each spatial dimension) and this list must have the same
length as new_shape
:param pad_mode_data: see np.pad
:param np_pad_kwargs_data:see np.pad
:param pad_mode_seg:see np.pad
:param np_pad_kwargs_seg:see np.pad
:return:
def pad_nd_image_and_seg(data, seg, new_shape=None, must_be_divisible_by=None, pad_mode_data='constant', np_pad_kwargs_data=None, pad_mode_seg='constant', np_pad_kwargs_seg=None):
    '\n    Pads data and seg to new_shape. new_shape is thereby understood as min_shape (if data/seg is already larger then\n    new_shape the shape stays the same for the dimensions this applies)\n    :param data:\n    :param seg:\n    :param new_shape: if none then only must_be_divisible_by is applied\n    :param must_be_divisible_by: UNet like architectures sometimes require the input to be divisibly by some number. This\n    will modify new_shape if new_shape is not divisibly by this (by increasing it accordingly).\n    must_be_divisible_by should be a list of int (one for each spatial dimension) and this list must have the same\n    length as new_shape\n    :param pad_mode_data: see np.pad\n    :param np_pad_kwargs_data:see np.pad\n    :param pad_mode_seg:see np.pad\n    :param np_pad_kwargs_seg:see np.pad\n    :return:\n    '
    sample_data = pad_nd_image(data, new_shape, mode=pad_mode_data, kwargs=np_pad_kwargs_data, return_slicer=False, shape_must_be_divisible_by=must_be_divisible_by)
    if (seg is not None):
        sample_seg = pad_nd_image(seg, new_shape, mode=pad_mode_seg, kwargs=np_pad_kwargs_seg, return_slicer=False, shape_must_be_divisible_by=must_be_divisible_by)
    else:
        sample_seg = None
    return (sample_data, sample_seg)