[Insight-users] WatershedImageFilter row misalignment problem (bug?)

Joshua Cates cates@sci.utah.edu
Mon, 20 May 2002 17:47:24 -0600 (MDT)


Hi Jarek,

I think I must have misread your email the first time.  Sounds like your
problem might just be in the way you are visualizing your output.  Double
check that you have specified the correct image size, sounds like you
might have the X dimension one more than it should be.  Would it be
possible for you to send me your input and output images?  This would help
to track down the problem.

Josh.

______________________________
 Josh Cates
 School of Computer Science
 University of Utah
 Email: cates@sci.utah.edu
 Phone: (801) 587-7697
 URL:   www.cs.utk.edu/~cates


On Mon, 20 May 2002, Jarek Sacha wrote:

>
> WatershedImageFilter row misalignment problem (bug?)
>
> I was trying to create a very simple program that loads a 2D image
> from a file, runs it through a watershed filter, and saves output
> (basic segmentation) to a file. The code is something like this:
>
>   typedef WatershedImageFilter<InputImageType> WatershedFilterType;
>   typedef WatershedFilterType::Pointer WatershedFilterPointer;
>
>   InputImagePointer inputImage = readImagePNG(inputFileName);
>
>   WatershedFilterPointer filter = WatershedFilterType::New();
>   filter->SetThreshold(0);
>   filter->SetLevel(1);
>   filter->SetInput(inputImage);
>
>   OutputImagePointer ouputImage = filter->GetBasicSegmentation();
>
>   filter->Update();
>   writeImageRaw(ouputImage, outputFileName);
>
> The problem is that the output image has missaligned raws. Each row is
> shifted by one pixel to the right in relation to previous row. This is
> probably due to assumption made in WatersheadSegmenter::GenerateData()
> method about one pixel padding. However, the WatershedImageFilter
> documentation does not mention anything about requiring padding in the
> input image.
>
> Not counting the missalignmentm, the segmentation seems to be correct.
> Is this a bug in the WatershedImageFilter? Am I setting the
> WatershedImageFilter correctly?
>
> Thanks,
>
> Jarek
>
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>