<commit_before>


def prepare_pilsen_pigs_dataset(input_dir, output_dir, output_format=".mhd"):
    # from google_drive_downloader import GoogleDriveDownloader as gdd
    import io3d
    from pathlib import Path
    import SimpleITK

    # teoretické načtení složky T040
    imput_dir = Path(r'G:\.shortcut-targets-by-id\1Vq6QAiJ7cHDJUdgKXjUxx5iw7zk6MMPI\transplantation')
    dp = io3d.read(list(imput_dir.glob('*040D_V*'))[0])
    f_name = list(imput_dir.glob('*040D_V*'))[0]

    pass<commit_msg>Update transform_file_structure.py<commit_after>


def prepare_pilsen_pigs_dataset(input_dir, output_dir, output_format=".mhd"):
    # from google_drive_downloader import GoogleDriveDownloader as gdd
    import io3d
    from pathlib import Path
    import SimpleITK

    # teoretické načtení složky T040
    imput_dir = Path(r'G:\.shortcut-targets-by-id\1Vq6QAiJ7cHDJUdgKXjUxx5iw7zk6MMPI\transplantation')
    dp = io3d.read(list(imput_dir.glob('*040D_V*'))[0])
    f_name = list(imput_dir.glob('*040D_V*'))[0]

    output_dir = Path(r'G:\.shortcut-targets-by-id\1nz7i4Zssar8075yu6J5QpHdph6oi3uF8\pilsen_pigs')
    io3d.write({'data3d': np.zeros([10, 10, 10])}, output_dir / 'pokus.pklz')

    # ukladani obsahu slozek
    k = 0

    for f_name in file_list:
        p = str(r'C:\Users\janar\data\biomedical\orig\Pilsen_pigs\pig_')
        p = p + str(k)
        print(p)

        p1 = p + '\LABELED_DICOM'
        p2 = p + '\MASKS_DICOM'
        p3 = p + '\MESHES_VTK'
        p4 = p + '\PATIENT_DICOM'

        p1 = Path(p1)
        p1.mkdir(parents=True, exist_ok=True)

        dp = io3d.read(f_name)
        output_f = p1 / (f_name.stem + '.mhd')
        io3d.write(dp, output_f)

        p2 = Path(p2)
        p2.mkdir(parents=True, exist_ok=True)

        dp = io3d.read(f_name)
        output_f = p2 / (f_name.stem + '.mhd')
        io3d.write(dp, output_f)

        p3 = Path(p3)
        p3.mkdir(parents=True, exist_ok=True)

        dp = io3d.read(f_name)
        output_f = p3 / (f_name.stem + '.mhd')
        io3d.write(dp, output_f)

        p4 = Path(p4)
        p4.mkdir(parents=True, exist_ok=True)

        dp = io3d.read(f_name)
        output_f = p4 / (f_name.stem + '.mhd')
        io3d.write(dp, output_f)

        #     p4 = Path(p4)
        #     p4.parent.mkdir(parents=True, exist_ok=True)

        k = k + 1
    print(k)

    pass
{'fraction_non_alphanumeric': 0.12903225806451613, 'fraction_numerical': 0.03862478777589134, 'mean_word_length': 2.69435736677116, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4140325', 'n_tokens_mistral': 1053, 'n_tokens_neox': 989, 'n_words': 151}