PlusToolkit / ndicapi

A common C API for communicating with NDI Polaris and Aurora devices
MIT License
47 stars 31 forks source link

Decode/Extract Measurements From ROM File #30

Closed rajkundu closed 2 years ago

rajkundu commented 2 years ago

Hello! I recently started working with NDI .rom files and needed to decode them for the purposes of my research. I saw that this API passes raw .rom file data to the NDI camera, but it can't decode the data itself. So, I ended up looking further into it and created a very simple Python tool to do this, located at https://github.com/rajkundu/rom-parser

Perhaps it could also be useful to other researchers, especially those using the ndicapi library, to be able to know the exact measurements of trackers/bodies from ROM files. So, this issue/comment thread is mainly to gauge interest (especially from the ndicapi maintainers) and determine whether such functionality would be a useful addition to this library. I'm happy to help adapt/write the function myself, as it really is very simple. In any case, thank you!

thompson318 commented 2 years ago

Hello, this looks like a handy little script to me, thank you. I'd be quite interested in doing it the other way too so I can create my own rom files from sets of points without using NDI's software. It looks to me like that would be pretty straight forward? I'm not sure it belongs in ndicapi though, mainly because of the language (i.e. Python in what is a predominantly c library.). It could be it's own stand alone Python package. I also maintain a Python NDI library at https://github.com/SciKit-Surgery/scikit-surgerynditracker that might be a good home for it.

rajkundu commented 2 years ago

I think that should be rather straightforward, too. I can't guarantee it'll work, as there is still data/parameters in ROM files whose functions I don't know. However, I think you can still create a ROM file with the # markers and marker positions of your custom tool, and I imagine the tracking should pretty much work. It's at least worth trying, I'd say!