Each of these text files in the seg_XX folders contains some target information for this segment, is that correct?
The seg_XX folders contain additionally some DICOM data or just the target?
Do you have any constraints regarding the datasetXX folders? E.g. would you like to handle them in a special way to avoid data leakage or can you just use all datasets to train your model?