Wavelet hidden Markov model denoising

Wavelet hidden Markov model (WHMM) denoising is a noise reduction method for electron holography using dual-tree complex wavelet transform and hidden Markov models. A hidden state is assigned to each pixel considering the magnitude of the wavelet coefficients and transition probabilities between wavelet levels. The denoised image is obtained by suppressing wavelet coefficients considering the assigned hidden state and then by performing the inverse wavelet transform.


Windows OS only

  • Download the zip file(include windows binary files checked windows defender).
  • Unzip the downloaded file.
  • Install Matlab 2017a 64bit runtime from Mathworks.com
  • Install DigitalMicrograph from Gatan, Inc.

File structure

The main folder includes the following files.

  • main_new_real.exe: denoise program for a real image
  • main_new_complex.exe: denoise program for a complex image
  • ExecMyCmd_real.s: Script to run main_new_real.exe on DigitalMicrograph
  • ExecMyCmd_complex.s: Script to run main_new_complex.exe on DigitalMicrograph
  • holo0001.dm4: an example image for real-part denoising
  • parameters_holo0001.json: an example setup file for real-part denoising
  • parameters_complex.json: an example setup file for complex denoising (without image)


Show execution examples for a hologrram (real-part only) in DigitalMicrograph.

  1. Open the target file (holo0001.dm4) and the script file (ExecMyCmd_real.s) with DigitalMicrograph.
  2. Give “working_dict” the path of the script folder in ExecMyCmd_real.s.
  3. Give “”WorkingDirectory” the path the script folder in parameters_holo0001.json.
  4. Press the “Execute” button.
  5. When the execution is completed, the noise reduced image named “denoise_01.tif” is generated in the specified working directory.

When applying to complex data obtained by Fourier-based phase reconstruction, use ExecMyCmd_complex.s instead of ExecMyCmd_real.s. Noise-reduced images for the real and imaginary parts are generated as separate images.


The json file specifies parameters for noise reduction. The meaning of each parameter is as follows.

  • “WorkingDirectory”: folder path containing scripts and binary programs.
  • “InputImageName”: input file name (without path)
  • “OutputImageBasename”: output file basename (slice number added)
  • “_comment”: description for this json file (no impact on results)
  • “HMM_ConvergenceThreshold”: target convergence value in estimating hidden Markov parameters
  • “HMM_MaxIteration”: maximum number of iterations for hidden Markov parameter estimation
  • “WaveletLevel”: the number of wavelet transforms
  • “NoiseLevel”: noise strength in the input image. The higher the value, the stronger the denoising.
  • “SliceNum”: the number of slices to apply noise reduction
  • “DumpFile”: log file name

Citing us

  author = {Ryotaro Aso  and Hajime Hojo  and Yoshio Takahashi  and Tetsuya Akashi  and Yoshihiro Midoh  and Fumiaki Ichihashi  and Hiroshi Nakajima  and Takehiro Tamaoka  and Kunio Yubuta  and Hiroshi Nakanishi  and Hisahiro Einaga  and Toshiaki Tanigaki  and Hiroyuki Shinada  and Yasukazu Murakami },
  title = {Direct identification of the charge state in a single platinum nanoparticle on titanium oxide},
  journal = {Science},
  volume = {378},
  number = {6616},
  pages = {202-206},
  year = {2022},
  doi = {10.1126/science.abq5868},
  URL = {https://www.science.org/doi/abs/10.1126/science.abq5868}
  title={Accuracy improvement of phase estimation in electron holography using noise reduction methods},
  author={Midoh, Yoshihiro and Nakamae, Koji},
  publisher={Oxford University Press}


This work was supported by CREST, JST, Japan (Grant No.JPMJCR1664).