From 64c0f1dc57a8ea993262b2ed312f31ffd28f92f2 Mon Sep 17 00:00:00 2001 From: Yujing Huang Date: Fri, 26 Jul 2024 10:27:44 -0400 Subject: [PATCH] add complex64 support to MGHArrayIO.load() and MGHArrayIO.save() --- surfa/io/framed.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/surfa/io/framed.py b/surfa/io/framed.py index 7c99880..fcfbf54 100644 --- a/surfa/io/framed.py +++ b/surfa/io/framed.py @@ -230,6 +230,7 @@ def dtype_from_id(self, id): 3: '>f4', # float 4: '>i2', # short 6: '>f4', # tensor + 7: '>c8', # complex64 10: '>u2', # ushort } dtype = mgh_types.get(id) @@ -398,6 +399,7 @@ def save(self, arr, filename, intent=FramedArrayIntents.mri): np.floating: 3, np.int16: 4, np.uint16: 10, + np.complex64: 7, } dtype_id = next((i for dt, i in type_map.items() if np.issubdtype(arr.dtype, dt)), None) if dtype_id is None: