Пример #1
0
        print "Segmentation finished with", str(col_length), "samples in", \
        str(end_time - start_time), "seconds."

        return segmented


#----------------------------------------------------------------------------------

if __name__ == '__main__':
    import sys, os

    sys.path.insert(0, os.path.abspath('../'))

    from integration.file_loader import FileLoader

    loader = FileLoader()
    file_path = os.path.dirname('../')+'/samples/4/sample_20.dcm'

    segmentation = Segmentation()
    img_org = loader.single_dicom_read(file_path)
    img_temporal = img_org.copy()  # Copy of the image to process

    img_seg = segmentation.clasify(img_org)  # Segment original image

    # Reduce img_temporal (avoid manipulation of the variable)
    img_red = segmentation.reduction(img_temporal)

    red_seg = segmentation.clasify(img_red)  # Segment reduced image

    segmentation.view(img_org, img_seg, red_seg)  # Show results