The analysis was done entirely using the core FIJI functions (as long as you use the 3D Object counter for the segmentation rather than the classic watershed).

I just drew the mask by hand. Itās simply an 8 pixel wide rectangle centered on the origin, with a 2x2 square at the origin to preserve the DC compenent (i.e keep the image birghtfield).

I then made a new image to store the rotations of the mask and ran the following code to create the rotation stack:

```
for(a=1; a<=180; a++){
selectWindow("FFT Mask.tif");
run("Duplicate...", "title=1");
selectWindow("1");
run("Rotate... ", "angle=" + a + " grid=1 interpolation=None");
run("Select All");
run("Copy");
run("Select None");
close("1");
selectWindow("FFT Mask stack");
setSlice(a);
run("Paste");
run("Select None");
}
```

I then made another stack to store the filtered images, and then ran the following code to crop the mask from the FFT of the original image in 1 degree increments and then store the inverse FFT:

```
setBatchMode(true);
for(a=1; a<=180; a++){
selectWindow("Clipboard.tif");
run("FFT");
selectWindow("FFT Mask stack.tif");
run("Select None");
setSlice(a);
run("Create Selection");
selectWindow("FFT of Clipboard.tif");
run("Restore Selection");
run("Clear Outside");
run("Select None");
run("Inverse FFT");
close("FFT of Clipboard.tif");
selectWindow("Inverse FFT of Clipboard.tif");
run("Select All");
run("Copy");
selectWindow("Filtered stack");
setSlice(a);
run("Paste");
run("Select None");
close("Inverse FFT of Clipboard.tif");
}
setBatchMode("exit and display");
```

The FFT filtering made the slices vary somewhat in intensity, so I normalized the intensity of each slice using the median intensity:

```
median = newArray(180);
for(a=1; a<=180; a++){
selectWindow("Filtered stack.tif");
setSlice(a);
List.setMeasurements;
median[a-1] = List.get("Median");
}
Array.getStatistics(dummy, dummy, dummy, mean, dummy);
for(a=1; a<=180; a++){
selectWindow("Filtered stack.tif");
setSlice(a);
run("Multiply...", "value=" + mean/median[a-1] + " slice");
}
```

The last steps described in the original method were done by hand, but they could easily be recorded and implemented as a macro.

The two tuneable parameters are the width of the mask, and the threshold. The thinner the mask, the filter will become more stringent towards thinner lines. It may be possible to use an autothreshold to automatically threshold the image, but I found it much easier to just do by eye, by moving the threshold until suppressed lines at the corresponding angle were completely removed. The threshold holds true for all angles if the stack has been normalized (See above), so you simply set the threshold for the first slice, and then apply it to the whole stack.

To measure length and angle, I would use the results table from the 3D objects counter to crop the stack to just the bounding box that contains the line of interest. Then I would use

process->Math->Macro to get the line I want based on intensity (i.e. its numerical identifier from the segmentation). I would then create a maximum intensity projection, and then use the particle analyzer to get whatever parameters I was interested in about the line.

Hope this helps,

Ben Smith