[Insight-users] WG: Abnormal termination error with erotion
filter!!!
Joshua Cates
cates at sci . utah . edu
Fri, 30 May 2003 10:35:06 -0600 (MDT)
Instead of Update(), try calling UpdateLargestPossibleRegion().
Josh.
______________________________
Josh Cates
School of Computer Science
University of Utah
Email: cates at sci . utah . edu
Phone: (801) 587-7697
URL: http://www . sci . utah . edu/~cates
On Fri, 30 May 2003, salah wrote:
> I am almost sure, it is a bug in the erosion filter.
>
> It works fine many times as long as you feed it
> with images of the same dimensions. It will terminate
> the program abnormally if you re-run it with an image
> of new dimensions.
>
> Could anybody please verify this...
> Zein
>
> > -----Ursprüngliche Nachricht-----
> > Von: salah
> > Gesendet: Freitag, 30. Mai 2003 16:34
> > An: 'Insight-users at public . kitware . com'
> > Cc: 'luis . ibanez at kitware . com'
> > Betreff: WG: Abnormal termination error with erotion filter!!!
> >
> >
> >
> > Hello all,
> >
> > I am using the GrayscaleFunctionErodeImageFilter.
> > exactly as show in this piece of code
> > ========================================================
> > // this piece is in the header file of my class
> > typedef itk::GrayscaleFunctionErodeImageFilter<InputImageType,
> > ImageType, KernelType> InputErotionFilterType;
> > InputErotionFilterType::Pointer m_Eroder;
> >
> > // in the constructor of my class
> > m_Eroder = InputErotionFilterType::New();
> >
> > // in the erosion method of my class
> > KernelType::SizeType ballSize;
> > KernelType ball; // Structuring element
> > ballSize[0] = rad; ballSize[1] = rad; ballSize[2] = rad;
> > ball.SetRadius(ballSize);
> > ball.CreateStructuringElement();
> >
> > m_Eroder->SetInput( m_InputImage );
> > m_Eroder->SetKernel( ball );
> > m_Eroder->Update();
> > m_ErodedImage = m_Eroder->GetOutput();
> > ======================================================
> >
> > There is one instant of the erosion filter (m_Eroder) in my
> > appliation. It is created in the constractor of the base class
> > of my application. The erosion method is called by pressing
> > a button in the UI.
> >
> > I have the following problem with this combination:
> >
> > The erosion filter works fine when I call it for the first time.
> > It also works fine if I change the radius of the structuring
> > element and re-run the filter on the same image. Moreover,
> > it works fine if feed it with a new input image of the same
> > dimensions of the first image. BUT, if I feed it with an image
> > of some new different dimensions. The program exits with
> > an abnormal termination error message!!!!!
> >
> > I tried to trace the program. It crashes exactly at the
> > m_Eroder->Update();
> > statement....
> >
> > Did anybody have such a problem?? Could anybody please
> > guess what it could be??
> >
> > I think the problem COULD be solved if there WERE some way
> > to "RESET" the instance of the filter, of cource without deleting
> > it or re-calling ::New();
> >
> >
> > Thanks a lot ,,,,
> >
> > Zein
> >
> > ->8<------------->8<------------->8<------------->8<------------->8<------------->8<-
> > Zein I. Salah
> > University of Tübingen, WSI-GRIS, Sand 14, 72076 Tübingen
> > Email: salah at gris . uni-tuebingen . de
> > Tel.: (07071) 29 75465 (GRIS), Fax: (07071) 29 54 66
> >
> _______________________________________________
> Insight-users mailing list
> Insight-users at public . kitware . com
> http://public . kitware . com/mailman/listinfo/insight-users
>