arXiv:2609.03956cs.CVSep 2026

Manuscript Offprint

arXiv:2609.03956

RARF: Region-Aware Rectified Flows for 3D Brain MRI Inpainting

Tomas Guija-Valiente, Blanca Rodriguez-Gonzalez, Norberto Malpica, Angel Torrado-Carvajal

Tomas Guija-Valiente¹[0009-0000-0911-3317], Blanca

Rodriguez-Gonzalez¹[0009-0007-0982-1293], Norberto

Malpica¹[0000-0003-4618-7459], and Angel Torrado-Carvajal¹[0000-0002-1540-2809]

Medical Image Analysis and Biometry Lab, Universidad Rey Juan Carlos, Madrid, Spain

tomas.guija@urjc.es

Abstract. Medical image inpainting has the potential to improve automated brain MRI analysis by reconstructing healthy tissue within pathological regions. We introduce RARF, a task-agnostic region-aware rectified flow framework for masked data generation. We instantiate the framework for 3D brain MRI inpainting as our submission to the BraTS Inpainting Challenge 2026. RARF restricts the stochastic interpolation process to the inpainting region, while the observed voxels remain fixed and provide patient-specific anatomical context. A three-dimensional neural network receives the partially voided image, with Gaussian noise filling the missing region, together with the inpainting mask and the corresponding timestep. The model is trained using masked flow-matching and reconstruction-consistency objectives, combined with mask-aware preprocessing and data augmentation. During inference, the learned velocity field transports the initial noise toward a plausible reconstruction of the missing tissue, which is then combined with the unchanged observed anatomy. Experiments under the BraTS evaluation protocol show that the proposed approach produces competitive reconstructions while maintaining anatomical consistency. Source code is available at: https://github.com/TomasGuija/rarf.

Keywords: Rectified flow · Image inpainting · Medical image synthesis · Brain MRI

1 Introduction

Many automated brain Magnetic Resonance Imaging (MRI) analysis methods are designed under the assumption that the input image represents healthy anatomy. This assumption is problematic in neuro-oncology, where healthy images are generally unavailable and downstream tools for tasks such as brain extraction, tissue segmentation, or anatomical parcellation may be unreliable in

Preprint version corresponding to the initial submission prior to peer review. The final accepted version will be openly available in the official MICCAI proceedings on the conference website.

the presence of lesions [15]. In this context, healthy tissue synthesis can provide a subject-specific anatomical proxy to mitigate pathology-induced bias in subsequent analyses.

The Brain Tumor Segmentation (BraTS) Challenge: Local Synthesis of Healthy Brain Tissue via Inpainting [9,2] addresses this limitation by formulating healthy tissue synthesis as a standardized inpainting task: given a partially masked brain MRI, the objective is to reconstruct the tumor-affected region with anatomically plausible, tumor-free tissue.

Classical approaches based on diffusion, fast marching, exemplar filling, or smoothness-regularized interpolation have been applied to both natural images and medical imaging problems, including the recovery of missing voxels in brain MRI [3,16,4,17]. However, these methods are often insufficient for large pathological regions, where complete anatomical structures must be synthesized rather than locally propagated. Deep learning approaches address this limitation by learning data-driven priors, with mask-aware convolutional and diffusion models proving effective for irregular regions in natural images [10,12] and for lesion filling, pathology-free reconstruction, and healthy tissue synthesis in medical imaging [1,13,15,5]. In BraTS, existing methods mainly rely on direct U-Net-based reconstruction [18,19,20] or iterative diffusion-based restoration [5]. More recently, region-aware diffusion (RAD) has shown the value of adapting the generative process to the mask geometry [8], which is particularly relevant when synthesizing plausible healthy anatomy while preserving the surrounding patient-specific context.

Motivated by this region-aware perspective, we propose RARF, a Region-Aware Rectified Flow framework for localized image inpainting [11]. RARF is designed to be task-agnostic and supports multiple training and inference strategies. In the BraTS instantiation considered here, rectified-flow interpolation and supervision are restricted to the target region, while the observed anatomy is preserved as conditioning context. The model therefore learns to generate plausible healthy tissue within the missing region without modifying the surrounding anatomy. An overview of the resulting training and inference pipeline is shown in Fig. 1. Preliminary results suggest that this BraTS-specific instantiation produces anatomically consistent reconstructions.