Skip to content

Commit 9aa06df

Browse files
Copilotakhanf
andauthored
Drop atlas label 0 (background) from qc_roi_summary before plotting
Background regions (index == 0) are outside the brain and should be excluded from the per-ROI summary bar charts. Agent-Logs-Url: https://github.com/khanlab/SPIMquant/sessions/e1add057-49be-45a2-8dbf-1e8d402fd215 Co-authored-by: akhanf <11492701+akhanf@users.noreply.github.com>
1 parent 544b60e commit 9aa06df

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

spimquant/workflow/scripts/qc_roi_summary.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ def main():
5050
stats_df = pd.read_csv(snakemake.input.segstats, sep="\t")
5151
label_df = pd.read_csv(snakemake.input.label_tsv, sep="\t")
5252

53+
# Drop background (atlas label 0) — those voxels are outside the brain
54+
if "index" in stats_df.columns:
55+
stats_df = stats_df[stats_df["index"] != 0].copy()
56+
5357
# Merge region names (label_df has 'index' and 'name' columns)
5458
if "name" not in stats_df.columns and "index" in stats_df.columns:
5559
stats_df = stats_df.merge(label_df[["index", "name"]], on="index", how="left")

0 commit comments

Comments
 (0)