<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Nick,<br>
    <br>
    What about<br>
    <br>
    &nbsp;&nbsp;&nbsp; &lt;&lt; "The reparameterized point component " &lt;&lt; p[i] "
    is outside the corresponding parametric domain of [0, " &lt;&lt;
    totalNumberOfSpans &lt;&lt; "]. <b>It may have to do with size and
      spacing values set in this filter.</b>"<br>
    <br>
    Or something similar (just to provide an indication to users)?<br>
    <br>
    Arnaud<br>
    <br>
    On 06/05/2012 03:23 PM, Nicholas Tustison wrote:
    <blockquote
      cite="mid:D2BC7F81-1FB8-4D25-8FF2-04F4BC3645F0@gmail.com"
      type="cite">
      <div>That's good.</div>
      <div><br>
      </div>
      What would you suggest? &nbsp;
      <div><br>
      </div>
      <div><br>
        <div>
          <div>On Jun 5, 2012, at 7:49 AM, Arnaud Gelas wrote:</div>
          <br class="Apple-interchange-newline">
          <blockquote type="cite">
            <meta content="text/html; charset=ISO-8859-1"
              http-equiv="Content-Type">
            <div bgcolor="#FFFFFF" text="#000000"> By slightly
              increasing the spacing, or by adding 1 to the image size,
              it works!<br>
              <br>
              Would it be possible either to update the exception
              message, either add a comment here to know what could be
              the reasons and possible fixes?<br>
              Would it be possible to detect such an error at an earlier
              stage?<br>
              <br>
              Thanks,<br>
              Arnaud<br>
              <br>
              On 06/05/2012 01:34 PM, Nicholas Tustison wrote:
              <blockquote
                cite="mid:EC26F67B-77D5-4F62-9658-D22190439708@gmail.com"
                type="cite">Yeah, so it's a floating point thing where
                your last point is ending
                <div>up on the boundary. &nbsp;Try making the spacing
                  slightly larger.</div>
                <div><br>
                </div>
                <div><br>
                  <div>
                    <div>On Jun 5, 2012, at 3:37 AM, Arnaud Gelas wrote:</div>
                    <br class="Apple-interchange-newline">
                    <blockquote type="cite">Hi Nick,<br>
                      <br>
                      Here is the print out:<br>
                      <br>
                      <span
                        style="font-family:'Monospace';font-size:9pt;color:rgb(0,0,0)">terminate

                        called after throwing an instance of
                        'itk::ExceptionObject'</span><span
                        style="color:rgb(0,0,0)"> </span><br
                        style="color:rgb(0,0,0)">
                      <span
                        style="font-family:'Monospace';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:'Monospace';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:'Monospace';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:'Monospace';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
                            moz-do-not-send="true"
                            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.
                          &nbsp;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; &nbsp; &nbsp; &nbsp;const unsigned int
                              ParametricDimension = 1;<br>
                              &gt; &nbsp; &nbsp; &nbsp;typedef itk::PointSet&lt;
                              Vector3DType, ParametricDimension &gt;
                              &nbsp;PointSetType;<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp;int length = m_Lateral - m_AX;<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp;CoordinateType dt =<br>
                              &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;static_cast&lt;
                              CoordinateType &gt;( 1. ) /
                              static_cast&lt; CoordinateType &gt;(
                              length );<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp;CoordinateType t = 0.;<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp;typename PointSetType::Pointer
                              pointSet = PointSetType::New();<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp;IndexType idx;<br>
                              &gt; &nbsp; &nbsp; &nbsp;idx.Fill( 0 );<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp;int i = 0, k = 0;<br>
                              &gt; &nbsp; &nbsp; &nbsp;for( int y = m_AX; y &lt;=
                              m_Lateral; y++ )<br>
                              &gt; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
                              &gt; &nbsp; &nbsp; &nbsp; &nbsp;if( ( y == ax ) || ( y &gt;=
                              m_Bottom ) )<br>
                              &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
                              &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;typename
                              PointSetType::PointType pt;<br>
                              &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pt[0] = t;<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pointSet-&gt;SetPoint( i, pt
                              );<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Vector3DType v;<br>
                              &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;v[0] = static_cast&lt;
                              typename
                              PointSetType::PointType::CoordRepType
                              &gt;( contour[y] );<br>
                              &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;v[1] = static_cast&lt;
                              typename
                              PointSetType::PointType::CoordRepType
                              &gt;( y );<br>
                              &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;v[2] = 0.;<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pointSet-&gt;SetPointData(
                              i, v );<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;i++;<br>
                              &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp; &nbsp;t += dt;<br>
                              &gt; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp;typedef itk::Image&lt;
                              Vector3DType, ParametricDimension &gt;
                              ParametricImageType;<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp;typename
                              ParametricImageType::SpacingType spacing;<br>
                              &gt; &nbsp; &nbsp; &nbsp;spacing.Fill( dt );<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp;typename
                              ParametricImageType::SizeType size;<br>
                              &gt; &nbsp; &nbsp; &nbsp;size.Fill( length + 1 );<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp;typename
                              ParametricImageType::PointType origin;<br>
                              &gt; &nbsp; &nbsp; &nbsp;origin.Fill( 0. );<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp;typedef
                              itk::BSplineScatteredDataPointSetToImageFilter&lt;
                              PointSetType, ParametricImageType &gt;
                              FilterType;<br>
                              &gt; &nbsp; &nbsp; &nbsp;typename FilterType::Pointer
                              filter = FilterType::New();<br>
                              &gt; &nbsp; &nbsp; &nbsp;filter-&gt;SetInput( pointSet );<br>
                              &gt; &nbsp; &nbsp; &nbsp;filter-&gt;SetSize( size );<br>
                              &gt; &nbsp; &nbsp; &nbsp;filter-&gt;SetOrigin( origin );<br>
                              &gt; &nbsp; &nbsp; &nbsp;filter-&gt;SetSpacing( spacing
                              );<br>
                              &gt; &nbsp; &nbsp; &nbsp;filter-&gt;SetSplineOrder( 3 );<br>
                              &gt; &nbsp; &nbsp; &nbsp;filter-&gt;SetNumberOfLevels( 1
                              );<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp;typename FilterType::ArrayType
                              ncps;<br>
                              &gt; &nbsp; &nbsp; &nbsp;ncps.Fill( 4 );<br>
                              &gt; &nbsp; &nbsp;
                              &nbsp;filter-&gt;SetNumberOfControlPoints( ncps
                              );<br>
                              &gt;<br>
                              &gt; &nbsp; &nbsp; &nbsp;filter-&gt;SetNumberOfThreads( 1
                              );<br>
                              &gt; &nbsp; &nbsp;
                              &nbsp;filter-&gt;SetGenerateOutputImage( true
                              );<br>
                              &gt; &nbsp; &nbsp; &nbsp;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.
                              &nbsp;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. &nbsp;How are you setting up<br>
                              &gt;&gt; your parametric domain? &nbsp;In other
                              words, what does your call<br>
                              &gt;&gt; look like when you'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( "The
                              reparameterized point component "&lt;&lt;
                              &nbsp;p[i]<br>
                              &gt;&gt;&gt; &lt;&lt; &nbsp;" is outside the
                              corresponding parametric domain of [0,"<br>
                              &gt;&gt;&gt; &lt;&lt;
                              &nbsp;totalNumberOfSpans&lt;&lt; &nbsp;"]." );<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>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </blockquote>
              <br>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>