mri-braintumor-segmentation icon indicating copy to clipboard operation
mri-braintumor-segmentation copied to clipboard

Setting path to data

Open amsinha9 opened this issue 3 years ago • 4 comments

In your config.ini, you specify the datset path in lines 68-69, but are you pulling the data in the same format that we get the original data (~\MICCAI_BraTS_2020_Data_Training\HGG...")? Or would you mind updating your README to specify what else we have to change accordingly since the model paths and checkpoints won't be relevant right away when we're trying it out on our own, correct?

amsinha9 avatar Apr 01 '21 21:04 amsinha9

Hello, and sorry for the delay!

I have updated the information on the README file as suggested.

The dataset follows the original data format except that it does not separate between HGG and LGG patients (this information is still available in the .csv files, also updated on the readme with their structure).

As an example of the training path, it would be: /yourRootPath/train/<sampling_strategy>/BraTS20_Training_001/*.nii.gz

The <sampling_strategy> variable was used to store precomputed patches if necessary. In case the patches are not precomputed just put no_patch for instance or remove the step when creating the path in the config.py script.

I hope this information solves your question! Feel free to ask for anything else

LauraMoraB avatar May 02 '21 15:05 LauraMoraB

Thansk for the response! In lines 19-20 of config.ini, if we are training the model for the first time and thus don't have a trained model to load, how do we edit the lines accordingly? Same with line 26.

Also, in lines 68-69, why are there two root paths to the data? For our purposes, can we just set the dataset_root_path_local or are dataset_root_path_server and dataset_root_path_local both used in training, validation and/or testing?

amsinha9 avatar May 02 '21 17:05 amsinha9

  1. Regarding the first question about training the model for the first time you would need to set train_flag=True and resume=False. This setup will create a new file and ignore whatever is set on line 26.

Example config in resources/config.ini:

[basics]
train_flag: true
resume: false

Then, when the configuration is loaded in the src/config.py file, it will create a new model_name

See src/config.py:

resume = self.config.getboolean("basics", "resume")
if train:
    if resume:
        model_name, _ = os.path.split(self.config.get("model", "checkpoint"))
    else:
        model_name = f"model_{round(time.time())}"
  1. For the second question, you can actually remove one of the paths. I used both of them as it made my life easier as I was developing on my personal laptop and on the university servers. By having both paths I didn't have to change it all the time.

So, if you look at the src/config.py you'll see that, in the end, only one is used. It checks which one exists and keeps that one.

LauraMoraB avatar May 02 '21 18:05 LauraMoraB

Thank you for being so thorough and clear, I appreciate it! I will try running it soon and will let you know if I have any additional questions. Great code and resource!

amsinha9 avatar May 02 '21 18:05 amsinha9