AW: [Insight-users] Question about itk::ThresholdSegmentationLevelSetImageFilter

jiang jiang at TI.Uni-Trier.DE
Thu, 29 Jan 2004 11:13:39 +0100


Thank Joshua, thank Luis,
I would explain my question again. I want to use
itk::ThresholdSegmentationLevelSetImageFilter to segment one image. In the
first case, I store the image data to one .png file, then read this .png
file as itk::ThresholdSegmentationLevelSetImageFilter->SetFeatureImage().
The other settings of the filter are same as the example
InsightApplications-1.4.0\ThresholdSegmentationLevelSetFltkGui. It works
fine. The seed contour propagates to the real contour in the image during
the iterations.
In the second case I want to input image data dirrectly to
filter->SetFeatureImage() without writting it to .png file. And I don't
change the other settings of the filter. When I run it,the seed contour
shrinks during the iterations, and disappears at last.
The image data is same, but the results are not same. I want to know what
happens to the image data when it is written to .png file, and read by
ImageFileReader, too.
In the second case, I cast the image data to float type, because
  typedef   itk::ThresholdSegmentationLevelSetImageFilter<
                            InputImageType,
                            InputImageType >

ThresholdSegmentationLevelSetImageFilterType;

The input data type of the filter should be float.


I don't know if my description is clear this time. Could you tell me how can
I solve this problem?
Thank you again!


Chunyan


-----Ursprungliche Nachricht-----
Von: Luis Ibanez [mailto:luis.ibanez at kitware.com]
Gesendet: Mittwoch, 28. Januar 2004 18:03
An: jiang
Cc: ITK
Betreff: Re: [Insight-users] Question about
itk::ThresholdSegmentationLevelSetImageFilter



Hi Chuyan,


Your message is quite unclear.

Could you please clarify what you are attemting to do ?

Or, maybe post the entire piece of code with
all the typedefs that you are using.


Your description of

    "the result is not what I want"

doesn't tell us much...

Maybe you could open an account in MyPACS
and post the input images, the correct output
of your first case and the 'incorrect' output
of your second case.

Please go to

    http://www.mypacs.net

and once you post your images, let us know
of the image ID's.


------


BTW You don't need to explicitly setup the ImageIO
object of the ImageFileWriter. The extension of
the filename is enough for selecting the fileformat.
Simply make sure that your file name has extension ".png"



Regards,


    Luis


--------------------
jiang wrote:

> 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
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>