SuperElastix / elastix

Official elastix repository
http://elastix.dev
Apache License 2.0
481 stars 116 forks source link

Use JSON or YAML for configuration and transformation files #146

Open soupault opened 5 years ago

soupault commented 5 years ago

Currently, the configuration of the registration method is performed using a text file of the custom syntax. Same applies for the file with the estimated transformation parameters. This causes severe inconvenience and complications in developing the package wrappers (see, for example, atlas_register....py demos here - https://github.com/SuperElastix/elastix/wiki/Atlas-generation-using-elastix#registration-settings). In its turn, these complications make registration parameters search hard to automatize.

Another relevant issue is that if the transformation is estimated on a pair of images with selected non-linear interpolation, the info on the interpolation is propagated to the file with transformation. In a segmentation task, the transformation for the labels should preferably have NN interpolation. Therefore, the transformation file has to be parsed, searched for the interpolation string, this string has to be substituted, and the config save to the very format.

I think the above slows down the adoption of the package.

To tackle this issue, I'd like to suggest to switch to one of the established formats for the configuration files: JSON (https://en.wikipedia.org/wiki/JSON), YAML (https://en.wikipedia.org/wiki/YAML), or even (https://en.wikipedia.org/wiki/XML).

Quick googling revealed many reliable C++ libraries with JSON/YAML support.

mstaring commented 5 years ago

All agreed and something we have considered also. This will be quite an involved task, to do right, as this is quite entangled with the toolkit. We have no resources to work on this ourselves. Would you like to work on it?

soupault commented 5 years ago

@mstaring Great to hear! Frankly speaking, I'm not sure if I have enough expertise in C++ for doing the task. I might take a closer look at the code at some point or try to find a volunteer for this, but cannot promise anything. If you could keep the issue open, that would be great.

mstaring commented 5 years ago

Sure, I'll keep it open! If you find a volunteer we could have a look together on specific steps.