flaviu2
(Flaviu)
March 31, 2020, 1:47pm
1
I have loaded a CBCT into sitk::Image. And I ran:
sitk::Image imgTemp(imgOrg);
sitk::Image threshold = sitk::BinaryThreshold(imgTemp, 2000, 3600); // let only teeth (tough bones)
sitk::MaskImageFilter mask;
and I see the teeth only (or tough bones):
imgOut = mask.Execute(imgTemp, threshold);
Now I intend to let everything but teeth. For that, I tried:
sitk::Image imgMask = mask.Execute(imgTemp, threshold);
imgOut = sitk::NotEqual(imgTemp, imgMask);
I see only a diffuse cube, Then I tried
sitk::Image imgMask = mask.Execute(imgTemp, threshold);
imgOut = sitk::Not(imgMask);
The same diffuse cube. What filter should I choose in order to let everything but teeth from CBCT ? I appreciate any hint/help !
Regards,
Flaviu.
zivy
(Ziv Yaniv)
March 31, 2020, 2:33pm
2
The filter you are looking for is MaskNegatedImageFilter :
sitk::sitk.MaskNegated(imgTemp, threshold)
flaviu2
(Flaviu)
March 31, 2020, 3:33pm
3
Thank you. I have tried:
sitk::MaskNegatedImageFilter mask;
sitk::Image imgMask = mask.Execute(imgTemp, threshold);
I got:
sitk::ERROR: Failure to convert SimpleITK image of dimension: 3 and pixel type: "8-bit unsigned integer" to ITK image of dimension: 3 and pixel type: "16-bit signed integer"!
Also, I’ve tried:
sitk::MaskNegatedImageFilter mask;
sitk::Image imgMask = mask.Execute(imgTemp, sitk::Cast(threshold, imgTemp.GetPixelID()));
with the same error. Seem to be conversion error ? Or what ?
dchen
(Dave Chen)
March 31, 2020, 3:36pm
4
You diffuse cube might be all right. The values in that image are only 1’s and 0’s. When put in a volume renderer, it might not display well. You could try multiplying the values by 255 to get intensities better suited for volume rendering.
flaviu2
(Flaviu)
April 2, 2020, 10:40am
6
Thank you Dave, I’ve learned something here !