[Insight-developers] [Fwd: [Insight-users] Re: [vtkusers] Porting Problem - Please Help!]

Joshua Cates cates at sci.utah.edu
Mon, 29 Mar 2004 10:38:43 -0700 (MST)


Hi,

Yes, any subclass of the SparseFieldLevelSetImageFilter _must_ be
instantiated with a real-valued output image type.  Solving these p.d.e.'s
with integer types would require a different algorithm.  The input type
may vary, but is just cast to the output (real) type before processing.  
I'll revisit the documentation again and elaborate on these issues.  Some
time ago we discussed having a "IsReal" or "IsFloatingPoint" concept
checking macro.  This would be a great place to use it.

Josh.


On Fri, 26 Mar 2004, Brad King wrote:

> Josh, Bill L,
> 
> It looks like you two wrote most of this filter.  Can you please take a 
> look at this compilation issue and the numerical implications of the code?
> 
> Thanks,
> -Brad
> 
> -------- Original Message --------
> Subject: [Insight-users] Re: [vtkusers] Porting Problem - Please Help!
> Date: Fri, 26 Mar 2004 14:55:06 -0500
> From: Brad King <brad.king at kitware.com>
> To: gcope at engin.umich.edu
> CC: insight-users at itk.org
> References: <1080180358.40623e86bb17e at engin.mail.umich.edu> 
> <406330B3.6090805 at kitware.com> 
> <1080274751.4063af3fd1c05 at engin.mail.umich.edu>
> 
> gcope at engin.umich.edu wrote:
> > Brad,
> > 
> > Thanks a lot for your help. The exact error is as follows:
> > 
> > itkSparseFieldLevelSetImageFilter.txx(479) : error C2668: 'vcl_sqrt' : ambiguous
> > call to overloaded function
> >         C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xmemory(61) :
> > while compiling class-template member function 'void __thiscall
> > itk::SparseFieldLevelSetImageFilter<class itk::Image<unsigned short,3>,class
> > itk::Image<unsigned short,3> >::
> > UpdateActiveLayerValues(double,class itk::SparseFieldLayer<class
> > itk::SparseFieldLevelSetNode<class itk::Index<3> > > *,class
> > itk::SparseFieldLayer<class itk::SparseFieldLevelSetNode<class itk::Index<3> >
> > 
> >>*)'
> > 
> > 
> > Itk and Vtk both compiled fine. My program includes both Itk and Vtk functions,
> > and the Vtk functions compile correctly on their own.
> > 
> > Let me know if any other info would be helpful.
> 
> It looks like you are instantiating the filter with unsigned short image
> data.  The line containing the error looks like this in the template
> instantiation:
> 
> unsigned short v1, v2;
> ...
> vcl_sqrt(v1/v2);
> 
> This will not work very well for unsigned short data.  Given that the
> filter is doing these kinds of calculations, I suggest you convert the
> image to float or double for now.  I'll bring up this problem with the
> developers to see about fixing the implementation to convert to a
> floating point type for these calculations regardless of the pixel type.
> 
> -Brad
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
>