Skip to content

Commit

Permalink
Merge pull request #396 from IMSY-DKFZ/T395_Settings_Get
Browse files Browse the repository at this point in the history
Add get() to Settings
  • Loading branch information
kdreher authored Nov 15, 2024
2 parents a3e52bf + 66fa6c5 commit 40649b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,4 @@ Gröhl, Janek, Kris K. Dreher, Melanie Schellenberg, Tom Rix, Niklas Holzwarth,

This project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No. [101002198]).

![ERC](docs/source/images/LOGO_ERC-FLAG_EU_.jpg "ERC")
![ERC](https://github.com/IMSY-DKFZ/simpa/raw/main/docs/source/images/LOGO_ERC-FLAG_EU_.jpg "ERC")
5 changes: 5 additions & 0 deletions simpa/utils/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ def __delitem__(self, key):
except KeyError:
raise KeyError("The key '{}' is not in the Settings dictionary".format(key)) from None

def get(self, key, default=None):
if key in self:
return self[key]
return default

def get_volume_dimensions_voxels(self):
"""
returns: tuple
Expand Down

0 comments on commit 40649b9

Please sign in to comment.