Hello Ajay,

Using the Gabor filter script you can try to enhance the horizontal structures in your image. You just need a bit of patience to find the right parameters. Have a look at the following results I obtained from your image using `sigma`

= 9, `gamma`

= 0.25, `psi`

= 0, `Fx`

= 2.0, `nAngles`

= 10 and a filter size of 51x51:

Here you are the exact script I used, which is a faster version than the one on the site since it uses FFT:

```
import net.imglib2.img.ImagePlusAdapter;
import net.imglib2.img.Img;
import net.imglib2.img.display.imagej.ImageJFunctions;
import net.imglib2.type.numeric.real.FloatType;
import net.imglib2.algorithm.fft2.FFTConvolution;
import ij.*;
import ij.process.*;
import ij.plugin.filter.*;
import ij.plugin.ContrastEnhancer;
import ij.plugin.ZProjector;
/**
* This script calculates a set of Gabor filters over the selected image.
*
* Parameters: sigma, gamma, psi, Fx, nAngles
*/
start = System.currentTimeMillis();
// Sigma defining the size of the Gaussian envelope
sigma = 9;
// Aspect ratio of the Gaussian curves
gamma = 0.25;
// Phase
psi = Math.PI / 4.0 * 0;
// Frequency of the sinusoidal component
Fx = 2.0;
// Number of diferent orientation angles to use
nAngles = 10;
// copy original image and transform it to 32 bit
originalImage = IJ.getImage();
originalImage = new ImagePlus(originalImage.getTitle(), originalImage.getProcessor().convertToFloat());
width = originalImage.getWidth();
height = originalImage.getHeight();
// Apply aspect ratio to the Gaussian curves
sigma_x = sigma;
sigma_y = sigma / gamma;
// Decide size of the filters based on the sigma
largerSigma = (sigma_x > sigma_y) ? (int) sigma_x : (int) sigma_y;
if(largerSigma < 1)
largerSigma = 1;
ip = originalImage.getProcessor().duplicate();
sigma_x2 = sigma_x * sigma_x;
sigma_y2 = sigma_y * sigma_y;
// Create set of filters
filterSizeX = 51; //6 * largerSigma + 1;
filterSizeY = 51; //6 * largerSigma + 1;
middleX = (int) Math.round(filterSizeX / 2);
middleY = (int) Math.round(filterSizeY / 2);
is = new ImageStack(width, height);
kernels = new ImageStack(filterSizeX, filterSizeY);
rotationAngle = Math.PI/(double)nAngles;
// Rotate kernel from 0 to 180 degrees
for (i=0; i<nAngles; i++)
{
theta = rotationAngle * i;
filter = new FloatProcessor(filterSizeX, filterSizeY);
for (int x=-middleX; x<=middleX; x++)
{
for (int y=-middleY; y<=middleY; y++)
{
xPrime = (double)x * Math.cos(theta) + (double)y * Math.sin(theta);
yPrime = (double)y * Math.cos(theta) - (double)x * Math.sin(theta);
a = 1.0 / ( 2.0 * Math.PI * sigma_x * sigma_y ) * Math.exp(-0.5 * (xPrime*xPrime / sigma_x2 + yPrime*yPrime / sigma_y2) );
c = Math.cos( 2.0 * Math.PI * (Fx * xPrime) / filterSizeX + psi);
filter.setf(x+middleX, y+middleY, (float)(a*c) );
}
}
kernels.addSlice("kernel angle = " + theta, filter);
}
// Show kernels
ip_kernels = new ImagePlus("kernels", kernels);
ip_kernels.show();
// Apply kernels
for (i=0; i<nAngles; i++)
{
ip2 = originalImage.duplicate();
kernel = ImagePlusAdapter.wrap( new ImagePlus("", kernels.getProcessor( i+1 )) );
image2 = ImagePlusAdapter.wrap( ip2 );
c = new FFTConvolution( image2, kernel );
c.convolve();
ip2 = ImageJFunctions.wrap( image2, "" );
is.addSlice("gabor angle = " + (180.0/nAngles*i), ip2.getProcessor() );
}
// Normalize filtered stack (it seems necessary to have proper results)
c = new ContrastEnhancer();
for(int i=1 ; i <= is.getSize(); i++)
{
c.stretchHistogram(is.getProcessor(i), 0.4);
}
projectStack = new ImagePlus("filtered stack",is);
IJ.run(projectStack, "Enhance Contrast", "saturated=0.4 normalize normalize_all");
resultStack = new ImageStack(width, height);
zp = new ZProjector(projectStack);
zp.setStopSlice(is.getSize());
for (int i=0;i<=5; i++)
{
zp.setMethod(i);
zp.doProjection();
resultStack.addSlice("Gabor_" + i
+"_"+sigma+"_" + gamma + "_"+ (int) (psi / (Math.PI/4) ) +"_"+Fx,
zp.getProjection().getChannelProcessor());
}
// Display filtered images
(new ImagePlus("Gabor, sigma="+sigma+" gamma="+gamma+ " psi="+psi, is)).show();
result= new ImagePlus ("Gabor stack projections", resultStack) ;
IJ.run(result, "Enhance Contrast", "saturated=0.4 normalize normalize_all");
result.show();
end = System.currentTimeMillis();
IJ.log( "Gabor filter took " + (end-start) + "ms" );
```