Plugin for tracking the width and depth of the melt pool and keyhole in x-ray images of laser powder bed fusion experiments.
Project description
napari-melt-pool-tracker
Plugin for tracking the width and depth of the melt pool and keyhole in x-ray images of laser powder bed fusion experiments.
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:
- Select the stack you want to work on using the "Input" drop-down menu.
- 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).
- Click "Run" to generate a new layer with the projected image and a shapes layer with a line.
- 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:
- Select the input stack using the "Stack" drop-down menu.
- Choose the line layer with the laser's position using the "Line" drop-down menu.
- 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.
- 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.
- 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
- Annotation of points is done using the napari-cursor-tracker plugin.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file napari-melt-pool-tracker-0.1.1.tar.gz
.
File metadata
- Download URL: napari-melt-pool-tracker-0.1.1.tar.gz
- Upload date:
- Size: 13.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8202ef2c0def0727094255adff0a53d548b97ec6d682e23b0d9ba04553d57871 |
|
MD5 | 278e4ee67f2c8546217e7204a2fb1be6 |
|
BLAKE2b-256 | f76691a66b2ec9d0fdb288abfa6d849d26226f8a517e874b1c3e042574f7e6f5 |
File details
Details for the file napari_melt_pool_tracker-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: napari_melt_pool_tracker-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71a1c1fd64fb26881c2516aeb170cc744c37a442bd08ec918dcdec68a80c0c90 |
|
MD5 | ea452e94f7bbd84157c7fdcbb464b577 |
|
BLAKE2b-256 | 060552076647756526c7db340831fd0004f22339687ca252ffa64cf98385270d |