From 69f6244c2cfe0d2b9188ce6a490ba879dfeefff8 Mon Sep 17 00:00:00 2001
From: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk>
Date: Wed, 21 Feb 2024 12:48:31 +0000
Subject: [PATCH] Fix filtering of variables

---
 src/parts/helper_functions.jl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/parts/helper_functions.jl b/src/parts/helper_functions.jl
index b52d065..250ac79 100644
--- a/src/parts/helper_functions.jl
+++ b/src/parts/helper_functions.jl
@@ -145,7 +145,7 @@ function readout_event(; type, optimise=false, scanner=nothing, variables...)
     if type == :instant
         optimise = false # there is nothing to optimise
     end
-    real_variables = Dict(key => value for (key, value) in pairs(variables) if !isnothing(variables))
+    real_variables = Dict(key => value for (key, value) in pairs(variables) if (!isnothing(value)) && (value isa AbstractVector && !all(isnothing.(value))))
     build_sequence(scanner; optimise=optimise) do 
         func_dict = Dict(
             :epi => EPIReadout,
-- 
GitLab