how to get imagefolder with t1, t1ce, t2 and flair in 3d slicer extended cli python module

Im trying to create a 3d slicer cli python module which can select a patient folder with .nii files of t1, t1c2, t2 and flair. I have a pytorch inference script which takes all four modalities (t1, t1ce, t2, flair) combined input. Not able to understand how to build widget which can fetch patient folder as input in cli python module. Im new to 3d slicer. Please help me.

Thanks in advance

The CLI infrastructure is pretty rigid so you would be better off writing a python scripted module to access the files.