[Insight-users] WatershedImageFilter row misalignment problem
(bug?)
Joshua Cates
cates@sci.utah.edu
Mon, 20 May 2002 11:32:54 -0600 (MDT)
Hi Jarek,
Yes this could very well be a bug in the way the input regions are
handled. I'll have a look at this. Should be easy to correct.
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
>