Skip to content

Commit

Permalink
add column in dataset df about subjects' split
Browse files Browse the repository at this point in the history
  • Loading branch information
naga-karthik committed Apr 16, 2024
1 parent 48d5bd2 commit b774fd7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions monai/create_msd_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ def main():
# sort the subjects
train_subjects, val_subjects, test_subjects = sorted(train_subjects), sorted(val_subjects), sorted(test_subjects)

# add a column specifying whether the subject is in train, val or test split
df['split'] = 'none'
df.loc[df['subjectID'].isin(train_subjects), 'split'] = 'train'
df.loc[df['subjectID'].isin(val_subjects), 'split'] = 'validation'
df.loc[df['subjectID'].isin(test_subjects), 'split'] = 'test'

# get boilerplate json
params = get_boilerplate_json(dataset_name, dataset_commits)

Expand Down

0 comments on commit b774fd7

Please sign in to comment.