However, my images contain tissue for which I do not want to apply the filter (i.e., GM and CSF). I already have a mask of the tissue that I do want to apply the filter to (WM). Is there a way to apply a mask when filtering so it is only calculated with the voxels inside the mask?
I don’t think that either HessianToObjectnessMeasureImageFilter or MultiScaleHessianBasedMeasureImageFilter accept a mask. Changing their code to accept a mask should not be hard, though.
Thanks for the info! I am currently using the Python wrapper for ITK as I have no experience with C++ code. I am happy to give this a try though. Is there any template code you could point me to that implements masking already?
Oh I see, I think I am misunderstanding the implementation of the mask. Since the filters I am trying to use are based on relative intensities surrounding the voxels of interest, my results are being overwhelmed by the zeros in the image. I want to calculation to only be performed within the mask, not just mask the results of the overall calculation (hopefully that makes sense). To explain further, I am using these filters to detect “vesselness”, but since the lateral ventricles are “vessel-like” according to the filter, the focus of the resulting mask is in the ventricles and the areas of actual interest in the white matter are de-emphasized or ignored.
The only other solution I could think of is a patch-based method but I would like a more elegant solution if possible.