A service to poll a folder and publish the latest image.
There are unfortunately detectors out there without and SDK that allows creative integration into a control system. A workaround is to implement a webservice that can serve the control system with the latest image when the acquisition is triggered.
This approach requires that the detector can be set in a stream to disk mode that contiuously write images to a specified location.
The current script is a raw prototype from ChatGPT and still needs some polishing. It is however a good starting point for the evaluation.
The code is supported by the pixi python manager. The package manager must be installed before starting. Go to pixi.sh for installation instuctions.
git clone https://github.com/neutronimaging/DetectorPoller.gitEnter the repository folder
cd DetectorPollerInstall the pixi environment
pixi installA basic local host service is started like
cd src
mkdir outgoing
pixi run python serve_latest_image.py --dir outgoing --pattern "*.tif" --host 127.0.0.1 --port 8080 --debounce 2.0 --poll-interval 2 --log-level INFOTest with the address http:\localhost:8080 in a webbrowser