def _pre_process_all(self):
if self._pre_processed_exists():
self._load_norm_parameters()
print("Mean = ", self._mean, ", STD = ", self._std)
return
print("No pre-processed dataset found, pre-processing now...")
if not(os.path.exists(self._target_directory)):
os.makedirs(self._target_directory)
size = len(self._all_series)
for idx, patient in enumerate(self._all_series):
print(patient[1], str(idx+1) + "/" + str(size))
p.dump(self._pre_process(patient), open(os.path.join(self._target_directory, patient[1] + ".pick"), "wb"), protocol=2)
print("Mean = ", self._mean, ", STD = ", self._std)
p.dump((self._mean, self._std), open(os.path.join(self._target_directory, "norm_parameters.pick"), "wb"), protocol=2)
print("Pre-processing Done!")
评论列表
文章目录