Skip to content

Commit

Permalink
Manually corrected --> Manual
Browse files Browse the repository at this point in the history
Context: #76 (comment)
  • Loading branch information
valosekj committed Feb 2, 2024
1 parent 5f22e18 commit be73315
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion manual_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def update_json(fname_nifti, name_rater, modified):

# If the label was modified, add "Name": "Manual" to the JSON sidecar
if modified:
json_dict['GeneratedBy'].append({'Name': 'Manually corrected',
json_dict['GeneratedBy'].append({'Name': 'Manual',
'Author': name_rater,
'Date': time.strftime('%Y-%m-%d %H:%M:%S')})
# If the was not modified, add "Name": ""Visually verified"" to the JSON sidecar
Expand Down
12 changes: 6 additions & 6 deletions tests/test_create_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_create_json_modified_true(tmp_path):

# Check that the JSON file was created and contains the expected metadata
expected_metadata = {'SpatialReference': 'orig',
'GeneratedBy': [{'Name': 'Manually corrected',
'GeneratedBy': [{'Name': 'Manual',
'Author': "Test Rater",
'Date': time.strftime('%Y-%m-%d %H:%M:%S')}]}
json_file = tmp_path / fname_label.replace(".nii.gz", ".json")
Expand Down Expand Up @@ -74,7 +74,7 @@ def test_update_json_modified_true(tmp_path):
json_file = tmp_path / fname_label.replace(".nii.gz", ".json")
with open(str(json_file), "w") as f:
json.dump({'SpatialReference': 'orig',
'GeneratedBy': [{'Name': 'Manually corrected',
'GeneratedBy': [{'Name': 'Manual',
'Author': "Test Rater 1",
'Date': "2023-01-01 00:00:00"}]}, f)

Expand All @@ -83,10 +83,10 @@ def test_update_json_modified_true(tmp_path):

# Check that the JSON file was created and contains the expected metadata
expected_metadata = {'SpatialReference': 'orig',
'GeneratedBy': [{'Name': 'Manually corrected',
'GeneratedBy': [{'Name': 'Manual',
'Author': "Test Rater 1",
'Date': "2023-01-01 00:00:00"},
{'Name': 'Manually corrected',
{'Name': 'Manual',
'Author': "Test Rater 2",
'Date': time.strftime('%Y-%m-%d %H:%M:%S')}]}
json_file = tmp_path / fname_label.replace(".nii.gz", ".json")
Expand All @@ -109,7 +109,7 @@ def test_update_json_modified_false(tmp_path):
json_file = tmp_path / fname_label.replace(".nii.gz", ".json")
with open(str(json_file), "w") as f:
json.dump({'SpatialReference': 'orig',
'GeneratedBy': [{'Name': 'Manually corrected',
'GeneratedBy': [{'Name': 'Manual',
'Author': "Test Rater 1",
'Date': "2023-01-01 00:00:00"}]}, f)

Expand All @@ -118,7 +118,7 @@ def test_update_json_modified_false(tmp_path):

# Check that the JSON file was created and contains the expected metadata
expected_metadata = {'SpatialReference': 'orig',
'GeneratedBy': [{'Name': 'Manually corrected',
'GeneratedBy': [{'Name': 'Manual',
'Author': "Test Rater 1",
'Date': "2023-01-01 00:00:00"},
{'Name': 'Visually verified',
Expand Down

0 comments on commit be73315

Please sign in to comment.