[Insight-users] SliceBySliceImageFilter with ScalarImageKMeansImageFilter

Samuele Dietler samuele_82 at hotmail.com
Fri Nov 20 08:29:17 EST 2009


Hello Itk users,
i try to run the SliceBySliceImageFilter but i don't understand how it work. I have look at the pdf publication in the midas journal with examples and in the forum without success. 
I have a compile problem , when i try to compile it with the ScalaImageKmeansImageFilter ( i want to run slice by slice because i have a ram problem otherwise). 
I will show you a part of the code where is implemented it and the error reported in vs2008.


...
const char * inputImageFileName = argv[1];

  typedef float       PixelType;
  const unsigned int         Dimension = 3;

  typedef itk::Image<PixelType, Dimension > ImageType;
  typedef itk::ImageFileReader< ImageType > ReaderType;

  ReaderType::Pointer reader = ReaderType::New();
  reader->SetFileName( inputImageFileName );

typedef itk::SliceBySliceImageFilter< ImageType, ImageType> FilterType;
FilterType::Pointer filter = FilterType::New();
filter->SetInput(reader->GetOutput());

typedef itk::ScalarImageKmeansImageFilter<FilterType::InternalInputImageType> KMeansFilterType;
KMeansFilterType::Pointer kmeansFilter = KMeansFilterType::New();

filter->SetFilter(kmeansFilter);
  
  const unsigned int numberOfInitialClasses = atoi( argv[4] );


...


The error is :


skin.cxx
2>..\skin\skin.cxx(47) : error C2664: 'itk::SliceBySliceImageFilter<TInputImage,TOutputImage>::SetFilter' : cannot convert parameter 1 from 'itk::SmartPointer<TObjectType>' to 'itk::ImageToImageFilter<TInputImage,TOutputImage> *'
2>        with
2>        [
2>            TInputImage=ImageType,
2>            TOutputImage=ImageType
2>        ]
2>        and
2>        [
2>            TObjectType=itk::ScalarImageKmeansImageFilter<itk::Image<float,2>>
2>        ]
2>        and
2>        [
2>            TInputImage=itk::Image<float,2>,
2>            TOutputImage=itk::Image<float,2>
2>        ]
2>        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called



Does anyone can solve this problem?? 
Thank you, best
Samuele
 		 	   		  
_________________________________________________________________
Condividi e organizza le tue immagini con  Windows Live Foto.

http://www.microsoft.com/windows/windowslive/photos.aspx 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20091120/35ca0a5e/attachment.htm>


More information about the Insight-users mailing list