Lowpass filter: As mentioned before, EMC_maskReference was applying an extended lowpassRoll with fsc=true, similar to what is applied with fsc=false. Now, EMC_maskReference follows BH_mask3d and applies the default lowpassRoll with fsc=true.
The mask used for the COM was not the correct one (if fsc=true). Now it is fixed and I renamed currentMask to binaryMask to make it clearer.
the dilation is fixed and gives exactly the same results as BH_mask3d
EMC_maskReference is almost giving exactly the same results as BH_mask3d. The only small difference comes from the lowpass filter (only with fsc=true) that has a larger roll-off with EMC_getBandpass than BH_bandpass3d. Using the lowpass filters from BH_bandpass3d gives exactly the same masks, which makes me think that is the only different between EMC_maskReference and BH_bandpass3d.
EMC_centerOfMass:
At the end, I didn't add the MASK... If you want to use a mask, apply it to the input image directly?
Furthermore, I think in most cases, if not all, min(binaryVol(MASK > 0.01)) (line 341 of BH_bandpass3d) is equal to 0 with fscMask. With the example I tested, the COM is almost exactly the same as BH_mask3d and the only difference comes from the lowpass filter (when I use BH_bandpass3d, I have the exact same COM as BH_mask3d).
EMC_maskReference:
EMC_maskReference is almost giving exactly the same results as BH_mask3d. The only small difference comes from the lowpass filter (only with fsc=true) that has a larger roll-off with EMC_getBandpass than BH_bandpass3d. Using the lowpass filters from BH_bandpass3d gives exactly the same masks, which makes me think that is the only different between EMC_maskReference and BH_bandpass3d.
EMC_centerOfMass:
At the end, I didn't add the MASK... If you want to use a mask, apply it to the input image directly? Furthermore, I think in most cases, if not all,
min(binaryVol(MASK > 0.01))
(line 341 of BH_bandpass3d) is equal to 0 with fscMask. With the example I tested, the COM is almost exactly the same as BH_mask3d and the only difference comes from the lowpass filter (when I use BH_bandpass3d, I have the exact same COM as BH_mask3d).