Here's my best explanation. I had to look some stuff up from the reference
http://gmic.sourceforge.net/reference.shtml-verbose - -repeat @# -local[$>] ## set log messages to verbose, repeat for the number of images in the list, start local processing on image with the same number as the current repeat/done loop
-split_opacity ## split image to one non-alpha and one image represtning the alpha channel. The image list should contian two images.
-if {@#>1} ## if the number of image sn the list is greater than 1 then
-ge[-1] 50% ## apply a threshold at greater than or equal to 50% value on image [-1] (the last imeg in the image list which was the alpha chanel)
-*[-2] [-1] ## multiply the second to last image [-2] by the last image [-1]
sigma=$1 ## set varible 'sigma' to the first user input value
-do
N={v=round(3*$sigma);min(33,max(3,v+1-(v%2)))} ## set variable 'N' to the result of that math
$N,$N ## create a new image at the end of he image list that is NxN diminsions with defualt vaules of 1 channel ans pixels vaules of zero
-=[-1] 1,50%,50% # set the centre pixel value to 1
-distance[-1] 1 ## Compute the unsigned distance function to specified isovalue or coordinates.
-*[-1] {-1/$sigma^2} # multiply the last image in the list buy {-1/$sigma^2}
-exp[-1] # Compute the pointwise exponential of the last image [-1].
-normalize_sum[-1] # Normalize selected images with a unitary sum.
--convolve[-3,-2] [-1] ## convolve the 3rd to last and the 2nd to last images in the list by the last image in the list, and create a new image with the result at the end of the image list
-rm[-3] # remove the third to last image
-max[-1] 1e-5 # find the maximum value in the last image in the list comapre to 1e-5
-/[-2,-1] # divide the second to last image and the last image and keep only the result
--dilate[-2] {v=round((1/3-$N/6)*$3+$N/2);max(3,v+1-(v%2))}
# dilate the second to last image in the list with radius={v=round((1/3-$N/6)*$3+$N/2);max(3,v+1-(v%2))}
--[-3] [-1] # subtract image[-1] from image[-3]
-*[-2] [-3] # multiply image[-2] by image[-3]
-rm[-3] # remove image[-3]
--[-3,-2] # subtract images and only keep the result
sigma={$sigma*$2} # change vaule of 'sigma' to sigma* user input number 2
-while {!im} # end of do-while loop, 'im' means lowest value of an image but I'm not sure exactly what {!im} means
-rm[-1] ## remove the last image in the image list
-endif
-endl # end local processing
-done # end of repeat-done loop
-v +