mahmoodlab / CLAM

Data-efficient and weakly supervised computational pathology on whole slide images - Nature Biomedical Engineering
http://clam.mahmoodlab.org
GNU General Public License v3.0
1.02k stars 340 forks source link

minor fix for create_patches_fp.py saving .h5 files to image source directory #206

Closed VictorLee94 closed 11 months ago

VictorLee94 commented 11 months ago

This is amazing work! Just a minor suggestion for a small bug. For some reason, the .h5 files generated with create_patches_fp.py get saved in the source directory of whole slide images. I've appended create_patches_fp.py with this code to move the .h5 files to the intended directory.

import shutil
source_files = os.listdir(args.source)
for file in source_files:
    if file.endswith('.h5'):
        shutil.move(os.path.join(args.source, file), patch_save_dir)
fedshyvana commented 11 months ago

Hey Victor, I feel like this maybe some weird issue where the script doesn't play nice with parsing file directories on Windows. I think on Linux things behave as expected.

VictorLee94 commented 11 months ago

Thanks! I understand.