<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">When you catch the exception print out the inputs to the filter. Is the Input image as expected?<div><br></div><div><div><div>On Jun 14, 2014, at 1:00 PM, UJJWAL aryan <<a href="mailto:meetukme@gmail.com">meetukme@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div><div>Hi,<br><br></div>I figured out that the problem is happening in the final of the code where the ImageFileWriter is invoked. As I do writer->Update(), it throws an exception. The error is as follows :<br>
<br>itk::ExceptionObject (0x14f1a60)<br>Location: "void itk::ImageBase<VImageDimension>::ComputeIndexToPhysicalPointMatrices() [with unsigned int VImageDimension = 2u]" <br>File: /usr/local/include/ITK-4.5/itkImageBase.hxx<br>
Line: 184<br>Description: itk::ERROR: Image(0x14f2ab0): A spacing of 0 is not allowed: Spacing is [0, 0]<br><br></div>I do not understand that why this error is coming. Would I need to set the physical spacing and everything manually ?<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jun 14, 2014 at 8:47 PM, Bradley Lowekamp <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 didn't a quick look at your code and didn't see any thing obvious.</div>
<div><br></div><div>What needs to be done is to figure out which filter is misbehaving. To do this place a try/catch around the update for a filters. Start with the first suspicions  filter in your pipeline then test. The idea is to try to isolate the section of your pipeline causing the trouble. Once you figure out which part is problematic you can drill down and examine the filter more closely.</div>
<div><br></div><div>Brad</div><div><br><div><div><div class="h5"><div>On Jun 14, 2014, at 9:42 AM, UJJWAL aryan <<a href="mailto:meetukme@gmail.com" target="_blank">meetukme@gmail.com</a>> wrote:</div><br></div></div>
<blockquote type="cite"><div><div class="h5"><div dir="ltr"><div><div>Hi,<br><br></div>I am attaching a small snippet of a code I was writing. However on running the code I get the following error :<br><br>terminate called after throwing an instance of 'itk::ExceptionObject'<br>

  what():  /usr/local/include/ITK-4.5/itkImageBase.hxx:184:<br>itk::ERROR: Image(0x189eab0): A spacing of 0 is not allowed: Spacing is [0, 0]<br>Aborted (core dumped)<br><br></div>Could someone please point out what am I missing here ?<br clear="all">

<div><br>-- <br>Ujjwal<div>IIIT Hyderabad </div><div>Mob - 8142265628</div><div><a href="mailto:ujjwal@research.iiit.ac.in" target="_blank">ujjwal@research.iiit.ac.in</a><br><br><br></div>
</div></div>
</div></div><span><od-pre.cxx></span>_____________________________________<br>Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>Kitware offers ITK Training Courses, for more information visit:<br><a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br><br>Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://public.kitware.com/mailman/listinfo/insight-users" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
</blockquote></div><br></div></div></blockquote></div><br><br clear="all"><br>-- <br>Ujjwal<div>IIIT Hyderabad </div><div>Mob - 8142265628</div><div><a href="mailto:ujjwal@research.iiit.ac.in" target="_blank">ujjwal@research.iiit.ac.in</a><br>
<br><br></div>
</div>
</blockquote></div><br></div></body></html>