# Done: This is total bullshit! I need to iterate over all paths and extract the region features individually!

        # Store all feature images in here
        disttransf_images = IPL(
            yaml=yamlfile,
            yamlspec={'path': 'intermedfolder', 'filename': 'locmaxborderfile', 'skeys': {'locmaxbordernames': (2, 3)}},
            recursive_search=True
        )
        feature_images = IPL(
            yaml=yamlfile,
            yamlspec={'path': 'datafolder', 'filename': 'rawdatafile', 'skeys': 'rawdataname'},
            recursive_search=True
        )
        ipl.logging('\nDisttransf images datastructure: \n---\n{}', disttransf_images.datastructure2string(maxdepth=4))
        ipl.logging('\nFeature images datastructure: \n---\n{}', feature_images.datastructure2string(maxdepth=4))
        feature_images.astype(np.float32)
        # features = IPL()
        features = features_of_paths_image_iteration(ipl, disttransf_images, feature_images)

        features.write(filepath=params['intermedfolder'] + params['featurefile'])

        ipl.logging('\nFinal datastructure:\n---\n{}', features.datastructure2string())

        ipl.logging('')
        ipl.stoplogger()

    except ValueError:

        ipl.errout('Unexpected error', traceback)