[Insight-users] reusing Filters

Frederic Perez fredericpcx at gmail.com
Thu Apr 21 06:48:28 EDT 2005


Hello marquis2,

please take a look at
http://public.kitware.com/pipermail/insight-users/2003-December/005975.html
Hopefully it describes what you need.

Cheers,

Frederic Perez

On 4/21/05, marquis2 at etu.unige.ch <marquis2 at etu.unige.ch> wrote:
> hi,
> 
> is it ok to reuse a filter many times or does it have to be instanciated 
once
> per use ? the docs suggests the first but I have a SIGABRT with a
> BinnaryThresholdImageFilter< ImageType, ImageType >
> (with ImageType = short, 2) for every _second_ image I want to filter:
> 
> Program received signal SIGABRT, Aborted.
> [Switching to Thread 16384 (LWP 12578)]
> 0x4096cb71 in kill () from /lib/i686/libc.so.6
> (gdb) bt
> #0 0x4096cb71 in kill () from /lib/i686/libc.so.6
> #1 0x4080bcf1 in pthread_kill () from /lib/i686/libpthread.so.0
> #2 0x4080c00b in raise () from /lib/i686/libpthread.so.0
> #3 0x4096c904 in raise () from /lib/i686/libc.so.6
> #4 0x4096de8c in abort () from /lib/i686/libc.so.6
> #5 0x40910305 in __cxxabiv1::__terminate(void (*)()) () from
> /usr/lib/libstdc++.so.5
> #6 0x40910342 in std::terminate() () from /usr/lib/libstdc++.so.5
> #7 0x409104c2 in __cxa_throw () from /usr/lib/libstdc++.so.5
> #8 0x081c9fe2 in itk::DataObject::PropagateRequestedRegion() ()
> #9 0x081d964a in 
itk::ProcessObject::PropagateRequestedRegion(itk::DataObject*)
> ()
> #10 0x081c9e7f in itk::DataObject::PropagateRequestedRegion() ()
> #11 0x081c9cb5 in itk::DataObject::Update() ()
> 
> code is:
> 
> thresholdFilter->SetInput(image);
> thresholdFilter->SetLowerThreshold( threshold );
> thresholdFilter->SetUpperThreshold( itk::NumericTraits< PixelType 
>::max());
> thresholdFilter->SetOutsideValue( 0 ) ;
> thresholdFilter->SetInsideValue( white );
> thresholdFilter->Update();
> 
> is there other "cleaning"
> I should make between each use so that it does not crash on the second?
> 
> My code works fine with ::New() before each use.
> 
> TIA for any help!
> Samuel
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050421/6db6e911/attachment.html


More information about the Insight-users mailing list