def get_item_tfms(run_params):
    item_tfms = []
    if run_params['KNEE_LOCALIZER']:
        item_tfms.append(KneeLocalizer(run_params['KNEE_SVM_MODEL_PATH'], PIL_cls=PILImageBW, resize=run_params['RESIZE'], np_input=(len(item_tfms) > 0), np_output=True))
    else:
        item_tfms.append(Resize(run_params['RESIZE'], method=ResizeMethod.Pad, pad_mode=PadMode.Zeros))
    if run_params['BACKGROUND_PREPROCESS']:
        item_tfms.append(BackgroundPreprocess(PIL_cls=PILImageBW, np_input=(len(item_tfms) > 0), np_output=True))
    if run_params['CLAHE_SCALED']:
        item_tfms.append(CLAHE_Transform(PIL_cls=PILImageBW, grayscale=(not run_params['SELF_SUPERVISED']), np_input=(len(item_tfms) > 0), np_output=False))
    elif run_params['HIST_SCALED']:
        if run_params['HIST_SCALED_SELF']:
            bins = None
        else:
            all_valid_raw_preprocess = pd.concat([pd.Series(unlabel_all_df.index), label_df['Raw_preprocess']])
            bins = init_bins(fnames=L(list(all_valid_raw_preprocess.values)), n_samples=100, isDCM=False)
        item_tfms.append(HistScaled_all(bins))
    return item_tfms
def get_item_tfms(run_params):
    item_tfms = []
    if run_params['KNEE_LOCALIZER']:
        item_tfms.append(KneeLocalizer(run_params['KNEE_SVM_MODEL_PATH'], PIL_cls=PILImageBW, resize=run_params['RESIZE'], np_input=(len(item_tfms) > 0), np_output=True))
    else:
        item_tfms.append(Resize(run_params['RESIZE'], method=ResizeMethod.Pad, pad_mode=PadMode.Zeros))
    if run_params['BACKGROUND_PREPROCESS']:
        item_tfms.append(BackgroundPreprocess(PIL_cls=PILImageBW, np_input=(len(item_tfms) > 0), np_output=True))
    if run_params['CLAHE_SCALED']:
        item_tfms.append(CLAHE_Transform(PIL_cls=PILImageBW, grayscale=(not run_params['SELF_SUPERVISED']), np_input=(len(item_tfms) > 0), np_output=False))
    elif run_params['HIST_SCALED']:
        if run_params['HIST_SCALED_SELF']:
            bins = None
        else:
            all_valid_raw_preprocess = pd.concat([pd.Series(unlabel_all_df.index), label_df['Raw_preprocess']])
            bins = init_bins(fnames=L(list(all_valid_raw_preprocess.values)), n_samples=100, isDCM=False)
        item_tfms.append(HistScaled_all(bins))
    return item_tfms