|
From: <kin...@us...> - 2024-07-11 21:47:33
|
Revision: 7200
http://sourceforge.net/p/teem/code/7200
Author: kindlmann
Date: 2024-07-11 21:47:30 +0000 (Thu, 11 Jul 2024)
Log Message:
-----------
debugging scripts, maybe done?
Modified Paths:
--------------
teem/trunk/src/limn/test/00-data.sh
teem/trunk/src/limn/test/03-single.sh
teem/trunk/src/limn/test/04-multi.sh
Added Paths:
-----------
teem/trunk/src/limn/test/05-go.sh
Modified: teem/trunk/src/limn/test/00-data.sh
===================================================================
--- teem/trunk/src/limn/test/00-data.sh 2024-07-11 18:38:10 UTC (rev 7199)
+++ teem/trunk/src/limn/test/00-data.sh 2024-07-11 21:47:30 UTC (rev 7200)
@@ -45,4 +45,4 @@
unu join -i - y -a 0 -incr |
unu crop -min 0 0 -max M M-1 -o circ.txt
-unu 2op spow circ.txt 3 -o pointy.txt
+unu 2op spow circ.txt 4 -o pointy.txt
Modified: teem/trunk/src/limn/test/03-single.sh
===================================================================
--- teem/trunk/src/limn/test/03-single.sh 2024-07-11 18:38:10 UTC (rev 7199)
+++ teem/trunk/src/limn/test/03-single.sh 2024-07-11 21:47:30 UTC (rev 7200)
@@ -37,23 +37,25 @@
# because the nrp parms that make sense for a small number of points don't work great
# for a huge number of points
-# # Good debugging test case, N=18 is a bad fit, N=19 is a perfect fit
+# # Good debugging test case: N=18 is a bad fit, N=19 is a perfect fit
+# BUT THEN the improved delta_t fixed this; so both are equally good!
# # likely due to initial arc-length parameterization being bad, and nrp stuck in local minima
-# N=18
-# # with -ftt 1 0 -0.8944 0.4472
-# echo "-0.5 0.5
-# 2.0 0.5
-# -0.5 0.0
-# 0.5 -0.5" | unu 2op x - 1 | ...
+#N=18
+#echo "-0.5 0.5
+# 2.0 0.5
+#-0.5 0.0
+# 0.5 -0.5" | unu 2op x - 1 | unu 2op + - 0.0 | ./lpu cbfit -i - -synthn $N -sup 1 -syntho xy-inn-$N.txt
-N=80
-echo "-0.5 -1
- -1 1
-1 1
-0.5 -1" | unu 2op x - 1 | unu 2op + - 0.0 | ./lpu cbfit -i - -synthn $N -sup 1 -syntho xy-inn-$N.txt
+# This is demo of why we might want a step that optimizes tangent directions
+# after the parameterization has been found
+N=42
+echo "-1 -1
+ 1 1.5
+-1 1.5
+ 1 -1" | unu 2op x - 1 | unu 2op + - 0.0 | ./lpu cbfit -i - -synthn $N -sup 3 -syntho xy-inn-$N.txt
junk xy-inn-$N.txt
-CMD="./lpu cbfit -i xy-inn-$N.txt -scl 0 -fs 0 -1 -v 0 -psi 1000000000 -nim 400 -deltathr 0.000000000001"
+CMD="./lpu cbfit -i xy-inn-$N.txt -scl 0 -fs 0 -1 -v 1 -psi 1000000000 -nim 4000 -deltathr 0.000000000001"
echo "====== $CMD"
eval $CMD > log.txt
cat log.txt; junk log.txt
Modified: teem/trunk/src/limn/test/04-multi.sh
===================================================================
--- teem/trunk/src/limn/test/04-multi.sh 2024-07-11 18:38:10 UTC (rev 7199)
+++ teem/trunk/src/limn/test/04-multi.sh 2024-07-11 21:47:30 UTC (rev 7200)
@@ -33,19 +33,6 @@
# https://devmanual.gentoo.org/tools-reference/bash/
unset UNRRDU_QUIET_QUIT
-# why changing N can significantly change the fit:
-# because the nrp parms that make sense for a small number of points don't work great
-# for a huge number of points
-
-# # Good debugging test case, N=18 is a bad fit, N=19 is a perfect fit
-# # likely due to initial arc-length parameterization being bad, and nrp stuck in local minima
-# N=18
-# # with -ftt 1 0 -0.8944 0.4472
-# echo "-0.5 0.5
-# 2.0 0.5
-# -0.5 0.0
-# 0.5 -0.5" | ./lpu cbfit -i - -synth $N ...
-
N=199
echo "-1 -1
-1 1
@@ -62,8 +49,6 @@
#IN=pointy.txt
IN=circ.txt
-# TODO: figure out why this is generating NON-geometrically continuous segments
-
CMD="./lpu cbfit -i $IN -scl 0 -fm 0 -1 -v 2 -psi 3 -eps 0.01"
echo "====== $CMD"
eval $CMD > log.txt
@@ -71,8 +56,8 @@
OUT=xy-out.txt
echo "====== RESULTS: --> $OUT"
-grep "^ " log.txt | xargs -n 10 echo | cut -d' ' -f 1,2,3,4,5,6,7,8
-grep "^ " log.txt | xargs -n 10 echo | cut -d' ' -f 1,2,3,4,5,6,7,8 |
+grep "^seg" log.txt | xargs -n 12 echo | cut -d' ' -f 2,3,4,5,6,7,8,9
+grep "^seg" log.txt | xargs -n 12 echo | cut -d' ' -f 2,3,4,5,6,7,8,9 |
./lpu cbfit -i - -synthn $((5*N)) -sup 1 -syntho $OUT
junk $OUT
@@ -81,6 +66,7 @@
unu jhisto -i $IN $MM -b $BIN $BIN | unu quantize -b 8 -max 1 -o xy-inn.png
unu jhisto -i $OUT $MM -b $BIN $BIN | unu quantize -b 8 -max 1 -o xy-out.png
+rm -f tmp.png
unu join -i xy-{out,inn,out}.png -a 0 -incr |
unu resample -s = x2 x2 -k box -o tmp.png
Added: teem/trunk/src/limn/test/05-go.sh
===================================================================
--- teem/trunk/src/limn/test/05-go.sh (rev 0)
+++ teem/trunk/src/limn/test/05-go.sh 2024-07-11 21:47:30 UTC (rev 7200)
@@ -0,0 +1,76 @@
+#!/usr/bin/env bash
+#
+# Teem: Tools to process and visualize scientific data and images
+# Copyright (C) 2009--2024 University of Chicago
+# Copyright (C) 2005--2008 Gordon Kindlmann
+# Copyright (C) 1998--2004 University of Utah
+#
+# This library is free software; you can redistribute it and/or modify it under the terms
+# of the GNU Lesser General Public License (LGPL) as published by the Free Software
+# Foundation; either version 2.1 of the License, or (at your option) any later version.
+# The terms of redistributing and/or modifying this software also include exceptions to
+# the LGPL that facilitate static linking.
+#
+# This library is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License along with
+# this library; if not, write to Free Software Foundation, Inc., 51 Franklin Street,
+# Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+# 03 = FOURTH stage of testing- another test limnCbfSingle, via lpu cbfit -fs,
+# but with completely free-form input
+
+set -o errexit
+set -o nounset
+shopt -s expand_aliases
+JUNK=""
+function junk { JUNK="$JUNK $@"; }
+function cleanup { rm -rf $JUNK; }
+trap cleanup err exit int term
+# https://devmanual.gentoo.org/tools-reference/bash/
+unset UNRRDU_QUIET_QUIT
+
+N=199
+echo "-1 -1
+-1 1
+ 1 1
+ 0 0" | ./lpu cbfit -i - -synthn $N -syntho 0.txt
+echo "0 0
+-0.5 -0.5
+1 -1
+1 1" | ./lpu cbfit -i - -synthn $N -syntho 1.txt
+cat 0.txt 1.txt | uniq > xy-inn.txt
+junk {0,1}.txt xy-inn.txt
+
+IN=xy-inn.txt
+#IN=pointy.txt
+#IN=circ.txt
+
+CMD="./lpu cbfit -i $IN -scl 0.5 -v 0 -psi 3 -eps 0.003 -roll 0"
+echo "====== $CMD"
+eval $CMD > log.txt
+cat log.txt # ; junk log.txt
+
+OUT=xy-out.txt
+echo "====== RESULTS: --> $OUT"
+grep "^seg" log.txt | xargs -n 12 echo | cut -d' ' -f 2,3,4,5,6,7,8,9
+grep "^seg" log.txt | xargs -n 12 echo | cut -d' ' -f 2,3,4,5,6,7,8,9 |
+ ./lpu cbfit -i - -synthn $((5*N)) -sup 1 -syntho $OUT
+junk $OUT
+
+BIN=900
+MM="-min -1.1 1.1 -max 1.1 -1.1"
+unu jhisto -i $IN $MM -b $BIN $BIN | unu quantize -b 8 -max 1 -o xy-inn.png
+unu jhisto -i $OUT $MM -b $BIN $BIN | unu quantize -b 8 -max 1 -o xy-out.png
+
+rm -f tmp.png
+
+unu join -i xy-{out,inn,out}.png -a 0 -incr |
+ unu resample -s = x2 x2 -k box -o tmp.png
+
+unu cksum tmp.png # with corners, is it stable w.r.t. -roll ?
+
+open tmp.png
Property changes on: teem/trunk/src/limn/test/05-go.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|