def test_enhancement_methods_with_default_params(aorta_image, compare_images, enhance_method, paramid): name = __name__ + '_test_enhancement_methods_with_default_params_' + paramid + '.mha' enhancer = vesselenhancement.vmtkImageVesselEnhancement() enhancer.Image = aorta_image enhancer.Method = enhance_method enhancer.Execute() assert compare_images(enhancer.Image, name) == True
def test_sato_enhancement_with_varied_params(aorta_image, compare_images, alpha1, alpha2, paramid): name = __name__ + '_test_sato_enhancement_with_varied_params_' + paramid + '.mha' enhancer = vesselenhancement.vmtkImageVesselEnhancement() enhancer.Image = aorta_image enhancer.Method = 'sato' enhancer.Alpha1 = alpha1 enhancer.Alpha2 = alpha2 enhancer.Execute() assert compare_images(enhancer.Image, name) == True
def test_frangi_enhancement_with_varied_params(aorta_image, compare_images, scaled, alpha, beta, gamma, paramid): name = __name__ + '_test_frangi_enhancement_with_varied_params_' + paramid + '.mha' enhancer = vesselenhancement.vmtkImageVesselEnhancement() enhancer.Image = aorta_image enhancer.Method = 'frangi' enhancer.ScaledVesselness = scaled enhancer.Alpha = alpha enhancer.Beta = beta enhancer.Gamma = gamma enhancer.Execute() assert compare_images(enhancer.Image, name) == True
def test_ved_enhancement_with_varied_params(aorta_image, compare_images, alpha, beta, gamma, c, timestep, epsilon, wstrength, sensitivity, numiterations, numdiffusioniterations, paramid): name = __name__ + '_test_ved_enhancement_with_varied_params_' + paramid + '.mha' enhancer = vesselenhancement.vmtkImageVesselEnhancement() enhancer.Image = aorta_image enhancer.Method = 'ved' enhancer.Alpha = alpha enhancer.Beta = beta enhancer.Gamma = gamma enhancer.C = c enhancer.TimeStep = timestep enhancer.Epsilon = epsilon enhancer.WStrength = wstrength enhancer.Sensitivity = sensitivity enhancer.NumberOfIterations = numiterations enhancer.NumberOfDiffusionSubIterations = numdiffusioniterations enhancer.Execute() assert compare_images(enhancer.Image, name, tolerance=1.0) == True
def imageFeature(): input_datadir = 'C:/Users/chenjiaxing/Desktop/CT-Data/png/WU_Lung_Vessel_Ext/' reader = imagereader.vmtkImageReader() # 图像序 filelist = os.listdir(input_datadir) reader.InputFilePrefix = input_datadir reader.InputFilePattern = "%s%d.png" reader.DataExtent = [0, 512, 0, 512, 1, len(filelist)] reader.Format = "png" reader.UseITKIO = 0 reader.Execute() imageVesselEnhance = imagevesseEnhance.vmtkImageVesselEnhancement() imageVesselEnhance.Image = reader.Image imageVesselEnhance.Method = "vedm" #["frangi","sato","ved","vedm"] imageVesselEnhance.SigmaStepMethod = "equispaced" #["equispaced","logarithmic"] imageVesselEnhance.Execute() viewer = imageviewer.vmtkImageViewer() viewer.Image = imageVesselEnhance.Image viewer.Execute()