[ITK] itk error: Inputs do not occupy the same physical space!

Lowekamp, Bradley (NIH/NLM/LHC) [C] blowekamp at mail.nih.gov
Tue Jan 24 10:35:59 EST 2017


Hello,

I am not familiar with “map_sync”. Is it from this class:
https://ipython.org/ipython-doc/3/api/generated/IPython.parallel.client.view.html
Does it use threads or heavy weight processes?

If you run the filter with just the single threaded map function does it fail the same way? Which file does it fail on? If you just run it on that file does it still fail?

We need to narrow down the problem to determine if it’s related to the way you are executing, or if perhaps N4 has a problem with your data. Perhaps it is some type of degenerate case, or there is a bug in the filter.

Thanks,
Brad

On Jan 24, 2017, at 12:44 AM, Vishwanathan Shreyas <shreyas122011 at gmail.com<mailto:shreyas122011 at gmail.com>> wrote:

SimpleITK on python gives me a weird bug, after running successfully a few times. I'm using the MICCAI BRATS database. Here's my code:

def N43D(fl):

    im = SimpleITK.ReadImage(fl)

    msk = SimpleITK.BinaryThreshold(im, 0, 0)

    msk = SimpleITK.BinaryNot(msk)

    msk = SimpleITK.Cast(msk, SimpleITK.sitkUInt8)

    im = SimpleITK.Cast(im, SimpleITK.sitkFloat32)

    im_n4 = SimpleITK.N4BiasFieldCorrection(im, msk)

    SimpleITK.WriteImage(im_n4, os.path.splitext(fl)[0]+'_n4.mha', useCompression=True)


Also, I'm using multiple cores for a list of files:

dview.map_sync(N43D, fl)


The program runs fine for about 40 files. Then I get this error on all my engines:

[0:apply]:
RuntimeErrorTraceback (most recent call last)<string> in <module>()
<ipython-input-56-03a02a993653> in N43D(fl)
c:\users\shreyas_v\anaconda2\lib\site-packages\SimpleITK\SimpleITK.pyc in N4BiasFieldCorrection(*args, **kwargs)
  43368
  43369     """
> 43370     return _SimpleITK.N4BiasFieldCorrection(*args, **kwargs)
  43371 class NaryAddImageFilter(ImageFilter_3):
  43372     """
RuntimeError: Exception thrown in SimpleITK N4BiasFieldCorrection: c:\d\vs9-pkg\simpleitk-build\itk\modules\core\common\include\itkImageToImageFilter.hxx:248:
itk::ERROR: SubtractImageFilter(00000000065D8220): Inputs do not occupy the same physical space!
InputImage Origin: [0.0000000e+000, -2.3900000e+002, 0.0000000e+000], InputImage_1 Origin: [-5.9750000e+001, -5.9750000e+001, -3.8500000e+001]
    Tolerance: 1.0000000e-006
InputImage Spacing: [1.0000000e+000, 1.0000000e+000, 1.0000000e+000], InputImage_1 Spacing: [5.9750000e+001, 5.9750000e+001, 3.8500000e+001]
    Tolerance: 1.0000000e-006

Has anyone faced this issue before?

Regards,
Shreyas
_______________________________________________
Community mailing list
Community at itk.org<mailto:Community at itk.org>
http://public.kitware.com/mailman/listinfo/community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20170124/75062a7d/attachment.html>


More information about the Community mailing list