[Insight-users] MaskImageFilter performance

Zakariyya Mughal zaki.mughal at gmail.com
Thu Sep 16 16:14:56 EDT 2010


Hello,

I am trying to benchmark itk::MaskImageFilter and it seems that applying a 50%
mask first in the pipeline executes slower than without the mask.  Is there an
efficient way to define an arbitrary region of interest in ITK using a mask?

Here is a snippet of my code:
---
typedef itk::DiscreteGaussianImageFilter< ImageType, ImageType >	ConvolutionFilter;
typedef itk::MaskImageFilter< ImageType, ImageType, ImageType >		MaskFilter;

ImageType::Pointer input, mask;
// ...
MaskFilter::Pointer mask_filt = MaskFilter::New();
mask_filt->SetInput1(input);
mask_filt->SetInput2(mask);

ConvolutionFilter::Pointer convolve = ConvolutionFilter::New();
ConvolutionFilterolve->SetInput(mask_filt->GetOutput());
convolve->Update();
---

Thanks,
- Zakariyya


More information about the Insight-users mailing list