BME Frontiers / 2022 / Article / Alg 1

Research Article

Weakly- and Semisupervised Probabilistic Segmentation and Quantification of Reverberation Artifacts

Algorithm 1

False Positive Removal, where is the image size, denotes the cluster each pixel belongs to (if a pixel does not belong to any cluster then its value in would be ), and is the output artifact mask with false positives removed. The outer loop with and iterates trough all the pixels that have a value larger than zero in the mask , if the pixel does not belong to any cluster (i.e., ), then we push the pixel into a newly created stack and set the cluster of the pixel to . Inside the loop, while the stack is not empty, we pop out a pixel from the stack and search within an ellipse around it (i.e., , where is the pixel within the ellipse). If the does not belong to any cluster, then we also push this pixel onto stack and set the cluster of the pixel to . After the stack is empty, we increase by , meaning that we move onto the next cluster for the next iteration of the outer loop. After all the pixels have been clustered, we continue to examine if a cluster is below and close enough to the needle. If it is, we include that cluster of artifacts in our output .
Data:,
Result:: Artifact mask with false positives removed
input image size
; ;
Forwheredo
Ifthen
  Create stack ;
  ; ;
  Whileis not emptydo
   ;
   Forwheredo
    Ifthen
     ; ;
  ;
;
Fordo
;
If, and, s.t. belowandthen