Skip to content

jianglab/WebCalEM

Repository files navigation

WebCalEM: TEM Magnification Calibration

WebCalEM is a browser-based TEM magnification calibration tool. It loads test specimen images, lets you select image regions, computes FFT/radial profiles in the browser, and exports measurement and statistics results.

Launch

Open the hosted app: WebCalEM on GitHub Pages

For local development or offline testing, first clone the repo:

git clone https://github.com/jianglab/WebCalEM.git
cd WebCalEM

Then serve the repo folder with:

python -m http.server 8766

Then open:

http://127.0.0.1:8766/

The app is contained in index.html. The local server only serves static files; you do not need to install the old Python app dependencies. Plotly and MathJax are bundled in vendor/, so local plotting and equation hints work without internet access. You can also download the repo as a ZIP, unzip it, open a terminal in that folder, and run the same python -m http.server 8766 command.

Avoid launching by double-clicking index.html for offline use. Browsers block automatic loading of bundled local image paths from file:// pages, so use the local server command above or switch to Upload and click Browse.

Basic Workflow

  1. Load an image from the URL box or switch to Upload and click Browse.
  2. Choose the specimen lattice spacing from Specimen, or use Custom.
  3. Set the nominal pixel size in Nominal (A/px).
  4. Drag a region on the Original Image panel. FFT and radial analysis update after the drag finishes.
  5. Use 1D Radial Profile for radial peak picking, or 2D Spectrum for FFT peak/ellipse correction.
  6. Review the Pixel Size result and click Add to Table.
  7. Use the Measurements and Statistics section to review rows, group summaries, and scatter statistics.
  8. Click Download Results to export the measurements CSV, grouped statistics CSV, and statistics plot PNG.

Navigation Tips

  • Hover over controls, images, plots, and table cells for contextual hints and preview snapshots.
  • Drag a box on Plotly plots to zoom. Use the modebar, wheel zoom, pan, and reset controls as needed.
  • Click a row in the Measurements table to reload its saved image region for manual correction, then click Update Row.
  • Use Autosample with Upload mode to sample multiple regions per image. Set Regions and Region size, then click Start.
  • The Autocorrect checkbox snaps 1D clicks to nearby local maxima and 2D clicks to the brightest pixel in a small window.
  • Resize splitters between panels to allocate more space to the image, FFT analysis, or statistics areas.

Test Data

The test_image folder includes sample TIFF images for quick validation. The default image path in the app points to test_image/130k-Pixel0.75A.tiff, a graphene test image with a nominal pixel size around 0.75 A/px.

Notes

  • Computation runs client-side in the browser; large regions and large FFT grids can be memory-intensive.
  • URL images are fetched by the browser. Remote links must allow browser fetches/CORS; if a JPEG link fails, download it and use Upload or serve it from the same local folder.
  • TIFF and MRC parsing are intentionally lightweight and may not cover every microscopy file variant.

About

This app helps calibrate electron microscopes by analyzing test specimen images. It calculates the pixel size (Angstroms/pixel) by measuring diffraction patterns from known specimens like graphene, gold, or ice.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors