Skip to main content

napari-melt-pool-tracker

Developed by the EPFL Center for Imaging for the Thermomechanical Metallurgy Laboratory in Sep 2023. Plugin for tracking the width and depth of the melt pool and keyhole in x-ray images of laser powder bed fusion experiments.

License BSD-3 PyPI Python Version tests codecov napari hub DOI


Installation

You can install napari-melt-pool-tracker via pip:

pip install napari-melt-pool-tracker

Getting Started with napari-melt-pool-tracker

Reading Data

  • The napari-melt-pool-tracker plugin can read h5 files from the ID19 and TOMCAT beam lines.
  • When opening an h5 file in napari, select the "Melt Pool Tracker" as the reader for the mentioned beamlines.
  • Once the data is loaded, you have the option to save the layer as a tif file if needed.

Pre-processing

  • For large images, it is recommended to crop them in both time and space to include only the relevant parts of the image stack.

1. Determine Laser Speed and Position

  • This step helps identify the laser in the images for later reslicing the stack with a moving window following the laser.
  • It generates a projection of the stack along the y-axis, creating an x-t image where the laser's position appears as an oblique line in the projection.

To perform this step:

  1. Select the stack you want to work on using the "Input" drop-down menu.
  2. Choose one of three projection modes:
    • Default: Maximum projection along y.
    • Pre mean: Divide each frame by the mean projection along the t-axis (to remove background) and then perform a maximum projection along y.
    • Post median: Perform a maximum projection along y and then divide the projected images by a median-filtered version in the x-direction (to remove horizontal strips).
  3. Click "Run" to generate a new layer with the projected image and a shapes layer with a line.
  4. Select the line layer, use the "Select vertices" tool to match the line with the laser in the projected image.

2. Reslice with Moving Window

  • This step reslices the stack with a moving window that follows the laser's position.

To perform this step:

  1. Select the input stack using the "Stack" drop-down menu.
  2. Choose the line layer with the laser's position using the "Line" drop-down menu.
  3. Adjust the "Left margin" and "Right margin" sliders to set the size of the window to the left and right of the laser's position.
  4. Click "Run" to create three new layers: a resliced stack, a shapes layer indicating the laser's position based on your previous annotation, and a shapes layer with lines indicating the window's position in the original image.
  5. If the window size doesn't fit the melt pool correctly, adjust it using the margin sliders. Disable the "Auto run" checkbox for large stacks to control when reslicing occurs.

3. Filter Image

  • This step aims to reduce noise in the images by applying a median filter.

To filter the image:

  • Select the resliced layer as the input.
  • Use the "Kernel" sliders to set the size of the median filter along different axes.
  • Disable "Auto run" for large stacks due to the computational cost. After median filtering, the function applies Otsu thresholding to remove the background. Adjust the contrast as needed.

4. Calculate Radial Gradient

  • This step calculates the gray value gradient in the radial direction with respect to a point on the surface, forming the origin. You can set the horizontal position of the origin using the position slider.

To calculate the radial gradient:

  • Select the resliced and filtered stack as input.
  • Adjust the contrast for the new radial gradient layer.

5. Annotate

To annotate points:

  • Select any of the resliced layers as your reference image.
  • Change the name in the "Name of the tracked point" text box to define the point you want to track, e.g., 'MP depth'.
  • Click "Add new layer" to create a new points layer with the specified name, automatically selected as the active layer.
  • Start tracking by pressing 't' on your keyboard. Enable "Auto play when tracking is started" for automatic playback.
  • Adjust playback parameters as needed. Setting "Loop mode" to 'once' is advised to prevent overwriting tracked points. You can track points manually by scrolling through slices/frames (hold down ctrl) and saving your cursor positions at each index change.

Saving and Processing Results

  • You can save the 'window_coordinates' layer and point layers with tracked points as CSV files for further processing with external software.

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the BSD-3 license, "napari-melt-pool-tracker" is free and open source software

Issues

If you encounter any problems, please [file an issue] along with a detailed description.

Metadata

Release files for napari-melt-pool-tracker 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for napari-melt-pool-tracker 0.1.3
File Size Uploaded Provenance Actions
napari_melt_pool_tracker-0.1.3.tar.gz 13.9 MB Without provenance Details for napari_melt_pool_tracker-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for napari-melt-pool-tracker 0.1.3
File Interpreter ABI Platform Actions
napari_melt_pool_tracker-0.1.3-py3-none-any.whl Python 3 none any Details for napari_melt_pool_tracker-0.1.3-py3-none-any.whl

Total release size: 27.9 MB

Release files / napari_melt_pool_tracker-0.1.3.tar.gz

Download URL napari_melt_pool_tracker-0.1.3.tar.gz
Size 13.9 MB
Tags Source
SHA-256 checksum
How to use checksums
947f80d0968f7b521527513a48aa1caa9c518ec42a33129990c03730e71d06cc
BLAKE2b-256 checksum
How to use checksums
52fbc0c46507b39c1d37e3905fc30902c49cb02940fdc8db00fb9f4c5c864401
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / napari_melt_pool_tracker-0.1.3-py3-none-any.whl

Download URL napari_melt_pool_tracker-0.1.3-py3-none-any.whl
Size 14.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
84f72df2c2a64de87a9894187075596007299c70b53e030c123d6312ec1e2676
BLAKE2b-256 checksum
How to use checksums
fa37b2b0ac19acb6370103bcfab99a29eaa6a8ade7fda151de10a1623e959d28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Security for napari-melt-pool-tracker 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page