Below is the basic workflow for the code. BrainPipeline, PatchLibrary and SegmentationModel are classes that handle each of these processes. n4_bias_correction is a helper function that handles MRI bias and artifact corrections called by BrainPipeline.
