Esempio n. 1
0
    # merge revisions
    if processing['rev_merge'] == 2:
        print('=== Merge revision ===')
        # get revs from ID
        revs_to_merge = ImageHandler.get_revs_by_expnum(
            ImageHandler.extract_expnum_from_ID(selected_info['ID'])
        )

        # go through and merge revs with parent
        seg = Segmentation(selected_info)
        seg.load()

        # merge
        for rev_info in revs_to_merge:
            print(rev_info['ID'])
            seg.merge_parent_with_rev(rev_info)

        # save merge
        seg.save_merge_segmentation()

        seg.save()
        del(seg)

    # playground
    if processing['playground'] == 1:
        seg = Segmentation(selected_info)
        seg.load()

        """
        print('TEST LOCAL DENSITY')
        density_map = np.zeros_like(seg.stacks.lamin[0])
Esempio n. 2
0
# import classes
from storage.image import ImageHandler
from processing.segmentation import Segmentation

# load image infos
image_infos = ImageHandler.load_image_infos()

revs_to_merge = list()

# apply defined filters to images
for image_info in image_infos:
    # revision? then skip
    if Segmentation.is_revision_by_ID(image_info['ID']):
        revs_to_merge.append(Segmentation.extract_rev_from_ID(image_info['ID']))
    else:
        # initialise segmentation
        segmentation = Segmentation(image_info)

        # load results
        segmentation.load()

        # merge
        for rev in revs_to_merge:
            segmentation.merge_parent_with_rev(rev)

        # save merge
        segmentation.save_merge_segmentation()

        # reset revs to merge
        revs_to_merge = list()