From d42bb34960ba407cf07905382e036b8a808d85b4 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Fri, 4 Nov 2022 09:30:37 -0400 Subject: [PATCH 1/4] Add F-T2 and F-S0 maps to verbose outputs. --- tedana/metrics/collect.py | 10 ++++++++++ tedana/resources/config/outputs.json | 16 ++++++++++++++++ .../tests/data/nih_five_echo_outputs_verbose.txt | 4 ++++ 3 files changed, 30 insertions(+) diff --git a/tedana/metrics/collect.py b/tedana/metrics/collect.py index 51c4097a9..ada13ffe1 100644 --- a/tedana/metrics/collect.py +++ b/tedana/metrics/collect.py @@ -160,6 +160,16 @@ def generate_metrics( metric_maps["map predicted T2"] = p_m_T2 metric_maps["map predicted S0"] = p_m_S0 + if io_generator.verbose: + io_generator.save_file( + utils.unmask(metric_maps["map FT2"], mask), + label + " component F-T2 img", + ) + io_generator.save_file( + utils.unmask(metric_maps["map FS0"], mask), + label + " component F-S0 img", + ) + if "map Z clusterized" in required_metrics: LGR.info("Thresholding z-statistic maps") z_thresh = 1.95 diff --git a/tedana/resources/config/outputs.json b/tedana/resources/config/outputs.json index e8acea001..558b34d2e 100644 --- a/tedana/resources/config/outputs.json +++ b/tedana/resources/config/outputs.json @@ -75,6 +75,14 @@ "orig": "pca_weights", "bidsv1.5.0": "desc-PCAAveragingWeights_components" }, + "PCA component T2 img": { + "orig": "pca_FT2", + "bidsv1.5.0": "desc-PCAT2_stat-F_statmap" + }, + "PCA component S0 img": { + "orig": "pca_FS0", + "bidsv1.5.0": "desc-PCAS0_stat-F_statmap" + }, "PCA reduced img": { "orig": "oc_reduced", "bidsv1.5.0": "desc-optcomPCAReduced_bold" @@ -95,6 +103,14 @@ "orig": "ica_weights", "bidsv1.5.0": "desc-ICAAveragingWeights_components" }, + "ICA component T2 img": { + "orig": "ica_FT2", + "bidsv1.5.0": "desc-ICAT2_stat-F_statmap" + }, + "ICA component S0 img": { + "orig": "ica_FS0", + "bidsv1.5.0": "desc-ICAS0_stat-F_statmap" + }, "high kappa ts split img": { "orig": "hik_ts_e{echo}", "bidsv1.5.0": "echo-{echo}_desc-Accepted_bold" diff --git a/tedana/tests/data/nih_five_echo_outputs_verbose.txt b/tedana/tests/data/nih_five_echo_outputs_verbose.txt index 234bf6619..6f1913708 100644 --- a/tedana/tests/data/nih_five_echo_outputs_verbose.txt +++ b/tedana/tests/data/nih_five_echo_outputs_verbose.txt @@ -9,9 +9,13 @@ desc-ICA_components.nii.gz desc-ICA_decomposition.json desc-tedana_metrics.json desc-tedana_metrics.tsv +desc-ICAS0_stat-F_statmap.nii.gz +desc-ICAT2_stat-F_statmap.nii.gz desc-ICA_mixing.tsv desc-ICA_stat-z_components.nii.gz desc-PCAAveragingWeights_components.nii.gz +desc-PCAS0_stat-F_statmap.nii.gz +desc-PCAT2_stat-F_statmap.nii.gz desc-PCA_decomposition.json desc-PCA_metrics.json desc-PCA_metrics.tsv From 8ca7f5a3c23097b0c9e1624c1348f34e6c5d2192 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Fri, 4 Nov 2022 09:32:56 -0400 Subject: [PATCH 2/4] Add new outputs to outputs list. --- docs/outputs.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/outputs.rst b/docs/outputs.rst index 797926134..e686bd100 100644 --- a/docs/outputs.rst +++ b/docs/outputs.rst @@ -101,6 +101,8 @@ echo-[echo]_desc-[PCA|ICA]S0ModelPredictions_components.nii.gz Component- and v separated by echo. desc-[PCA|ICA]AveragingWeights_components.nii.gz Component-wise averaging weights for metric calculation. +desc-[PCA|ICA]S0_stat-F_statmap.nii.gz F-statistic map for each component, for the S0 model. +desc-[PCA|ICA]T2_stat-F_statmap.nii.gz F-statistic map for each component, for the T2 model. desc-optcomPCAReduced_bold.nii.gz Optimally combined data after dimensionality reduction with PCA. This is the input to the ICA. echo-[echo]_desc-Accepted_bold.nii.gz High-Kappa time series for echo number ``echo`` From 4dee33971c387d801384fc964545578e07481a72 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Fri, 4 Nov 2022 09:48:12 -0400 Subject: [PATCH 3/4] Fix keys. --- tedana/resources/config/outputs.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tedana/resources/config/outputs.json b/tedana/resources/config/outputs.json index 558b34d2e..6019f0a29 100644 --- a/tedana/resources/config/outputs.json +++ b/tedana/resources/config/outputs.json @@ -75,11 +75,11 @@ "orig": "pca_weights", "bidsv1.5.0": "desc-PCAAveragingWeights_components" }, - "PCA component T2 img": { + "PCA component F-T2 img": { "orig": "pca_FT2", "bidsv1.5.0": "desc-PCAT2_stat-F_statmap" }, - "PCA component S0 img": { + "PCA component F-S0 img": { "orig": "pca_FS0", "bidsv1.5.0": "desc-PCAS0_stat-F_statmap" }, @@ -103,11 +103,11 @@ "orig": "ica_weights", "bidsv1.5.0": "desc-ICAAveragingWeights_components" }, - "ICA component T2 img": { + "ICA component F-T2 img": { "orig": "ica_FT2", "bidsv1.5.0": "desc-ICAT2_stat-F_statmap" }, - "ICA component S0 img": { + "ICA component F-S0 img": { "orig": "ica_FS0", "bidsv1.5.0": "desc-ICAS0_stat-F_statmap" }, From ca256781abd64847fd01092206a41788395494dc Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Fri, 4 Nov 2022 10:31:39 -0400 Subject: [PATCH 4/4] Didn't realize four-echo was verbose. --- tedana/tests/data/fiu_four_echo_outputs.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tedana/tests/data/fiu_four_echo_outputs.txt b/tedana/tests/data/fiu_four_echo_outputs.txt index ca2f1f7aa..a3a3da3d4 100644 --- a/tedana/tests/data/fiu_four_echo_outputs.txt +++ b/tedana/tests/data/fiu_four_echo_outputs.txt @@ -10,9 +10,13 @@ desc-ICA_components.nii.gz desc-ICA_decomposition.json desc-tedana_metrics.json desc-tedana_metrics.tsv +desc-ICAS0_stat-F_statmap.nii.gz +desc-ICAT2_stat-F_statmap.nii.gz desc-ICA_mixing.tsv desc-ICA_stat-z_components.nii.gz desc-PCAAveragingWeights_components.nii.gz +desc-PCAS0_stat-F_statmap.nii.gz +desc-PCAT2_stat-F_statmap.nii.gz desc-PCA_decomposition.json desc-PCA_metrics.json desc-PCA_metrics.tsv