generate_directories_4.py 1.1 KB

123456789101112131415161718192021222324
  1. def generate_numpy_ds(dataset_type):
  2. """
  3. This function generates the directory structure for the final numpy
  4. arrays for the training and test sets.
  5. Director structure for processed data:
  6. ProstateX/generated/train/numpy
  7. ProstateX/generated/test/numpy
  8. """
  9. if dataset_type == str(1):
  10. new_path = Path('E:/Memoire/ProstateX/generated/train/numpy/')
  11. new_path.mkdir(parents = True, exist_ok = True)
  12. new_path.joinpath('t2').mkdir(parents = True, exist_ok = True)
  13. new_path.joinpath('bval').mkdir(parents = True, exist_ok = True)
  14. new_path.joinpath('adc').mkdir(parents = True, exist_ok = True)
  15. new_path.joinpath('ktrans').mkdir(parents = True, exist_ok = True)
  16. else:
  17. new_path = Path('E:/Memoire/ProstateX/generated/test/numpy/')
  18. new_path.mkdir(parents = True, exist_ok = True)
  19. new_path.joinpath('t2').mkdir(parents = True, exist_ok = True)
  20. new_path.joinpath('bval').mkdir(parents = True, exist_ok = True)
  21. new_path.joinpath('adc').mkdir(parents = True, exist_ok = True)
  22. new_path.joinpath('ktrans').mkdir(parents = True, exist_ok = True)