예제 #1
0
pgm3  = "/mnt/CLAWS1/tbeier/tmp/gm3.h5"

if True:
    data = vigra.readHDF5(path, 'data')[0:250,0:255,0:255].astype(numpy.float32)





##########################
# compute non local mean # 
##########################
if False:
    print "non local mean"
    policy = denoising.RatioPolicy(sigma=2.0, meanRatio=0.90, varRatio=0.80)
    res = denoising.nonLocalMean(image=data, policy=policy, patchRadius=2, searchRadius=7, sigmaSpatial=2.0,
                           sigmaPresmoothing=1.0, stepSize=2, iterations=1, verbose=True)
    vigra.impex.writeHDF5(res, pnlm, 'data')

if True:
    print "non local mean"
    policy = denoising.RatioPolicy(sigma=2.0, meanRatio=0.90, varRatio=0.80)
    res = denoising.nonLocalMean(image=data, policy=policy, patchRadius=2, searchRadius=14, sigmaSpatial=1.5,
                           sigmaPresmoothing=1.0, stepSize=2, iterations=1, verbose=True)
    vigra.impex.writeHDF5(res, pnlm2, 'data')

######################
# compute tv bregman #
######################
if False:
    print "tvBregman isotropic"
    res = denoising.tvBregman(data,weight=2.0, isotropic=True)
예제 #2
0
policy = denoising.RatioPolicy(sigma=1.0, meanRatio=0.95, varRatio=0.8)
nlmp = dict(image=data,
            policy=policy,
            patchRadius=2,
            searchRadius=70,
            sigmaSpatial=2.0,
            sigmaPresmoothing=1.3,
            stepSize=2,
            iterations=1,
            verbose=True,
            nThreads=17)

if False:

    print "non truncated"
    smoothed = denoising.nonLocalMean(wTruncate=0.0, **nlmp)
    vigra.impex.writeHDF5(smoothed, sPath, 'data')

if False:

    print "truncated"
    smoothedT = denoising.nonLocalMean(wTruncate=0.15, **nlmp)
    vigra.impex.writeHDF5(smoothedT, stPath, 'data')

if False:
    data = data.astype(numpy.float32)
    ew = vigra.filters.hessianOfGaussianEigenvalues(data, 4.0)
    ew = numpy.sort(ew, axis=3)[:, :, :, 2]
    vigra.impex.writeHDF5(ew, ewPath, 'data')

if False:
예제 #3
0
lssPath = "/mnt/CLAWS1/tbeier/data/stack_with_holes/labelsSS.h5"
ewPath    = "/mnt/CLAWS1/tbeier/data/stack_with_holes/ew.h5"
ewsPath    = "/mnt/CLAWS1/tbeier/data/stack_with_holes/ews.h5"
ewssPath    = "/mnt/CLAWS1/tbeier/data/stack_with_holes/ewss.h5"


data = vigra.readHDF5(path, 'data')[0:600,0:600,0:100].astype(numpy.float64)

policy = denoising.RatioPolicy(sigma=1.0, meanRatio=0.95, varRatio=0.8)
nlmp = dict(image=data, policy=policy, patchRadius=2, searchRadius=70, sigmaSpatial=2.0,
            sigmaPresmoothing=1.3, stepSize=2, iterations=1, verbose=True, nThreads=17)

if False:

    print "non truncated"
    smoothed = denoising.nonLocalMean(wTruncate=0.0,**nlmp)
    vigra.impex.writeHDF5(smoothed, sPath, 'data')

if False:

    print "truncated"
    smoothedT = denoising.nonLocalMean(wTruncate=0.15,**nlmp)
    vigra.impex.writeHDF5(smoothedT, stPath, 'data')






if False:
    data=data.astype(numpy.float32)