fftdm-scriptimagefilterbandpass-filter

How to Apply Band Pass Filter to a 3D Stack in DigitalMicrograph


In Gatan software, I found that the Band Pass Filter in Process Image can only be applied to a single 2D image or a specific frame of a 3D image. My dataset is a 3D stack (multiple frames), and I need to apply the Band Pass Filter to each frame automatically. Is there a recommended script or specific steps to automate this process for the entire 3D stack? bandpass filter I have tried applying the filter manually, but it is extremely inefficient.


Solution

  • Do something like this:

    image img := getFrontImage()
    
    number sx = img.ImageGetDimensionSize(0)
    number sy = img.ImageGetDimensionSize(1)
    number sz = img.ImageGetDimensionSize(2)
    
    for(number i=0;i<sz;;i++){
        image plane := img.slice2(0,0,i,0,sx,1,1,sy,1)
        
        // Do change plane however you want, f.e.
        plane = plane.IFMApplyFilter("Bandpass (default)")
    
    }