Thanks for the reply and the info.
I didn’t know that there is already such an extension, why it does not appear in Slicer’s extension manager?
I was planning to use Scipy to do the fitting so at the end I have only one file python code to make a simple portable Slicer plugin.
I will check the links today.
Still (for the sake of knowledge), I don’t know what cause the issues in the code above. If I change this line:
vma [i,j,k] = vc[0]
To be something like
vma [i,j,k] = 0
or
vma [i,j,k] = 4000
In both situations, Slicer does not crash when I load the resulted volume in “Volume” module. It crashes only when I try to assign voxel value from the multi volume. I printed the value of vc[0] and it looks like a single scalar value (not a vector).