Beispiel #1
0
def get_image_bandpass(request):
    """
    Function to get the computing image with a fourier filter applied
    """
    imagePath = request.GET.get('image', None)
    lowFreq = request.GET.get('lowFreq', 0.)
    highFreq = request.GET.get('highFreq', 1.0)
    decay = request.GET.get('decayFreq', 0.)
    dim = request.GET.get('dim', None)
    
#    ** DEBUG **
#    print str(imagePath)
#    print float(lowFreq)
#    print float(highFreq)
#    print float(decay)
#    print int(dim)
    
    # create a xmipp image empty
    imgXmipp = xmipp.Image()
    
    # compute the Fourier Filter in the image
    xmipp.bandPassFilter(imgXmipp, str(imagePath), float(lowFreq), float(highFreq), float(decay), int(dim))
    
    # from PIL import Image
    img = getPILImage(imgXmipp, dim)
        
    response = HttpResponse(mimetype="image/png")
    img.save(response, "PNG")
    
    return response
Beispiel #2
0
 def _computeRightPreview(self):
     """ This function should compute the right preview
     using the self.lastObj that was selected
     """
     from pyworkflow.em.packages.xmipp3.convert import getImageLocation
     xmipp.bandPassFilter(self.rightImage, getImageLocation(self.lastObj),
                          self.getLowFreq(), self.getHighFreq(),
                          self.getFreqDecay(), self.dim)
Beispiel #3
0
 def _computeRightPreview(self):
     """ This function should compute the right preview
     using the self.lastObj that was selected
     """
     from pyworkflow.em.packages.xmipp3.convert import getImageLocation
     xmipp.bandPassFilter(self.rightImage, getImageLocation(self.lastObj),
                          self.getLowFreq(), self.getHighFreq(),
                          self.getFreqDecay(), self.dim)