Voxel-wise classification training pipeline

I want to train simple neural network two layer classifier. Input data is 3-dimensional volumes of feature maps extracted from Brain MRI. I have manually extracted 6 feature maps each size of [128,128,128]. I want to feed each voxel into neural network, so input layer will have 6 neurons (for each map). The labels are the masks that manually segmented in region of brain malformation. I got following question regarding implementation

:

  1. The issue is I don’t quite understand how to create a training pipeline and dataloader for this type of input. I assume to create PatchDataset with size 1x1x1 Data — MONAI 1.0.0 Documentation. Are there examples of voxel-wise training example

  2. I assume that iterating on each voxel is not right strategy to implement, how should class imbalance be regulated?