Hi,
I want to read two files, one as a volume and another as a segmentation. The segmentation file is the label map including different segments. I am interested in applying a “joint smoothing” on the adjacent segments. I have several questions in this regard:
- What is the proper way for reading/importing a .nii file as a segmentation with a python code?
- What is the proper way for selecting the desired segments for the joint smoothing function?
- What is the correct syntax for activating the joint smoothing function? I have seen several examples for median smoothing like bellow, but I am missing the syntax for enabling the joint smoothing?
Here is the example for the median filter that I have found:
segmentEditorWidget.setActiveEffectByName(“Smoothing”)
effect = segmentEditorWidget.activeEffect()
effect.setParameter(“SmoothingMethod”, “MEDIAN”)
effect.setParameter(“KernelSizeMm”, 3)
effect.self().onApply()
Thank you in advance for your help.