-
Notifications
You must be signed in to change notification settings - Fork 9
/
paths.py
executable file
·63 lines (56 loc) · 3.1 KB
/
paths.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Copyright 2019 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Put your personal paths in here. This file will shortly be added to gitignore so that your personal paths will not be tracked
"""
import os
from batchgenerators.utilities.file_and_folder_operations import maybe_mkdir_p, join
# You need to set the following folders: base, preprocessing_output_dir and network_training_output_dir. See below for details.
# do not modify these unless you know what you are doing
my_output_identifier = "nnUNet"
default_plans_identifier = "nnUNetPlans"
try:
# base is the folder where the raw data is stored. You just need to set base only, the others will be created
# automatically (they are subfolders of base).
# Here I use environment variables to set the base folder. Environment variables allow me to use the same code on
# different systems (and our compute cluster)
# base = os.environ['nnUNet_base']
# base='D:/WenshuaiZhao/ProjectFiles/NNUnet/nnunet/base/'
# base=os.environ['nnUNet_base']
base="/cache/WenshuaiZhao/ProjectFiles/NNUnet_do_ds_all_train/nnunet/base"
print('base is:',base)
raw_dataset_dir = join(base, "nnUNet_raw/")
splitted_4d_output_dir = join(base, "nnUNet_raw_splitted/")
cropped_output_dir = join(base, "nnUNet_raw_cropped/")
maybe_mkdir_p(splitted_4d_output_dir)
maybe_mkdir_p(raw_dataset_dir)
maybe_mkdir_p(cropped_output_dir)
except KeyError:
cropped_output_dir = splitted_4d_output_dir = raw_dataset_dir = base = None
# preprocessing_output_dir is where the preprocessed data is stored. If you run a training I very strongly recommend
# this is a SSD!
try:
# preprocessing_output_dir = os.environ['nnUNet_preprocessed']
# preprocessing_output_dir ='D:/WenshuaiZhao/ProjectFiles/NNUnet/nnunet/base_preprocessed/'
# preprocessing_output_dir=os.environ['nnUNet_preprocessed']
preprocessing_output_dir="/cache/WenshuaiZhao/ProjectFiles/NNUnet_do_ds_all_train/nnunet/base_preprocessed"
except KeyError:
preprocessing_output_dir = None
# This is where the trained model parameters are stored
# RESULTS_FOLDER='D:/WenshuaiZhao/ProjectFiles/NNUnet/nnunet/base_results/'
# RESULTS_FOLDER=os.environ['RESULTS_FOLDER']
RESULTS_FOLDER="/cache/WenshuaiZhao/ProjectFiles/NNUnet_do_ds_all_train/nnunet/base_results"
# network_training_output_dir = os.path.join(os.environ['RESULTS_FOLDER'], my_output_identifier)
network_training_output_dir = os.path.join(RESULTS_FOLDER, my_output_identifier)
maybe_mkdir_p(network_training_output_dir)