Hi Nick,<br><br>Here is the print out:<br><br>


<span style="font-family:&#39;Monospace&#39;;font-size:9pt;color:rgb(0,0,0)">terminate called after throwing an instance of &#39;itk::ExceptionObject&#39;</span><span style="color:rgb(0,0,0)">
</span><br style="color:rgb(0,0,0)">
<span style="font-family:&#39;Monospace&#39;;font-size:9pt;color:rgb(0,0,0)">  what():  /home/ajg23/DEVEL/ITK/Modules/Core/Common/src/itkMultiThreader.cxx:359:</span><span style="color:rgb(0,0,0)">
</span><br style="color:rgb(0,0,0)">
<span style="font-family:&#39;Monospace&#39;;font-size:9pt;color:rgb(0,0,0)">itk::ERROR: MultiThreader(0xaacf610): Exception occurred during SingleMethodExecute</span><span style="color:rgb(0,0,0)">
</span><br style="color:rgb(0,0,0)">
<span style="font-family:&#39;Monospace&#39;;font-size:9pt;color:rgb(0,0,0)">/home/ajg23/DEVEL/ITK/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx:625:</span><span style="color:rgb(0,0,0)">
</span><br style="color:rgb(0,0,0)">
<span style="font-family:&#39;Monospace&#39;;font-size:9pt;color:rgb(0,0,0)">itk::ERROR:
 PointSetToImageFilter(0xaab0d40): The reparameterized point component 
2.00002 is outside the corresponding parametric domain of [0, 2].</span><br><br>It seems to work with 1 or 2 level, but start throwing an exception from level 3 onward.<br><br>Arnaud<br><br><div class="gmail_quote">On Mon, Jun 4, 2012 at 5:24 PM, Nicholas Tustison <span dir="ltr">&lt;<a href="mailto:ntustison@gmail.com" target="_blank">ntustison@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">THat looks right.  What is the print out you get<br>
when the exception is thrown?<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Jun 4, 2012, at 11:02 AM, Arnaud Gelas wrote:<br>
<br>
&gt; Nick,<br>
&gt;<br>
&gt; Here is the code (see below), I have been using (adapted from the test)<br>
&gt;<br>
&gt; Any idea?<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Arnaud<br>
&gt;<br>
&gt;      const unsigned int ParametricDimension = 1;<br>
&gt;      typedef itk::PointSet&lt; Vector3DType, ParametricDimension &gt;  PointSetType;<br>
&gt;<br>
&gt;      int length = m_Lateral - m_AX;<br>
&gt;<br>
&gt;      CoordinateType dt =<br>
&gt;          static_cast&lt; CoordinateType &gt;( 1. ) / static_cast&lt; CoordinateType &gt;( length );<br>
&gt;<br>
&gt;      CoordinateType t = 0.;<br>
&gt;<br>
&gt;      typename PointSetType::Pointer pointSet = PointSetType::New();<br>
&gt;<br>
&gt;      IndexType idx;<br>
&gt;      idx.Fill( 0 );<br>
&gt;<br>
&gt;      int i = 0, k = 0;<br>
&gt;      for( int y = m_AX; y &lt;= m_Lateral; y++ )<br>
&gt;        {<br>
&gt;        if( ( y == ax ) || ( y &gt;= m_Bottom ) )<br>
&gt;          {<br>
&gt;          typename PointSetType::PointType pt;<br>
&gt;          pt[0] = t;<br>
&gt;<br>
&gt;          pointSet-&gt;SetPoint( i, pt );<br>
&gt;<br>
&gt;          Vector3DType v;<br>
&gt;          v[0] = static_cast&lt; typename PointSetType::PointType::CoordRepType &gt;( contour[y] );<br>
&gt;          v[1] = static_cast&lt; typename PointSetType::PointType::CoordRepType &gt;( y );<br>
&gt;          v[2] = 0.;<br>
&gt;<br>
&gt;          pointSet-&gt;SetPointData( i, v );<br>
&gt;<br>
&gt;          i++;<br>
&gt;          }<br>
&gt;<br>
&gt;        t += dt;<br>
&gt;        }<br>
&gt;<br>
&gt;      typedef itk::Image&lt; Vector3DType, ParametricDimension &gt; ParametricImageType;<br>
&gt;<br>
&gt;      typename ParametricImageType::SpacingType spacing;<br>
&gt;      spacing.Fill( dt );<br>
&gt;<br>
&gt;      typename ParametricImageType::SizeType size;<br>
&gt;      size.Fill( length + 1 );<br>
&gt;<br>
&gt;      typename ParametricImageType::PointType origin;<br>
&gt;      origin.Fill( 0. );<br>
&gt;<br>
&gt;      typedef itk::BSplineScatteredDataPointSetToImageFilter&lt; PointSetType, ParametricImageType &gt; FilterType;<br>
&gt;      typename FilterType::Pointer filter = FilterType::New();<br>
&gt;      filter-&gt;SetInput( pointSet );<br>
&gt;      filter-&gt;SetSize( size );<br>
&gt;      filter-&gt;SetOrigin( origin );<br>
&gt;      filter-&gt;SetSpacing( spacing );<br>
&gt;      filter-&gt;SetSplineOrder( 3 );<br>
&gt;      filter-&gt;SetNumberOfLevels( 1 );<br>
&gt;<br>
&gt;      typename FilterType::ArrayType ncps;<br>
&gt;      ncps.Fill( 4 );<br>
&gt;      filter-&gt;SetNumberOfControlPoints( ncps );<br>
&gt;<br>
&gt;      filter-&gt;SetNumberOfThreads( 1 );<br>
&gt;      filter-&gt;SetGenerateOutputImage( true );<br>
&gt;      filter-&gt;Update();<br>
&gt;<br>
&gt; On 06/04/2012 04:55 PM, Nicholas Tustison wrote:<br>
&gt;&gt; Hi Arnaud,<br>
&gt;&gt;<br>
&gt;&gt; Yes, so that means that one of your data points is outside the<br>
&gt;&gt; user-defined parametric domain.  Even if it is right on the edge,<br>
&gt;&gt; the parametric domain is open-ended on the right side which<br>
&gt;&gt; will cause this exception to be thrown.  How are you setting up<br>
&gt;&gt; your parametric domain?  In other words, what does your call<br>
&gt;&gt; look like when you&#39;re setting up the filter?<br>
&gt;&gt;<br>
&gt;&gt; Nick<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Jun 4, 2012, at 10:45 AM, Arnaud Gelas wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Hi Nick,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; When using itk::BSplineScatteredDataPointSetToImageFilter, I get the following exception<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; itkExceptionMacro( &quot;The reparameterized point component &quot;&lt;&lt;  p[i]<br>
&gt;&gt;&gt; &lt;&lt;  &quot; is outside the corresponding parametric domain of [0,&quot;<br>
&gt;&gt;&gt; &lt;&lt;  totalNumberOfSpans&lt;&lt;  &quot;].&quot; );<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I could not figure out if I made a mistake when setting my parameters? or anything else?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Any idea? or suggestion?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thanks,<br>
&gt;&gt;&gt; Arnaud<br>
&gt;<br>
<br>
</div></div></blockquote></div><br>