Brain Shift as a Hidden Source of Label Noise in Glioma Pathway Studies

When surgeons remove a brain tumor, they often take small tissue samples from specific spots and record where each came from using the navigation system. That system shows the sample's position on an MRI taken before surgery. Researchers later sort these samples into regions such as "enhancing tumor core," "non-enhancing margin," and "surrounding brain." They then compare gene activity between regions and ask which biological pathways (hypoxia, invasion, cell cycle) are over-represented. This last step is functional enrichment analysis: a statistical test of whether a list of changed genes overlaps a curated gene set more than chance predicts. The weak link is the recorded position. Once the skull is opened, fluid drains and the brain sags and deforms, a movement called intraoperative brain shift. A spot recorded as "margin" on the preoperative MRI may have been sampled from the core or from healthy tissue millimetres away. Region labels near tumor boundaries, where the most interesting invasive biology is, are therefore the ones most likely to be wrong.

We propose to measure how much brain shift corrupts region-stratified pathway findings. We will then correct it by replacing each sample's hard region label with a probability. That probability comes from the uncertainty of a non-rigid brain-shift registration and feeds into a weighted enrichment test. The whole chain runs inside a pinned, containerized pipeline, so every pathway claim can be traced back to the exact deformation field and software that produced its labels, and re-run when better registration becomes available. Brain shift is the mechanism of error, enrichment is the downstream scientific output, and reproducible execution is the constraint that makes the correction auditable and re-executable.

Core Claim

Brain shift is usually treated as a navigation-accuracy problem. We argue it is also a label-noise problem for any molecular study that assigns tissue samples to anatomical regions using preoperative coordinates. That noise is structured: it is concentrated at boundaries and scales with local displacement. As a result, it biases enrichment toward pathways that differ between the regions being confused, and it dilutes margin-specific signals. We claim that labels computed as probabilities under a registration's own uncertainty recover planted pathway signal better than three alternatives: hard labels from rigid registration, hard labels from non-rigid registration, and simply discarding near-boundary samples. We further claim that this correction is reproducible only if the deformation field is versioned alongside the expression data.

The research file reports no prior study that warps sample coordinates through brain-shift fields before pathway analysis. The closest work stays on one side of the divide. AI-driven 3D Spatial Transcriptomics reconstructs 3D expression in fixed, undeformed ex vivo specimens. The HP1.1 hyperspectral system (Versatile and comprehensive hyperspectral imaging tool for molecular neuronavigation) reads out metabolic chromophores in excised glioma biopsies rather than transcriptome-level pathways. Neither models the geometric error of where a sample came from, and both of them motivate the proposal by showing that glioma molecular state is spatially heterogeneous.

Research Program

The first component quantifies label flips from real brain shift. We use ReMIND, which provides preoperative MRI, 3D intraoperative ultrasound, intraoperative MRI (iMRI), and tumor segmentations for 114 resection patients. The file notes that ReMIND lacks point landmarks. We therefore use the intraoperative segmentations as the post-shift ground truth for where each region actually lies. We place simulated sampling points throughout and around the tumor in preoperative space, map them into intraoperative space under each registration method, and record how often the preoperative region label disagrees with the intraoperative one. We report this rate as a function of distance to the tumor boundary and of local displacement magnitude. This gives an empirical noise model tied to real anatomy rather than an assumed one.

The second component turns registration uncertainty into soft labels. For a sample recorded at preoperative position $x_i$, let $q_i(u)$ be the registration's posterior distribution over the displacement $u$ at that point, and let $S(\cdot)$ be the region map in the deformed brain. The soft label for region $r$ is

$$ p_i(r) = \int \mathbf{1}\left[S(x_i + u) = r\right] q_i(u)\, du . $$

We obtain $q_i$ in two ways. The first is the Gaussian-process posterior of the ultrasound feature-driven method of Luo et al., which regresses sparse landmark displacements into a dense field and already exposes low-confidence regions. The second is an ensemble over the keypoint-to-dense interpolator of Assis et al., which refines thin-plate splines with a residual 3D U-Net trained on simulated deformations. We evaluate these in Monte Carlo form. One caveat constrains how the soft labels can be read. The Luo variogram is isotropic, and both surrogates inherit boundary-condition errors from their simulators, a limitation flagged for PhysGNN. The soft labels are only as calibrated as $q_i$, so we test calibration directly against the ReMIND flip rates.

The third component is uncertainty-weighted enrichment. Differential expression between regions is fit with each sample contributing to region contrasts in proportion to $p_i(r)$. This amounts to a mixture-membership regression rather than hard group assignment. The resulting ranked gene list then goes into standard over-representation and rank-based tests against Gene Ontology and KEGG gene sets. We implement the test layer on the harmonized Fisher's-exact machinery in funkea, so that the only thing changing between conditions is how samples are labeled.

The fourth component is the execution environment. The registration, soft-labelling, and enrichment stages are packaged as a single pinned container image in the style of BIDS Apps, which packaged neuroimaging suites for cross-platform parity. The pipeline also keeps an append-only provenance log in the style of the SciAgent audit harness. Each sample's log entry stores a hash of the displacement field, the registration version and seed, and the resulting $p_i$. We do not use an LLM verifier. SciAgent's verifier relies on uncalibrated confidences, and our checks are deterministic, which makes them sufficient. The environment's scientific role is concrete: we can regenerate every enrichment table under a different registration method or host and measure whether conclusions move. BIDS Apps explicitly warns that containers do not virtualize the host kernel, so small numerical divergence could shift near-boundary labels. We test this rather than assume it away.

Baselines

The naive reference point mimics current practice. Samples are labeled by their recorded preoperative coordinate after rigid patient-to-image registration. Hard labels feed Fisher's exact over-representation analysis. It is run on identical samples, gene sets, and test code. Anything that fails to beat it on planted-pathway recovery has no case.

The strongest shift-correction baseline uses non-rigid registration with hard labels from the point estimate. We run both the Luo Gaussian-process method and the Assis deep interpolator, with the same ultrasound inputs, keypoints, and compute. For context, Luo et al. report that initial registration error fell from 5.56 mm to 1.75 mm in a representative case. Assis et al. report a 50% to 65% reduction in mean squared error over linear and thin-plate-spline interpolation on simulated shifts. This is the natural competitor because better point registration might remove most label flips by itself. The proposal beats it only if soft labels improve planted-pathway recovery at matched false-positive rate beyond what the best point estimate achieves.

The key ablation compares soft against hard labels from the same registration. It isolates whether the uncertainty adds anything beyond the corrected position.

A near-oracle baseline relabels samples using iMRI segmentation directly, where iMRI is available. This defines the ceiling that ultrasound-based correction aims to approach.

A margin-exclusion baseline drops every sample within a distance $d$ of any boundary, with $d$ tuned on held-out ReMIND patients under the same budget used to tune the soft-label method.

For the enrichment layer itself, we found no reported result on Lacuna for pathway recovery under label noise, and none for funkea. All enrichment numbers in this study will be produced by us under shared code.

Why not just…?

Why not just use the best non-rigid registration and keep hard labels? This is the most serious alternative. If residual error after registration is well below the typical sample-to-boundary distance, soft labels change little. The hard-versus-soft ablation settles it. We expect soft labels to matter because residual error of order 1.75 mm is still comparable to the width of infiltrative margins. But if the flip rate after non-rigid correction is negligible on ReMIND, we will report that registration alone suffices and drop the weighting claim.

Why not just discard samples near the boundary? It is simple and removes most flips. However, it removes exactly the invasive-front samples that margin biology is about, so it trades bias for lost statistical power. The experiment compares both approaches at matched false-positive rates and tracks power specifically for margin-specific planted pathways. If exclusion matches soft weighting on those pathways, exclusion wins on simplicity, and we will say so.

Why not just use intraoperative MRI to locate every sample? Where it exists, it is the better answer, and we use it as the ceiling. The obstacle is access, not accuracy. iMRI is costly, interrupts surgery, and needs MR-compatible instruments (Tian et al.), so most biopsy cohorts will not have it. The relevant question is how close ultrasound-based soft labels come to the iMRI ceiling.

Why not just use a Conda environment and skip containers? For the enrichment code alone, a Conda lockfile might suffice. The registration stack, however, depends on OS-level imaging libraries that package managers do not isolate, which is the failure mode BIDS Apps documents. The cross-host re-execution experiment below measures whether this actually changes labels. If it does not, the container remains a convenience rather than a scientific necessity, and we will report it that way.

Proposed Experiments

The first experiment measures flip rates on ReMIND. For every patient with intraoperative segmentation, we compute the region-label disagreement rate as a function of distance to the boundary under five conditions: rigid registration, Luo point estimate, Assis point estimate, their soft versions, and iMRI. We also measure soft-label calibration by comparing predicted $p_i(r)$ against observed flip frequencies in reliability curves. This experiment needs no transcriptomic data and stands on its own.

The second experiment is a semi-synthetic enrichment study. The file contains no region-annotated glioma transcriptome. We therefore generate expression profiles in which chosen Gene Ontology and KEGG sets are planted as region-specific programs, including some confined to the margin. We impose realistic between-spot correlation structure borrowed from the Visium cohorts used in AI-driven 3D Spatial Transcriptomics. We acknowledge those cohorts are non-brain tissue, and they supply only noise structure. Samples are then relabeled with the empirical ReMIND noise model from the first experiment. The metrics are planted-pathway recovery (area under the precision-recall curve over pathways), false-positive pathway rate at 5% false discovery rate, and rank correlation of pathway p-values with the analysis run on true labels. The decisive check is whether soft labels beat the best hard non-rigid labels and margin exclusion on margin-specific pathways. Failing that check falsifies the central claim.

The third experiment tests reproducibility. We re-execute the full pipeline from the provenance log on at least three hosts with differing kernels and GPUs. We also re-execute it with registration swapped from Luo to Assis. For each run we report the fraction of samples whose most probable region changes and the fraction of significant pathways that change. If environment-driven changes are small next to registration-method changes, we conclude that versioning the deformation field matters more than versioning the host. This outcome is useful either way.

A final step, outside this note's data, is a prospective cohort. It would pair navigated biopsies and ultrasound sweeps with RNA sequencing, and it is the only way to confirm the semi-synthetic findings on real glioma biology.