SimpleITK N4BiasFieldCorrection, not working with any data type
<p>Just installed the latest version of SimpleITK and I'm trying to run a simple code as:</p>

<pre><code>im = sitk.ReadImage('img.nii.gz')
im_bin = sitk.ReadImage('img_bin.nii.gz')
im_bfc = sitk.N4BiasFieldCorrection(im, im_bin)
</code></pre>

<p>the error is </p>

<pre><code>RuntimeError: Exception thrown in SimpleITK N4BiasFieldCorrection: /scratch/dashboards/SimpleITK-OSX10.7-intel-pkg/SimpleITK/Code/Common/include/sitkDualMemberFunctionFactory.hxx:214:
sitk::ERROR: Pixel type: 64-bit signed integer is not supported in 2D byN3itk6simple32N4BiasFieldCorrectionImageFilterE
</code></pre>

<p>I tried with casting to different type, int, float, signed, unsigned, and I tried with 2d and 3d images. I tried as well to use <a href="https://itk.org/SimpleITKDoxygen07/html/N4BiasFieldCorrection_8py-example.html" rel="nofollow">https://itk.org/SimpleITKDoxygen07/html/N4BiasFieldCorrection_8py-example.html</a> 
And the error has always been the same. Other modules of SimpleITK appears to work. 
Any idea? Can you reproduce the error?<br>
Thanks!</p>

<p>In answering my question, I found that the errors raised do not seem to be related to the real cause. If the mask is made with a threshold with sitk as</p>

<pre><code>bth = sitk.BinaryThresholdImageFilter()
img_bin = bth.Execute(img)  
img_bin = -1 * (img_mask - 1)

im_bfc = sitk.N4BiasFieldCorrection(im, im_bin) 
</code></pre>

<p>The algorithm works and no error is raised.
- will update if I find the real cause of the problem!</p>

python