updated tutorial on writing json files for filters code autogeneration

Dear all,

I am attempting to create a json file for my own mock ITK-filter and having troubles when compiling SimpleITK. I am following this tutorial https://itk.org/SimpleITKDoxygen/html/FilterTemplatesPage.html
I have an impression that it is somewhat outdated, for instance there is no information on tags such as “itk-module”, ïtk-group"which I see in the json files for many filters. My question - is there more uptodate tutorial?
Is there a way to test correctness of a json file without recompiling the SimpleITK? Like some lua script testing if all necessary fields are present, etc…?

Thank you in advance!

1 Like

Hello mkvasnyt,

You are correct that the JSON documents is a bit out dated. You can also use the numerous existingjson files for reference. I’d recommend finding a filter which has a similar interface, and begin by copying the exiting JSON document.

The itk-module and itk-group are just taken from the modules where the ITK filter exists, and used to enable/disable the filter if the ITK build does not have that module available. Generally, this field is automatically updated with this script.

Writing a new document in Sphinx to guide the extension of SimpleITK with a JSON filter description is quickly becoming a priority, but it has not happened yet.

We do have a script to validate the syntax of the JSON files. That gets automatically run during the configuration process, which may help give a verbose error message.

To speed up the build process, make sure you are not rebuilding the whole SimpleITK super build, just build the SimpleITK subproject. As you are writing the JSON, you should turn off all wrapped languages, and enable shared libraries to expedite the build process.

Hope that helps,
Brad

2 Likes

yes, it helps!! Thanks a lot for your detailed answer!

For reference: