I don't have time to write a general python script yet. Maybe it will be updated later.
The most important parts here are data_analysis_and_preprocess.py, Trainer.py, PatchBasedPredictor.py and Evaluator.py. The dataset needs to be in the form of images and labels or in the form of imagesTr+labelsTr, imagesVal+labelsVal, (imagesTs) plus dataset.yaml.
The website of the sample dataset is as follows: Home - Grand Challenge (grand-challenge.org)