From 1eb6a1a205d2f0769138553fcdbe80a1c3bdfab9 Mon Sep 17 00:00:00 2001 From: Basile Date: Thu, 18 Jul 2024 15:43:16 -0400 Subject: [PATCH] Update heudiconv/convert.py Co-authored-by: miltoncamachocamacho <150370230+miltoncamachocamacho@users.noreply.github.com> --- heudiconv/convert.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/heudiconv/convert.py b/heudiconv/convert.py index bf2ba862..76b3c009 100644 --- a/heudiconv/convert.py +++ b/heudiconv/convert.py @@ -981,15 +981,12 @@ def save_converted_files( ) # Check for uncombined data CPLX_PARTS = ["MAGNITUDE", "PHASE", "IMAGINARY", "REAL"] is_complex = len( - set( - [ - part - for its in image_types - for part in CPLX_PARTS - if part in its or part[0] in its - ] - ) - ) # Determine if data are complex (magnitude + phase or real + imag or all-4) + set( + its + for its in image_types + if any(part == its for part in CPLX_PARTS) + ) + ) # Determine if data are complex (magnitude + phase or real + imag or all-4) echo_times_lst = sorted(echo_times) # also converts to list channel_names_lst = sorted(channel_names) # also converts to list