def _categorical_prep(vol_data, nb_labels_reshape, keep_vol_size, patch_size):
    if (nb_labels_reshape > 1):
        lpatch = _to_categorical(vol_data, nb_labels_reshape, keep_vol_size)
    elif (nb_labels_reshape == 1):
        lpatch = np.expand_dims(vol_data, axis=(- 1))
    else:
        assert (nb_labels_reshape == 0)
        lpatch = vol_data
    lpatch = np.expand_dims(lpatch, axis=0)
    return lpatch
def _categorical_prep(vol_data, nb_labels_reshape, keep_vol_size, patch_size):
    if (nb_labels_reshape > 1):
        lpatch = _to_categorical(vol_data, nb_labels_reshape, keep_vol_size)
    elif (nb_labels_reshape == 1):
        lpatch = np.expand_dims(vol_data, axis=(- 1))
    else:
        assert (nb_labels_reshape == 0)
        lpatch = vol_data
    lpatch = np.expand_dims(lpatch, axis=0)
    return lpatch