Skip to content

Commit

Permalink
adding contrast_presets to settings file if they didnt already exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Abe404 committed Feb 8, 2023
1 parent 19f8942 commit 1753200
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions painter/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ def init_root_painter():
json.dump(content, json_file, indent=4)

settings = json.load(open(settings_path, 'r'))

# if the file exists but does not contain contrast presets
# (for example, if the user has previously used RootPainter 2D)
# then add contrast presets (defaults) and then resave.
if "contrast_presets" not in settings:
settings['contrast_presets'] = { 'Mediastinal': [-125, 250, 100] }
with open(settings_path, 'w+') as json_file:
json.dump(settings, json_file, indent=4)

sync_dir = Path(settings['sync_dir'])
contrast_presets = settings['contrast_presets']
server_ip = None
Expand Down

0 comments on commit 1753200

Please sign in to comment.