1
! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3
! MIDAS procedure shrink.prg for SHRINK/IMAGE
6
! use via SHRINK/IMAGE input output option
7
! with option = minimum, maximum, mean, median, ...
9
! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11
define/param p1 ? ima "Enter input image:"
12
define/param p2 ? ima "Enter output image:"
13
define/param p3 mean C "Enter option: "
16
define/local dim/i/1/1 0
17
dim = m$value({p1},naxis)
19
define/local area/c/1/6 row
20
else if dim .eq. 3 then
21
define/local area/c/1/6 plane
25
define/local optio/c/1/2 sn
26
define/local statval/c/1/6 mean
27
define/local statname/c/1/12 "mean "
29
branch p3(1:3) MIN,MAX,MED,MOM,MOD,STD,TOT MIN,MAX,MED,MOM,MOD,STD,TOT
30
goto run_it !all local keyw. defaulted to Mean
45
optio(1:1) = "g" !get exact median
51
optio(1:1) = "r" !get 3rd or 4th moment
52
if p3(4:4) .eq. "3" then
54
statname = "3. moment "
57
statname = "4. moment "
62
optio(1:1) = "f" !get 1st mode or mode
63
if p3(4:5) .eq. "E1" then
73
optio(1:1) = "s" !get standard deviation
75
statname = "std. dev. "
79
optio(1:1) = "r" !get total intensity
81
statname = "tot. intens "
84
statistics/image {p1} {area} ? ? {optio} {p2},i,{statval}
86
write/out image `{p2}' with {statname} of {area}s "of input_image created"