Hi!
I am currently working on wrapping an RTK filter which has a bool *
property along with a setter. The wrapped filter properly compiles but the method, when called from a Python script, produces an error (something like the method expects a bool *
). I call it by passing a standard Python array (like [True, False, True]
) as a parameter. Wrapping C arrays works correctly for other data types, such as int *
or float *
, but seems broken for bool *
.
I tried to look at ITK source code in order to figure out how C arrays are wrapped, but I could not understand, and as far as I searched ITK never wraps bool *
. I also tried to replace my bool *
by a std::vector<bool>
and it made the wrapped filter work.
I thus have several questions:
- According to ITK development guidelines, is it alright to wrap a
std::vector<bool>
instead of abool *
? (RTK tries to stick as much as possible to ITK guidelines.) - Is there something to modify in ITK which would enable
bool *
to be properly wrapped? - Is there any significant difference in wrapping a
std::vector
instead of a standard C array?
Sorry if the questions seem basic, I am far from being a swig expect.
Thank you very much!