<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Yeah, so it's a floating point thing where your last point is ending<div>up on the boundary. 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"><<a href="mailto:ntustison@gmail.com" target="_blank">ntustison@gmail.com</a>></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>
> Nick,<br>
><br>
> Here is the code (see below), I have been using (adapted from the test)<br>
><br>
> Any idea?<br>
><br>
> Thanks,<br>
> Arnaud<br>
><br>
> const unsigned int ParametricDimension = 1;<br>
> typedef itk::PointSet< Vector3DType, ParametricDimension > PointSetType;<br>
><br>
> int length = m_Lateral - m_AX;<br>
><br>
> CoordinateType dt =<br>
> static_cast< CoordinateType >( 1. ) / static_cast< CoordinateType >( length );<br>
><br>
> CoordinateType t = 0.;<br>
><br>
> typename PointSetType::Pointer pointSet = PointSetType::New();<br>
><br>
> IndexType idx;<br>
> idx.Fill( 0 );<br>
><br>
> int i = 0, k = 0;<br>
> for( int y = m_AX; y <= m_Lateral; y++ )<br>
> {<br>
> if( ( y == ax ) || ( y >= m_Bottom ) )<br>
> {<br>
> typename PointSetType::PointType pt;<br>
> pt[0] = t;<br>
><br>
> pointSet->SetPoint( i, pt );<br>
><br>
> Vector3DType v;<br>
> v[0] = static_cast< typename PointSetType::PointType::CoordRepType >( contour[y] );<br>
> v[1] = static_cast< typename PointSetType::PointType::CoordRepType >( y );<br>
> v[2] = 0.;<br>
><br>
> pointSet->SetPointData( i, v );<br>
><br>
> i++;<br>
> }<br>
><br>
> t += dt;<br>
> }<br>
><br>
> typedef itk::Image< Vector3DType, ParametricDimension > ParametricImageType;<br>
><br>
> typename ParametricImageType::SpacingType spacing;<br>
> spacing.Fill( dt );<br>
><br>
> typename ParametricImageType::SizeType size;<br>
> size.Fill( length + 1 );<br>
><br>
> typename ParametricImageType::PointType origin;<br>
> origin.Fill( 0. );<br>
><br>
> typedef itk::BSplineScatteredDataPointSetToImageFilter< PointSetType, ParametricImageType > FilterType;<br>
> typename FilterType::Pointer filter = FilterType::New();<br>
> filter->SetInput( pointSet );<br>
> filter->SetSize( size );<br>
> filter->SetOrigin( origin );<br>
> filter->SetSpacing( spacing );<br>
> filter->SetSplineOrder( 3 );<br>
> filter->SetNumberOfLevels( 1 );<br>
><br>
> typename FilterType::ArrayType ncps;<br>
> ncps.Fill( 4 );<br>
> filter->SetNumberOfControlPoints( ncps );<br>
><br>
> filter->SetNumberOfThreads( 1 );<br>
> filter->SetGenerateOutputImage( true );<br>
> filter->Update();<br>
><br>
> On 06/04/2012 04:55 PM, Nicholas Tustison wrote:<br>
>> Hi Arnaud,<br>
>><br>
>> Yes, so that means that one of your data points is outside the<br>
>> user-defined parametric domain. Even if it is right on the edge,<br>
>> the parametric domain is open-ended on the right side which<br>
>> will cause this exception to be thrown. How are you setting up<br>
>> your parametric domain? In other words, what does your call<br>
>> look like when you're setting up the filter?<br>
>><br>
>> Nick<br>
>><br>
>><br>
>> On Jun 4, 2012, at 10:45 AM, Arnaud Gelas wrote:<br>
>><br>
>>> Hi Nick,<br>
>>><br>
>>> When using itk::BSplineScatteredDataPointSetToImageFilter, I get the following exception<br>
>>><br>
>>> itkExceptionMacro( "The reparameterized point component "<< p[i]<br>
>>> << " is outside the corresponding parametric domain of [0,"<br>
>>> << totalNumberOfSpans<< "]." );<br>
>>><br>
>>><br>
>>> I could not figure out if I made a mistake when setting my parameters? or anything else?<br>
>>><br>
>>> Any idea? or suggestion?<br>
>>><br>
>>> Thanks,<br>
>>> Arnaud<br>
><br>
<br>
</div></div></blockquote></div><br>
</blockquote></div><br></div></body></html>