Hyperspy can read/write it. I wrote a small wrapper using PyCall for a similar case to read DM3 files.
Supported formats: Loading and saving data — HyperSpy 1.7.1 documentation
Also TiffImages.jl might provide some insights on how to write a file reader/writer.