Ejemplo n.º 1
0
def test_otsu_image_256_histogram_bins(aorta_image, compare_images):
    name = __name__ + '_test_otsu_image_256_histogram_bins.mha'
    otsuer = otsu.vmtkImageOtsuThresholds()
    otsuer.Image = aorta_image
    otsuer.NumberOfHistogramBins = 256
    otsuer.Execute()

    assert compare_images(otsuer.Image, name) == True
Ejemplo n.º 2
0
def test_otsu_image_multiple_thresholds(aorta_image, compare_images, thresholds, paramid):
    name = __name__ + '_test_otsu_image_multiple_thresholds_' + paramid + '.mha'
    otsuer = otsu.vmtkImageOtsuThresholds()
    otsuer.Image = aorta_image
    otsuer.NumberOfThresholds = thresholds
    otsuer.Execute()

    assert compare_images(otsuer.Image, name) == True
Ejemplo n.º 3
0
def test_otsu_image_256_histogram_bins(aorta_image, compare_images):
    name = __name__ + '_test_otsu_image_256_histogram_bins.mha'
    otsuer = otsu.vmtkImageOtsuThresholds()
    otsuer.Image = aorta_image
    otsuer.NumberOfHistogramBins = 256
    otsuer.Execute()

    assert compare_images(otsuer.Image, name) == True
Ejemplo n.º 4
0
def test_otsu_image_multiple_thresholds(aorta_image, compare_images, thresholds, paramid):
    name = __name__ + '_test_otsu_image_multiple_thresholds_' + paramid + '.mha'
    otsuer = otsu.vmtkImageOtsuThresholds()
    otsuer.Image = aorta_image
    otsuer.NumberOfThresholds = thresholds
    otsuer.Execute()

    assert compare_images(otsuer.Image, name) == True
Ejemplo n.º 5
0
def ostsuerThreshold():
    input_datadir = 'C:/Users/chenjiaxing/Desktop/CT-Data/png/Spine_Bone_Ext/'
    reader = imagereader.vmtkImageReader()

    # 单幅图像
    # reader.InputFileName = os.path.join(input_datadir, '170.png')

    # 图像序列
    reader.InputFilePrefix = input_datadir
    reader.InputFilePattern = "%s%d.png"
    reader.DataExtent = [0, 512, 0, 512, 1, 188]
    reader.Format = "png"
    reader.UseITKIO = 0
    reader.Execute()

    otsuer = otsu.vmtkImageOtsuThresholds()
    otsuer.Image = reader.Image
    otsuer.NumberOfThresholds = 2
    otsuer.Execute()

    viewer = imageviewer.vmtkImageViewer()
    viewer.Image = otsuer.Image
    viewer.Execute()