elastix icon indicating copy to clipboard operation
elastix copied to clipboard

ENH: Support for binary point file (.bin) reading and writing

Open ChristophKirst opened this issue 2 years ago • 6 comments

Here we provide support for a binary point file reader and writer to elastix to enable transformations of a large number of points (millions or more) for which the text format is not feasible.

This is based on the discussion in issue #665

The pull request provides the following:

  • Binary file reading and writing is detected if the -def file ends with extension 'bin'.

  • The binary serial format is assumed to be: isindex(uint64), numberofpoints(uint64), points(nx3, double)

  • Only the transformed points are written to get maximal performance.

We would be very happy to discuss any changes to this strategy that might fit your overall strategy better. A binary read/writing option is essential for us. If it was integrated to your repository it would allow us elastix in our project rather then shipping our own patched version with our software.

ChristophKirst avatar Aug 02 '23 15:08 ChristophKirst

Thank you very much @ChristophKirst I appreciate how you carefully implemented this feature! Will discuss with Stefan (@stefanklein) and Marius (@mstaring) how to follow-up on your PR!

In the mean time some small comments already. (But the main question remains: do we agree about the feature itself. To be discussed later.)

N-Dekker avatar Aug 10 '23 21:08 N-Dekker

Some tests should be still added. I'm not sure if they can be written as small GoogleTest unit tests (testing the extra TransformixInputPointFileReader functionality at C++ class level), or only as elastix executable tests. But I would like to see tests for various number of points (N = 0, N = 1, N = 2), as well as various coordinate values. Still to be discussed, maybe.

N-Dekker avatar Aug 11 '23 11:08 N-Dekker

@ChristophKirst Is the binary file format already in use outside of your (patched) elastix version? Otherwise we would prefer to support a more commonly used file format. Would the ".vtk" file format (from vtk.org) also be of interest to you?

N-Dekker avatar Aug 14 '23 15:08 N-Dekker