From c1f80cc0fe0e1178bd2e04c0450f482548d227c1 Mon Sep 17 00:00:00 2001 From: Joshua Teves Date: Mon, 24 May 2021 17:27:12 -0400 Subject: [PATCH] Reorder component table labels correctly --- tedana/metrics/collect.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tedana/metrics/collect.py b/tedana/metrics/collect.py index 26c1e31bc..ceb68a023 100644 --- a/tedana/metrics/collect.py +++ b/tedana/metrics/collect.py @@ -180,6 +180,7 @@ def generate_metrics( ) for comp in comptable.index.values ] + # Metric maps # Maps will be stored as arrays in an easily-indexable dictionary metric_maps = {} @@ -441,6 +442,13 @@ def generate_metrics( disordered = set(cmp_cols) & (set(cmp_cols) ^ set(previous_order)) for metric in disordered: reordered[metric] = comptable[metric] + # Add in component labels with new ordering + reordered["Component"] = [ + io.add_decomp_prefix( + comp, prefix=label, max_value=reordered.shape[0] + ) + for comp in reordered.index.values + ] return reordered, mixing