<div dir="ltr">Also if you look at my program, the mask is derived from the image itself, so highly unlikely that it will occupy a different space.<div>The error message shown is just for 1 engine(core). All the engines give this error message.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 25, 2017 at 11:25 AM, Vishwanathan Shreyas <span dir="ltr"><<a href="mailto:shreyas122011@gmail.com" target="_blank">shreyas122011@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div dir="ltr"><div class="gmail_quote"><br><div dir="ltr">Hi Brad,<br><br>"map_sync" here uses heavyweight independent processes. Also, the filter fails on random files every time I run it. I ran it on a single core but it was taking about 13 min for processing a single file, so I did not waste time on running it as a single threaded function for any more files. <div>The platform I'm using is Windows Server 2012 standard. <br>Also, there is no problem with the data as I ran a script to check it.</div><div><br></div><div>Thanks,<br>Shreyas</div></div><div class="m_-1098670515110857326HOEnZb"><div class="m_-1098670515110857326h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 24, 2017 at 9:05 PM, Lowekamp, Bradley (NIH/NLM/LHC) [C] <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
Hello,
<div><br>
</div>
<div>I am not familiar with “map_sync”. Is it from this class:</div>
<div><span class="m_-1098670515110857326m_1928363586134354973m_-4792830643368167401Apple-tab-span" style="white-space:pre-wrap"></span><a href="https://ipython.org/ipython-doc/3/api/generated/IPython.parallel.client.view.html" target="_blank">https://ipython.org/ipython-do<wbr>c/3/api/generated/IPython.para<wbr>llel.client.view.html</a></div>
<div>Does it use threads or heavy weight processes?</div>
<div><br>
</div>
<div>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?</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Brad</div>
<div><br>
<div>
<blockquote type="cite"><div><div class="m_-1098670515110857326m_1928363586134354973h5">
<div>On Jan 24, 2017, at 12:44 AM, Vishwanathan Shreyas <<a href="mailto:shreyas122011@gmail.com" target="_blank">shreyas122011@gmail.com</a>> wrote:</div>
<br class="m_-1098670515110857326m_1928363586134354973m_-4792830643368167401Apple-interchange-newline">
</div></div><div><div><div class="m_-1098670515110857326m_1928363586134354973h5">
<div dir="ltr">
<div>
<div>
<div>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:<br>
<pre style="background-image:none;background-color:rgb(255,255,255);background-position:0% 0%;background-repeat:repeat repeat"><span style="color:rgb(128,0,0);font-weight:bold">def</span> N43D<span style="color:rgb(128,128,48)">(</span>fl<span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,128,48)">:</span>
im <span style="color:rgb(128,128,48)">=</span> SimpleITK<span style="color:rgb(128,128,48)">.</span>ReadImage<span style="color:rgb(128,128,48)">(</span>fl<span style="color:rgb(128,128,48)">)</span>
msk <span style="color:rgb(128,128,48)">=</span> SimpleITK<span style="color:rgb(128,128,48)">.</span>BinaryThreshold<span style="color:rgb(128,128,48)">(</span>im<span style="color:rgb(128,128,48)">,</span> <span style="color:rgb(0,140,0)">0</span><span style="color:rgb(128,128,48)">,</span> <span style="color:rgb(0,140,0)">0</span><span style="color:rgb(128,128,48)">)</span>
msk <span style="color:rgb(128,128,48)">=</span> SimpleITK<span style="color:rgb(128,128,48)">.</span>BinaryNot<span style="color:rgb(128,128,48)">(</span>msk<span style="color:rgb(128,128,48)">)</span>
msk <span style="color:rgb(128,128,48)">=</span> SimpleITK<span style="color:rgb(128,128,48)">.</span>Cast<span style="color:rgb(128,128,48)">(</span>msk<span style="color:rgb(128,128,48)">,</span> SimpleITK<span style="color:rgb(128,128,48)">.</span>sitkUInt8<span style="color:rgb(128,128,48)">)</span>
im <span style="color:rgb(128,128,48)">=</span> SimpleITK<span style="color:rgb(128,128,48)">.</span>Cast<span style="color:rgb(128,128,48)">(</span>im<span style="color:rgb(128,128,48)">,</span> SimpleITK<span style="color:rgb(128,128,48)">.</span>sitkFloat32<span style="color:rgb(128,128,48)">)</span>
im_n4 <span style="color:rgb(128,128,48)">=</span> SimpleITK<span style="color:rgb(128,128,48)">.</span>N4BiasFieldCorrectio<wbr>n<span style="color:rgb(128,128,48)">(</span>im<span style="color:rgb(128,128,48)">,</span> msk<span style="color:rgb(128,128,48)">)</span>
SimpleITK<span style="color:rgb(128,128,48)">.</span>WriteImage<span style="color:rgb(128,128,48)">(</span>im_n4<span style="color:rgb(128,128,48)">,</span> os<span style="color:rgb(128,128,48)">.</span>path<span style="color:rgb(128,128,48)">.</span>splitext<span style="color:rgb(128,128,48)">(</span>fl<span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,128,48)">[</span><span style="color:rgb(0,140,0)">0</span><span style="color:rgb(128,128,48)">]</span><span style="color:rgb(68,170,221)">+</span><span style="color:rgb(0,0,230)">'_n4.m<wbr>ha'</span><span style="color:rgb(128,128,48)">,</span> useCompression<span style="color:rgb(128,128,48)">=</span><span style="color:rgb(7,71,38)">True</span><span style="color:rgb(128,128,48)">)</span></pre>
<br>
<br>
Also, I'm using multiple cores for a list of files:<br>
<pre style="background-image:none;background-color:rgb(255,255,255);background-position:0% 0%;background-repeat:repeat repeat">dview<span style="color:rgb(128,128,48)">.</span>map_sync<span style="color:rgb(128,128,48)">(</span>N43D<span style="color:rgb(128,128,48)">,</span> fl<span style="color:rgb(128,128,48)">)</span></pre>
<br>
<br>
The program runs fine for about 40 files. Then I get this error on all my engines:<br>
<pre style="background-image:none;background-color:rgb(255,255,255);background-position:0% 0%;background-repeat:repeat repeat"><span style="color:rgb(128,128,48)">[</span><span style="color:rgb(0,140,0)">0</span><span style="color:rgb(128,128,48)">:</span>apply<span style="color:rgb(128,128,48)">]</span><span style="color:rgb(128,128,48)">:</span>
RuntimeErrorTraceback <span style="color:rgb(128,128,48)">(</span>most recent call last<span style="color:rgb(128,128,48)">)</span><span style="color:rgb(68,170,221)"><</span>string<span style="color:rgb(68,170,221)">></span> <span style="color:rgb(128,0,0);font-weight:bold">in</span> <span style="color:rgb(68,170,221)"><</span>module<span style="color:rgb(68,170,221)">></span><span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,128,48)">)</span>
<span style="color:rgb(68,170,221)"><</span>ipython<span style="color:rgb(68,170,221)">-</span><span style="color:rgb(64,0,0)">input</span><span style="color:rgb(68,170,221)">-</span>56<span style="color:rgb(68,170,221)">-</span>03a02a993653<span style="color:rgb(68,170,221)"><wbr>></span> <span style="color:rgb(128,0,0);font-weight:bold">in</span> N43D<span style="color:rgb(128,128,48)">(</span>fl<span style="color:rgb(128,128,48)">)</span>
c<span style="color:rgb(128,128,48)">:</span>\users\shreyas_v\anaconda2\l<wbr>ib\site<span style="color:rgb(68,170,221)">-</span>packages\SimpleITK\Sim<wbr>pleITK<span style="color:rgb(128,128,48)">.</span>pyc <span style="color:rgb(128,0,0);font-weight:bold">in</span> N4BiasFieldCorrection<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(68,170,221)">*</span>args<span style="color:rgb(128,128,48)">,</span> <span style="color:rgb(68,170,221)">**</span>kwargs<span style="color:rgb(128,128,48)">)</span>
<span style="color:rgb(0,140,0)">43368</span>
<span style="color:rgb(0,140,0)">43369</span> <span style="color:rgb(105,105,105)">"""</span>
<span style="color:rgb(105,105,105)">> 43370 return _SimpleITK.N4BiasFieldCorrecti<wbr>on(*args, **kwargs)</span>
<span style="color:rgb(105,105,105)"> 43371 class NaryAddImageFilter(ImageFilter<wbr>_3):</span>
<span style="color:rgb(105,105,105)"> 43372 """</span>
<span style="color:rgb(7,71,38)">RuntimeError</span><span style="color:rgb(128,128,48)">:</span> <span style="color:rgb(7,71,38)">Exception</span> thrown <span style="color:rgb(128,0,0);font-weight:bold">in</span> SimpleITK N4BiasFieldCorrection<span style="color:rgb(128,128,48)">:</span> c<span style="color:rgb(128,128,48)">:</span>\d\vs9<span style="color:rgb(68,170,221)">-</span>pkg\simpleitk<span style="color:rgb(68,170,221)">-</span>build\i<wbr>tk\modules\core\common\include<wbr>\itkImageToImageFilter<span style="color:rgb(128,128,48)">.</span>hxx<span style="color:rgb(128,128,48)">:</span><span style="color:rgb(0,140,0)">248</span><span style="color:rgb(128,128,48)"><wbr>:</span>
itk<span style="color:rgb(128,128,48)">:</span><span style="color:rgb(128,128,48)">:</span>ERROR<span style="color:rgb(128,128,48)">:</span> SubtractImageFilter<span style="color:rgb(128,128,48)">(</span>0000000006<wbr>5D8220<span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,128,48)">:</span> Inputs do <span style="color:rgb(128,0,0);font-weight:bold">not</span> occupy the same physical space!
InputImage Origin<span style="color:rgb(128,128,48)">:</span> <span style="color:rgb(128,128,48)">[</span><span style="color:rgb(0,128,0)">0.0000000e+000</span><span style="color:rgb(128,128,48)">,</span> <span style="color:rgb(68,170,221)">-</span><span style="color:rgb(0,128,0)">2.3900000e+002</span><span style="color:rgb(128,128,48)">,</span> <span style="color:rgb(0,128,0)">0.0000000e+000</span><span style="color:rgb(128,128,48)">]</span><span style="color:rgb(128,128,48)">,</span> InputImage_1 Origin<span style="color:rgb(128,128,48)">:</span> <span style="color:rgb(128,128,48)">[</span><span style="color:rgb(68,170,221)">-</span><span style="color:rgb(0,128,0)">5.9750000e+001</span><span style="color:rgb(128,128,48)">,</span> <span style="color:rgb(68,170,221)">-</span><span style="color:rgb(0,128,0)">5.9750000e+001</span><span style="color:rgb(128,128,48)">,</span> <span style="color:rgb(68,170,221)">-</span><span style="color:rgb(0,128,0)">3.8500000e+001</span><span style="color:rgb(128,128,48)">]</span>
Tolerance<span style="color:rgb(128,128,48)">:</span> <span style="color:rgb(0,128,0)">1.0000000e-006</span>
InputImage Spacing<span style="color:rgb(128,128,48)">:</span> <span style="color:rgb(128,128,48)">[</span><span style="color:rgb(0,128,0)">1.0000000e+000</span><span style="color:rgb(128,128,48)">,</span> <span style="color:rgb(0,128,0)">1.0000000e+000</span><span style="color:rgb(128,128,48)">,</span> <span style="color:rgb(0,128,0)">1.0000000e+000</span><span style="color:rgb(128,128,48)">]</span><span style="color:rgb(128,128,48)">,</span> InputImage_1 Spacing<span style="color:rgb(128,128,48)">:</span> <span style="color:rgb(128,128,48)">[</span><span style="color:rgb(0,128,0)">5.9750000e+001</span><span style="color:rgb(128,128,48)">,</span> <span style="color:rgb(0,128,0)">5.9750000e+001</span><span style="color:rgb(128,128,48)">,</span> <span style="color:rgb(0,128,0)">3.8500000e+001</span><span style="color:rgb(128,128,48)">]</span>
Tolerance<span style="color:rgb(128,128,48)">:</span> <span style="color:rgb(0,128,0)">1.0000000e-006</span></pre>
<br>
</div>
Has anyone faced this issue before?<br>
<br>
</div>
Regards,<br>
</div>
Shreyas<br>
</div></div></div><span>
______________________________<wbr>_________________<br>
Community mailing list<br>
<a href="mailto:Community@itk.org" target="_blank">Community@itk.org</a><br>
<a href="http://public.kitware.com/mailman/listinfo/community" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/community</a><br>
</span></div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote></div><br></div>
</div></div></div><br></div>
</div></div></blockquote></div><br></div>