OPTIMAS/utils/files_handling.py
def images_list(folder, extension="png", data_type='raw'):
    """
    If the npy file names have no leading zeros then the  list is not ordered
    correctly. This serve to create an ordered list from the length of the
    number of files in the folder.
    input: folder path
    output: ordered npy file name list
    """
    files_len = len(next(os.walk(folder))[2])
    image_list = []
    for i in range(files_len):
        if data_type == 'raw':
            image_name = f'image{str(i)}.{extension}'
        elif data_type == 'denoised':
            image_name = f'image_denoised{str(i)}.{extension}'
        image_list.append(image_name)
    return image_list

    If the npy file names have no leading zeros then the  list is not ordered
    correctly. This serve to create an ordered list from the length of the
    number of files in the folder.
    input: folder path
    output: ordered npy file name list
    
If the npy file names have no leading zeros then the  list is not ordered
correctly. This serve to create an ordered list from the length of the
number of files in the folder.
input: folder path
output: ordered npy file name list
If the npy file names have no leading zeros then the list is not ordered correctly . This serve to create an ordered list from the length of the number of files in the folder . input : folder path output : ordered npy file name list
def images_list(folder, extension="png", data_type='raw'):
    files_len = len(next(os.walk(folder))[2])
    image_list = []
    for i in range(files_len):
        if data_type == 'raw':
            image_name = f'image{str(i)}.{extension}'
        elif data_type == 'denoised':
            image_name = f'image_denoised{str(i)}.{extension}'
        image_list.append(image_name)
    return image_list
def images_list ( folder , extension = "png" , data_type = 'raw' ) : files_len = len ( next ( os . walk ( folder ) ) [ 2 ] ) image_list = [ ] for i in range ( files_len ) : if data_type == 'raw' : image_name = f'image{str(i)}.{extension}' elif data_type == 'denoised' : image_name = f'image_denoised{str(i)}.{extension}' image_list . append ( image_name ) return image_list
If the npy file names have no leading zeros then the  list is not ordered
correctly.
If the npy file names have no leading zeros then the list is not ordered correctly .
"""
    If the npy file names have no leading zeros then the  list is not ordered
    correctly. This serve to create an ordered list from the length of the
    number of files in the folder.
    input: folder path
    output: ordered npy file name list
    """
folder
extension
data_type