## SPLINE

 Draws a spline curve on an image based upon supplied points

Thanks to Anthony Thyssen for the technique used to draw the blue point circles efficiently

### EXAMPLES

 KBS: Tension=0; Bias=0 --- Variation In End Mode --- Point Set 1 End Mode = None arguments: -s kbs -p blue -e none -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" End Mode = Duplicate arguments: -s kbs -p blue -e duplicate -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" End Mode = Extend arguments: -s kbs -p blue -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" End Mode = Extend arguments: -s kbs -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50"

 KBS: Variation In Tension (Bias=0) --- Point Set 1 Negative Tension arguments: -s kbs -t -0.5 -p blue -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" Neutral Tension arguments: -s kbs -t 0 -p blue -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" Positive Tension arguments: -s kbs -t 0.5 -p blue -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50"

 KBS: Variation In Bias (Tension=0) --- Point Set 1 Negative Bias arguments: -s kbs -b -1 -p blue -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" Neutral Bias arguments: -s kbs -b 0 -p blue -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" Positive Bias arguments: -s kbs -b 1 -p blue -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50"

 Hermite --- Variation In End Mode --- Point Set 1 End Mode = None arguments: -s hermite -p blue -e none -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" End Mode = Duplicate arguments: -s hermite -p blue -e duplicate -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" End Mode = Extend arguments: -s hermite -p blue -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" End Mode = Extend arguments: -s hermite -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50"

 Cubic --- Variation In End Mode --- Point Set 1 End Mode = None arguments: -s cubic -p blue -e none -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" End Mode = Duplicate arguments: -s cubic -p blue -e duplicate -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" End Mode = Extend arguments: -s cubic -p blue -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" End Mode = Extend arguments: -s cubic -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50"

 B-Spline --- Variation In End Mode --- Point Set 1 End Mode = None arguments: -s bspline -p blue -e none -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" End Mode = Duplicate arguments: -s bspline -p blue -e duplicate -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" End Mode = Extend arguments: -s bspline -p blue -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" End Mode = Extend arguments: -s bspline -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50"

 Spline Comparison --- Point Set 1 --- End Mode Extend kbs arguments: -s kbs -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" hermite arguments: -s hermite -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" cubic arguments: -s cubic -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50" bspline arguments: -s bspine -e extend -d 141x101 "20,50 32.5,75 45,50 57.5,25 70,50 82.5,75 95,50 107.5,25 120,50"

 KBS: Variation In Tension (Bias=0) --- Point Set 2: Closed (Counter Clockwise) Square Negative Tension arguments: -s kbs -t -0.5 -p blue -l green1 -e close -d 101x101 "25,25 25,75 75,75 75,25" Neutral Tension arguments: -s kbs -t 0 -p blue -l green1 -e close -d 101x101 "25,25 25,75 75,75 75,25" Positive Tension arguments: -s kbs -t 0.5 -p blue -l green1 -e close -d 101x101 "25,25 25,75 75,75 75,25" Neutral Tension arguments: -s kbs -t 0 -e close -d 101x101 "25,25 25,75 75,75 75,25"

 KBS: Variation In Bias (Tension=0) --- Point Set 2: Closed (Counter Clockwise) Square Negative Bias arguments: -s kbs -b -0.5 -p blue -l green1 -e close -d 101x101 "25,25 25,75 75,75 75,25" Neutral bias arguments: -s kbs -b 0 -p blue -l green1 -e close -d 101x101 "25,25 25,75 75,75 75,25" Positive Bias arguments: -s kbs -b 0.5 -p blue -l green1 -e close -d 101x101 "25,25 25,75 75,75 75,25" Neutral Bias arguments: -s kbs -b 0 -e close -d 101x101 "25,25 25,75 75,75 75,25"

 Hermite: --- Point Set 2: Closed Square arguments: -s hermite -p blue -l green1 -e close -d 101x101 "25,25 25,75 75,75 75,25" arguments: -s hermite -e close -d 101x101 "25,25 25,75 75,75 75,25"

 Cubic: --- Point Set 2: Closed Square arguments: -s cubic -p blue -l green1 -e close -d 101x101 "25,25 25,75 75,75 75,25" arguments: -s cubic -e close -d 101x101 "25,25 25,75 75,75 75,25"

 B-Spline: --- Point Set 2: Closed Square arguments: -s bspline -p blue -l green1 -e close -d 101x101 "25,25 25,75 75,75 75,25" arguments: -s bspline -e close -d 101x101 "25,25 25,75 75,75 75,25"

 Spline Comparison --- Point Set 2 --- End Mode Closed kbs arguments: -s kbs -e close -d 101x101 "25,25 25,75 75,75 75,25" hermite arguments: -s hermite -e close -d 101x101 "25,25 25,75 75,75 75,25" cubic arguments: -s cubic -e close -d 101x101 "25,25 25,75 75,75 75,25" bspline arguments: -s bspine -e close -d 101x101 "25,25 25,75 75,75 75,25"

 Bezier: --- Point Set 3 --- Comparison To IM MVG Bezier arguments: -s bezier -p blue -l green1 -d 141x101 "20,50 45,100 95,0 120,50" arguments: -s bezier -d 141x101 "20,50 45,100 95,0 120,50" IM MVG -draw arguments: -size 141x101 xc:white -fill none -stroke red -draw "bezier 20,50 45,100 95,0 120,50" -draw "fill none stroke green1 line 20,50 45,100 line 95,0 120,50" IM MVG -draw arguments: -size 141x101 xc:white -draw "fill none stroke red bezier 20,50 45,100 95,0 120,50"

 Bezier: --- Point Set 4 --- Comparison To IM MVG Bezier (MVG bezier segments must be drawn individually, not as one long linked list) arguments: -s bezier -p blue -l green1 -d 141x101 "20,50 45,100 45,0 70,50 95,100 95,0 120,50" (note linked segments point sequence: K C C K C C K) arguments: -s bezier -d 141x101 "20,50 45,100 45,0 70,50 95,100 95,0 120,50" (note linked segments point sequence: K C C K C C K) IM MVG -draw arguments: -size 141x101 xc:white -draw "fill none stroke red bezier 20,50 45,100 45,0 70,50 bezier 70,50 95,100 95,0 120,50" -draw "fill none stroke green1 line 20,50 45,100 line 45,0 70,50 line 70,50 95,100 line 95,0 120,50" (note point sequence: K C C K for each segment) IM MVG -draw arguments: -size 141x101 xc:white -draw "fill none stroke red bezier 20,50 45,100 45,0 70,50 bezier 70,50 95,100 95,0 120,50" (note point sequence: K C C K for each segment)

 Bezier: --- Variation In Control Points arguments: -s bezier -p blue -l green1 -d 141x101 "20,50 45,100 45,0 70,50 95,100 95,0 120,50" arguments: -s bezier -p blue -l green1 -d 141x101 "20,50 20,100 70,100 70,50 70,0 120,0 120,50" arguments: -s bezier -p blue -l green1 -d 141x101 "20,50 20,100 70,0 70,50 70,100 120,0 120,50" arguments: -s bezier -d 141x101 "20,50 45,100 45,0 70,50 95,100 95,0 120,50" arguments: -s bezier -d 141x101 "20,50 20,100 70,100 70,50 70,0 120,0 120,50" arguments: -s bezier -d 141x101 "20,50 20,100 70,0 70,50 70,100 120,0 120,50"

 KBS: Tension=0; Bias=0 --- Closed Points On Image Image arguments: -s kbs -t 0 -b 0 -e close -p skyblue -f im_logo_star.txt (see file below) arguments: -s kbs -t 0 -b 0 -e close -f im_logo_star.txt (see file below) arguments: -s kbs -t 0 -b 0 -e close -c purple -i purple -j im_logo_star_ij.txt (see file below) (Plain Text File:) ``` 58,87 64,98 66,112 87,115 95,122 90,134 75,146 82,163 79,174 64,174 48,159 22,176 10,174 7,161 18,140 11,119 11,108 17,103 32,103 44,92 ``` (ImageJ "pointpicker" file) ``` point x y slice color 0 58 87 1 0 1 64 98 1 1 2 66 112 1 2 3 87 115 1 3 4 95 122 1 4 5 90 134 1 5 6 75 146 1 6 7 82 163 1 7 8 79 174 1 8 9 64 174 1 9 10 48 159 1 10 11 22 176 1 11 12 10 174 1 12 13 7 161 1 13 14 18 140 1 14 15 11 119 1 15 16 11 108 1 16 17 17 103 1 17 18 32 103 1 18 19 44 92 1 19 ``` ImageJ and pointpicker plugin

 KBS Spline --- Point Set 5: Closed Square --- Extreme Changes In Negative Tension tension=0 arguments: -s kbs -t 0 -e close -d 100x60 -c firebrick -i red -sw 2 "32.3,12.3 32.3,47.7 67.7,47.7 67.7,12.3" tension=-0.6 (circle) arguments: -s kbs -t -0.6 -e close -d 100x60 -c firebrick -i red -sw 2 "32.3,12.3 32.3,47.7 67.7,47.7 67.7,12.3" tension=-1 arguments: -s kbs -t -1 -e close -d 100x60 -c firebrick -i red -sw 2 "32.3,12.3 32.3,47.7 67.7,47.7 67.7,12.3" tension=-2 arguments: -s kbs -t -2 -e close -d 100x60 -c firebrick -i red -sw 2 "32.3,12.3 32.3,47.7 67.7,47.7 67.7,12.3" tension=-3 arguments: -s kbs -t -3 -e close -d 100x60 -c firebrick -i red -sw 2 "32.3,12.3 32.3,47.7 67.7,47.7 67.7,12.3" tension=-4 arguments: -s kbs -t -4 -e close -d 100x60 -c firebrick -i red -sw 2 "32.3,12.3 32.3,47.7 67.7,47.7 67.7,12.3"

 KBS Spline --- Point Set 5: Closed Square --- Extreme Changes In Positive Tension tension=0 arguments: -s kbs -t 0 -e close -d 100x60 -c firebrick -i red -sw 2 "32.3,12.3 32.3,47.7 67.7,47.7 67.7,12.3" tension=0.6 arguments: -s kbs -t 0.6 -e close -d 100x60 -c firebrick -i red -sw 2 "32.3,12.3 32.3,47.7 67.7,47.7 67.7,12.3" tension=1 (square) arguments: -s kbs -t 1 -e close -d 100x60 -c firebrick -i red -sw 2 "32.3,12.3 32.3,47.7 67.7,47.7 67.7,12.3" tension=2 arguments: -s kbs -t 2 -e close -d 100x60 -c firebrick -i red -sw 2 "32.3,12.3 32.3,47.7 67.7,47.7 67.7,12.3" tension=3 arguments: -s kbs -t 3 -e close -d 100x60 -c firebrick -i red -sw 2 "32.3,12.3 32.3,47.7 67.7,47.7 67.7,12.3" tension=4 arguments: -s kbs -t 4 -e close -d 100x60 -c firebrick -i red -sw 2 "32.3,12.3 32.3,47.7 67.7,47.7 67.7,12.3"

 What the script does is as follows: Reads data points Spline interpolates Draws interpolated polyline