Пример #1
0
def loadFloatProcessor(filepath, params, scale=True):
    try:
        fp = loadImp(filepath).getProcessor().convertToFloatProcessor()
        # Preprocess images: Gaussian-blur to scale down, then normalize contrast
        if scale:
            fp = Filter.createDownsampled(fp, params["scale"], 0.5, 1.6)
            Util.normalizeContrast(fp)
        return fp
    except:
        syncPrint(sys.exc_info())
Пример #2
0
def loadFloatProcessor(filepath, params, paramsSIFT, scale=True):
    try:
        fp = loadImp(filepath).getProcessor().convertToFloatProcessor()
        # Preprocess images: Gaussian-blur to scale down, then normalize contrast
        if scale:
            fp = Filter.createDownsampled(fp, params["scale"], 0.5,
                                          paramsSIFT.initialSigma)
            Util.normalizeContrast(fp)  # TODO should be outside the if clause?
        return fp
    except:
        syncPrintQ(sys.exc_info())
    options2.multiplierEstimationIterations = 10
    options2.coordinateUpdateRegularizerWeight = 0.1

    if not doXYScale:
        xyScale = 1.0
    
   

    img = imgSource.clone()
    print stackSource.getSize()
    if doXYScale:
        stack = ImageStack(int(round(imgSource.getWidth()*xyScale)), int(round(imgSource.getHeight()*xyScale)))
        for z in xrange(stackSource.getSize()):
            stack.addSlice(Filter.createDownsampled(
                stackSource.getProcessor(z+1),
    	        xyScale,
    	        0.5,
                0.5))
                
             
        img = ImagePlus("", stack)
    else:
        img = imgSource

    width  = img.getWidth()
    height =  img.getHeight()

    # img.show()
    print img.getWidth(), img.getHeight(), img.getStack().getSize()
    for c in correlationRanges:    
        correlationRange = c