[Insight-users] "In place" filtering
David Doria
daviddoria at gmail.com
Mon Oct 25 11:43:32 EDT 2010
On Mon, Oct 25, 2010 at 1:44 AM, Dan Mueller <dan.muel at gmail.com> wrote:
> Hi David,
>
> As Karthik says, a true "in-place" filter overwrites each pixel of the
> input buffer with the resultant output pixel value and then passes the
> input buffer as its output. All filters capable of this should inherit
> from itk::InPlaceImageFilter (if you find one that doesn't, please let
> us know). You to turn on/off this functionality eg.
> filter->InPlaceOn(), filter->InPlaceOff().
>
> The itk::MeanImageFilter does not inherit from
> itk::InPlaceImageFilter, the reason being it is a neighbourhood
> operation; neighbourhood operations *cannot* be run in-place (the
> output for one pixel may be used as the input for another pixel!).
>
> The best you can do is use the ReleaseDataFlagOn() method Karthik
> described first.
>
> HTH
>
> Cheers, Dan
Ok, lets take filters that do derive from InPlaceImageFilter for the moment.
Here is the structure:
http://www.itk.org/Wiki/ITK/Examples/Broken/Images/InPlace
The image that is displayed is still the non-thresholded version even
though I set InPlaceOn in the threshold filter in the
ApplyThresholding function.
It seems like the reader is trying to set the readers output and the
ApplyThresholding function is also trying to set that same data. Is
there 1) a way to separate 'image' from the reader before sending it
for filtering? or 2) a way to do this inplace filtering without
breaking off from the pipeline?
Thanks for your help so far,
David
More information about the Insight-users
mailing list