From c91991c71a6320a26c5f903ecabcb2856cf41980 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 4 Oct 2024 21:09:28 -0400 Subject: [PATCH] fix: Copy input lists we intend to mutate --- nireports/interfaces/reporting/masks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nireports/interfaces/reporting/masks.py b/nireports/interfaces/reporting/masks.py index 34d1c6d7..4dba645c 100644 --- a/nireports/interfaces/reporting/masks.py +++ b/nireports/interfaces/reporting/masks.py @@ -235,8 +235,9 @@ def _generate_report(self): seg_files = self.inputs.in_rois mask_file = None if not isdefined(self.inputs.in_mask) else self.inputs.in_mask - levels = self.inputs.levels or [] - colors = self.inputs.colors or [] + # Remove trait decoration and replace None with [] + levels = list(self.inputs.levels or []) + colors = list(self.inputs.colors or []) if len(seg_files) == 1: # in_rois is a segmentation nsegs = len(levels)