I have a C++ program that I can call from my system-installed Python using the subprocess module without causing any problems.
However, if I do so from within Slicer it results in a memory corruption error. The problem occurs when the program reaches this line of code:
itk::Statistics::MersenneTwisterRandomVariateGenerator::Pointer rndgen = \ itk::Statistics::MersenneTwisterRandomVariateGenerator::New();
In fact, the problem can be reproduced by calling a program that consists of that one, single line.
Can anyone explain why this is happening and how it can be circumvented?