def load_X_Y_numbers_liver(self, meta_path): self.dicom_origin, self.liver_mask = organize_data.get_organized_data( meta_path, self.data_size[2] / 2) numbers = [] train_numbers = [] test_numbers = [] print numbers for number in self.liver_mask.keys(): if len(self.liver_mask[number]) > 0: numbers.append(number) for i in range(1): test_numbers.append(numbers[random.randint(0, len(numbers) - 1)]) for number in numbers: if not number in test_numbers: train_numbers.append(number) return train_numbers, test_numbers
def load_X_Y_numbers_special(self,meta_path,epoch): self.dicom_origin,self.mask ,zero_numbers= organize_data.get_organized_data(meta_path,self.data_size,epoch,self.train_amount) numbers=[] train_numbers=[] test_numbers=[] for number in self.mask.keys(): if len(self.mask[number])>0: numbers.append(number) for i in range(self.test_amount): test_number_temp = numbers[random.randint(0,len(numbers)-1)] while test_number_temp in zero_numbers: test_number_temp = numbers[random.randint(0, len(numbers) - 1)] test_numbers.append(test_number_temp) for number in numbers: if not number in test_numbers: train_numbers.append(number) return train_numbers,test_numbers