  Applying pre-trained medical segmentation models on out-of-domain images
often yields predictions of insufficient quality. Several strategies have been
proposed to maintain model performance, such as finetuning or unsupervised- and
source-free domain adaptation. These strategies set restrictive requirements
for data availability. In this study, we propose to combine domain
generalization and test-time adaptation to create a highly effective approach
for reusing pre-trained models in unseen target domains. Domain-generalized
pre-training on source data is used to obtain the best initial performance in
the target domain. We introduce the MIND descriptor previously used in image
registration tasks as a further technique to achieve generalization and present
superior performance for small-scale datasets compared to existing approaches.
At test-time, high-quality segmentation for every single unseen scan is ensured
by optimizing the model weights for consistency given different image
augmentations. That way, our method enables separate use of source and target
data and thus removes current data availability barriers. Moreover, the
presented method is highly modular as it does not require specific model
architectures or prior knowledge of involved domains and labels. We demonstrate
this by integrating it into the nnUNet, which is currently the most popular and
accurate framework for medical image segmentation. We employ multiple datasets
covering abdominal, cardiac, and lumbar spine scans and compose several
out-of-domain scenarios in this study. We demonstrate that our method, combined
with pre-trained whole-body CT models, can effectively segment MR images with
high accuracy in all of the aforementioned scenarios. Open-source code can be
found here: https://github.com/multimodallearning/DG-TTA
