From cbfcf80eaf487eb90968ad33385b31a30a42fe42 Mon Sep 17 00:00:00 2001 From: magdamd Date: Wed, 4 Feb 2026 13:26:42 +0100 Subject: [PATCH 1/2] Modified to accept both floats and integers in nifti phantoms. --- python/MRzeroCore/phantom/nifti_phantom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/MRzeroCore/phantom/nifti_phantom.py b/python/MRzeroCore/phantom/nifti_phantom.py index 9bd3218..3c4a601 100644 --- a/python/MRzeroCore/phantom/nifti_phantom.py +++ b/python/MRzeroCore/phantom/nifti_phantom.py @@ -118,7 +118,7 @@ def default(cls, density: NiftiRef): @classmethod def from_dict(cls, config: dict[str, Any]): def parse_prop(prop): - if isinstance(prop, float): + if isinstance(prop, (float, int)):#, int return float(prop) elif isinstance(prop, str): return NiftiRef.parse(prop) From 8af96461f3f35f3f5b415068ceb514660ccf01cc Mon Sep 17 00:00:00 2001 From: magdamd Date: Wed, 4 Feb 2026 13:30:46 +0100 Subject: [PATCH 2/2] clean-up of variable format --- python/MRzeroCore/phantom/nifti_phantom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/MRzeroCore/phantom/nifti_phantom.py b/python/MRzeroCore/phantom/nifti_phantom.py index 3c4a601..4ac56fc 100644 --- a/python/MRzeroCore/phantom/nifti_phantom.py +++ b/python/MRzeroCore/phantom/nifti_phantom.py @@ -118,7 +118,7 @@ def default(cls, density: NiftiRef): @classmethod def from_dict(cls, config: dict[str, Any]): def parse_prop(prop): - if isinstance(prop, (float, int)):#, int + if isinstance(prop, (float, int)): return float(prop) elif isinstance(prop, str): return NiftiRef.parse(prop)