Recursively finds all unique folders containing DICOM (.dcm) files. :param root_dir: The path to the dataset directory.