Skip to main content
. 2023 Aug 23;9(9):169. doi: 10.3390/jimaging9090169
Algorithm 2 Pseudo-code: Based on the total number of slices, this algorithm calculates the number of slices to remove from each end of the slices with tumor range. When the total number of slices to remove is an odd number, we round down (floor) the number of slices to remove from the beginning of the range and round up (ceil) the number of slices to remove from the end of the range.
  • 1:

    function NumberOfSlicesToRemoveFromEachSide(

      total_number_of_slices_with_tumor, total_number_of_slices

      )

  • 2:

        

  • 3:

      Integer number_of_slices_to_remove:=CalcNumOfSlicesToRemove(

       total_number_of_slices_with_tumor, total_number_of_slices

       )

  • 4:

        

  • 5:

      Real number_of_slices_to_remove_on_each_side:=num_of_slices_to_remove/2

  • 6:

        

  • 7:

      return (Tuple<Integer, Integer>) (

       floor(number_of_slices_to_remove_on_each_side),

       ceil(number_of_slices_to_remove_on_each_side)

       )

  • 8:

    end function