<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">That sounds reasonable. To be comprehensive, though, <div>you might also want to mention the origin since the points </div><div>could also be outside the left boundar(y/ies).</div><div>What that error is telling you is that the "image" domain,</div><div>which defines the parametric domain, does not contain</div><div>all of your points.</div><div><br></div><div>Instead of "It may have to do with the size and spacing </div><div>values set in this filter." perhaps something like "It is required</div><div>that the parametric domain encompass all the points. The</div><div>parametric domain can be modified and enlarged by changing </div><div>the origin, size, and spacing."</div><div><br></div><div>Nick</div><div><br><div> </div><div><div><br></div><div><br><div><div>On Jun 6, 2012, at 10:50 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">
Hi Nick,<br>
<br>
What about<br>
<br>
<< "The reparameterized point component " << p[i] "
is outside the corresponding parametric domain of [0, " <<
totalNumberOfSpans << "]. <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?
<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. 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 moz-do-not-send="true" 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>
</blockquote>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div>
</blockquote></div><br></div></div></div></body></html>