[Insight-users] Question about itk::ThresholdSegmentationLevelSetImageFilter

jiang jiang at TI.Uni-Trier.DE
Wed, 28 Jan 2004 15:08:56 +0100


Dear ITK-users,
I tried to do image segmentation by
itk::ThresholdSegmentationLevelSetImageFilter. It can work now. Firstly, I
set m_thresholdSegmentation->SetFeatureImage() by read a .png file. Then I
try to set m_thresholdSegmentation->SetFeatureImage() by one
InputImageType::Pointer. But the result is not same as before. The other
settings are totally same. The following is the detail:
In the first case:
   typedef signed short                    PixelType;
   typedef itk::Image<PixelType, 2>        ImageType;

   itk::PNGImageIO::Pointer io;
   io = itk::PNGImageIO::New();
   itk::ImageFileWriter<ImageType>::Pointer writer;

   typedef   float                                   InputPixelType;
   typedef   itk::Image< InputPixelType, 2 >         InputImageType;
   typedef   itk::ImageFileReader<InputImageType >   ReaderType;
   ReaderType::Pointer reader;

   ImageType::Pointer --> writer("ImageFile.png") --> reader
   m_thresholdSegmentation->SetFeatureImage(reader->GetOutput())

In the second case:
   typedef itk::CastImageFilter<ImageType,InputImageType> CasterType;
   CasterType1::Pointer Caster;

   ImageType::Pointer --> Caster
   m_thresholdSegmentation->SetFeatureImage(Caster->GetOutput())


The result of second case is not what I want. How can I get the same result
as first case, but not use "writer" and "reader", directly by Pointer?


Thanks a lot!


Chunyan