Image windowing ("Tukey"-type) with DC-removal

Good day,

as a consequence of repeated requests (most recent), I’ve released a macro-recordable ImageJ-plugin for image windowing and DC-removal.

The plugin is DCfree_Windowing.class and can be accessed from here:

The plugin requires a square-sized 32bit image of even side length and applies to it a disc-shaped window (diameter = image size) with a raised cosine slope (“Tukey”-type window). The percentage flat of the disc can be set from 0% (“von Hann”-type window) to 100% (hard-limiting window).

The mean of the windowed image values inside the window is then reduced to negligible values. All values outside the window remain zero. The reduction factor is typically better than 10^8. This kind of DC-removal of windowed images doesn’t cause any artifacts (jumps, ridges) or level shifts and can hardly be obtained by other methods.

Here is an example using a unipolar zone plate as a test image:
Please note that black is 0.0 and white is 1.0.

Please note that now black is –0.5 and white is +0.5.
The percentage flat of the window was set to 75%.

Here are the measurements from both images (no selection applied!):

I hope the plugin proves useful at least for those looking for professional-grade global/regional orientation analyses.




Thanks @anon96376101 for making your plugin accessible for others!

Would you also be willing to share the source code under a permissive license? In the download, I only see the class file.

1 Like

Good day Jan!

Would you also be willing to share the source code under a permissive license?

Sorry, for good reasons, no.
(The code is the property of my company as is the code of all of my ImageJ-plugins.)

In the download, I only see the class file.

In my post I honestly wrote

The plugin is DCfree_Windowing.class […]

i.e. no mention of the Java-source.



Hi Herbie. Your DC removal macro is a great way to window for FFTs. It suppresses edge artefacts well, and it completely removes the zeroith order (see black pixel at center). Kudos.

What other uses did you have in mind for it?


Good day,

of course you are right in the first place!

However, the main reason for a combination of windowing and DC-removal was/is a different one. It is explained in detail in my report about professional-grade global/regional orientation analyses .

In short:

  1. There are three mathematically identical approaches to global/regional orientation analyses. Two of them require Fourier-transformations (FT) and on is based on image projections.
  2. The report essentially deals with computational differences of the three approaches.
  3. As you know, windowing is one way to avoid FT-artifacts caused by the image borders, mirroring is another but it is unsuited for orientation analyses because it may lead to oriented ridges.
  4. DC-removal leads to much more pronounced orientation results and doesn’t hurt the signal of interest.
  5. DC-removal is easily performed by blocking the central component in the Fourier-spectral domain but it cannot be used if a FT-step isn’t involved which is the case for the third approach.
  6. Taken together, in order to compare the three approaches under the same conditions, I’ve needed a common pre-processing. DCfree_Windowing.class was conceptualized for this purpose.
  7. During my investigations I realized that DC-removal in the spatial domain is advantageous compared to DC-blocking in the Fourier-spectral domain. At least I see no way with the latter approach to obtain the high quality result of the former.



I’d love to read your report, but the link just comes back to this post. Would you please send it to me via this post, or at



Dear Ron,

are you sure the zipped PDF “” didn’t directly download to your download-folder?

It does for me.



Hi! Thanks a lot for the great plugin!
How should it be cited if one wishes to use it for research purpose?
Which paper is the windowing based on?
Also, I read that it also incorporates some DC-removal. If I understood correctly, this has to do with the average of a periodic signal not being zero, but I do not fully understand why you should get a bias from it, since it does not influence the periodicity of the other features… Do you just subtract the average to get rid of it or do you do something else. Any reference paper/text would be great.

Would you please contact the originator of the plugin at He will be glad to help you. He is unable to respond on this site.

Ron DeSpain