[Insight-users] Level Set Segmentation ITK

Gupt adityargupta at gmail.com
Mon Sep 21 18:01:57 EDT 2009


Hello,

I'm using Level Set Segmentation for my project and am trying to develop my
own speed function. I've included the file
itkSegmentationLevelSetImageFilter.h and then was adding some functions to
this file and I realized that with the original header file I'm getting
errors. Below is a very simple program where I'm creating an instance of a
pointer to this filter and I'm getting the error that follows the program.
I've tried changing data types but I'm unable to get rid of this error.
Please help... Thank you.

#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkSegmentationLevelSetImageFilter.h"

int main( int argc, char *argv[] )
{
  typedef   float           InternalPixelType;
  const unsigned int    Dimension = 2;
  typedef itk::Image< InternalPixelType, Dimension >  InternalImageType;
	
	typedef itk::SegmentationLevelSetFunction<InternalImageType,
InternalImageType> SLSfilter;
	
// ACTUAL LEVEL SET starts

	SLSfilter::Pointer multipleLevelSet = SLSfilter::New();
	
  return 0;
}

ERROR:
1>------ Build started: Project: cellSegmentation, Configuration: Debug
Win32 ------
1>Compiling...
1>cellSegmentation.cxx
1>.\cellSegmentation.cxx(32) : error C2440: 'initializing' : cannot convert
from 'itk::SmartPointer<TObjectType>' to 'itk::SmartPointer<TObjectType>'
1>        with
1>        [
1>            TObjectType=itk::LevelSetFunction<InternalImageType>
1>        ]
1>        and
1>        [
1>           
TObjectType=itk::SegmentationLevelSetFunction<InternalImageType,InternalImageType>
1>        ]
1>        No constructor could take the source type, or constructor overload
resolution was ambiguous
1>Build log was saved at "file://c:\Documents and Settings\USER\My
Documents\Visual Studio
2008\Projects\CellSegm01\cellSegmentation.dir\Debug\BuildLog.htm"
1>cellSegmentation - 1 error(s), 0 warning(s)
2>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32
------



Originally I had a longer program with the speed function and I was landing
into the error below. Then I reduced the program to the very basic (above)
and still I get the error. 

1>------ Build started: Project: cellSegmentation, Configuration: Debug
Win32 ------
1>Compiling...
1>cellSegmentation.cxx
1>c:\documents and settings\user\my documents\visual studio
2008\projects\cellsegm01\itkSNAPLevelSetFunction.txx(347) : error C2664:
'itk::VectorLinearInterpolateImageFunction<TInputImage,TCoordRep>::EvaluateAtContinuousIndex'
: cannot convert parameter 1 from
'itk::ContinuousIndex<TCoordRep,VIndexDimension>' to 'const
itk::ContinuousIndex<TCoordRep,VIndexDimension> &'
1>        with
1>        [
1>            TInputImage=itk::Image<itk::FixedArray<float,2>,2>,
1>            TCoordRep=float
1>        ]
1>        and
1>        [
1>            TCoordRep=double,
1>            VIndexDimension=2
1>        ]
1>        and
1>        [
1>            TCoordRep=float,
1>            VIndexDimension=2
1>        ]
1>        Reason: cannot convert from
'itk::ContinuousIndex<TCoordRep,VIndexDimension>' to 'const
itk::ContinuousIndex<TCoordRep,VIndexDimension>'
1>        with
1>        [
1>            TCoordRep=double,
1>            VIndexDimension=2
1>        ]
1>        and
1>        [
1>            TCoordRep=float,
1>            VIndexDimension=2
1>        ]
1>        No user-defined-conversion operator available that can perform
this conversion, or the operator cannot be called


Thank you for your help...

Gupt
-- 
View this message in context: http://www.nabble.com/Level-Set-Segmentation-ITK-tp25530506p25530506.html
Sent from the ITK - Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list