def __init__(self, path_to_images, fold, transform=None, sample=0, finding='any'):
    self.transform = transform
    self.path_to_images = path_to_images
    self.df = pd.read_csv('nih/nih_labels.csv')
    self.df = self.df[(self.df['fold'] == fold)]
    if ((sample > 0) and (sample < len(self.df))):
        self.df = self.df.sample(sample)
    if (not (finding == 'any')):
        if (finding in self.df.columns):
            if (len(self.df[(self.df[finding] == 1)]) > 0):
                self.df = self.df[(self.df[finding] == 1)]
            else:
                print((('No positive cases exist for ' + LABEL) + ', returning all unfiltered cases'))
        else:
            print((('cannot filter on finding ' + finding) + ' as not in data - please check spelling'))
    self.df = self.df.set_index('Image Index')
    self.PRED_LABEL = ['No Finding', 'Atelectasis', 'Cardiomegaly', 'Effusion', 'Infiltration', 'Lung Lesion', 'Pneumonia', 'Pneumothorax', 'Consolidation', 'Edema', 'Emphysema', 'Fibrosis', 'Pleural_Thickening', 'Hernia']
    RESULT_PATH = 'results/'
def __init__(self, path_to_images, fold, transform=None, sample=0, finding='any'):
    self.transform = transform
    self.path_to_images = path_to_images
    self.df = pd.read_csv('nih/nih_labels.csv')
    self.df = self.df[(self.df['fold'] == fold)]
    if ((sample > 0) and (sample < len(self.df))):
        self.df = self.df.sample(sample)
    if (not (finding == 'any')):
        if (finding in self.df.columns):
            if (len(self.df[(self.df[finding] == 1)]) > 0):
                self.df = self.df[(self.df[finding] == 1)]
            else:
                print((('No positive cases exist for ' + LABEL) + ', returning all unfiltered cases'))
        else:
            print((('cannot filter on finding ' + finding) + ' as not in data - please check spelling'))
    self.df = self.df.set_index('Image Index')
    self.PRED_LABEL = ['No Finding', 'Atelectasis', 'Cardiomegaly', 'Effusion', 'Infiltration', 'Lung Lesion', 'Pneumonia', 'Pneumothorax', 'Consolidation', 'Edema', 'Emphysema', 'Fibrosis', 'Pleural_Thickening', 'Hernia']
    RESULT_PATH = 'results/'