You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(19) |
Nov
(45) |
Dec
(80) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(58) |
Feb
(127) |
Mar
(74) |
Apr
(34) |
May
(117) |
Jun
(14) |
Jul
(26) |
Aug
(13) |
Sep
(1) |
Oct
(38) |
Nov
(13) |
Dec
(5) |
| 2005 |
Jan
(108) |
Feb
(134) |
Mar
(54) |
Apr
(133) |
May
(16) |
Jun
(54) |
Jul
(128) |
Aug
(99) |
Sep
(157) |
Oct
(182) |
Nov
(236) |
Dec
(212) |
| 2006 |
Jan
(86) |
Feb
(76) |
Mar
(121) |
Apr
(27) |
May
(7) |
Jun
(1) |
Jul
(6) |
Aug
(28) |
Sep
(1) |
Oct
(27) |
Nov
(5) |
Dec
|
| 2007 |
Jan
(32) |
Feb
(22) |
Mar
(22) |
Apr
(11) |
May
(3) |
Jun
(12) |
Jul
(11) |
Aug
(9) |
Sep
(37) |
Oct
(4) |
Nov
(9) |
Dec
(51) |
| 2008 |
Jan
(7) |
Feb
(31) |
Mar
(46) |
Apr
(31) |
May
(5) |
Jun
(27) |
Jul
(12) |
Aug
(5) |
Sep
(13) |
Oct
(24) |
Nov
(112) |
Dec
(15) |
| 2009 |
Jan
(6) |
Feb
(103) |
Mar
(66) |
Apr
(9) |
May
(8) |
Jun
(1) |
Jul
(20) |
Aug
(9) |
Sep
(2) |
Oct
(81) |
Nov
(88) |
Dec
(30) |
| 2010 |
Jan
(65) |
Feb
(57) |
Mar
(22) |
Apr
(12) |
May
(4) |
Jun
(12) |
Jul
(43) |
Aug
(6) |
Sep
(6) |
Oct
(4) |
Nov
(6) |
Dec
(3) |
| 2011 |
Jan
(10) |
Feb
(27) |
Mar
(11) |
Apr
(9) |
May
(69) |
Jun
(73) |
Jul
(67) |
Aug
(116) |
Sep
(40) |
Oct
(11) |
Nov
(34) |
Dec
(19) |
| 2012 |
Jan
|
Feb
(4) |
Mar
(28) |
Apr
(18) |
May
(9) |
Jun
(7) |
Jul
(4) |
Aug
(155) |
Sep
(264) |
Oct
(172) |
Nov
(15) |
Dec
(40) |
| 2013 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
(20) |
Jul
(76) |
Aug
(67) |
Sep
(49) |
Oct
(27) |
Nov
(3) |
Dec
(3) |
| 2014 |
Jan
(7) |
Feb
(7) |
Mar
(16) |
Apr
|
May
(4) |
Jun
(1) |
Jul
(18) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2015 |
Jan
(6) |
Feb
(5) |
Mar
(3) |
Apr
(23) |
May
(5) |
Jun
|
Jul
(2) |
Aug
(4) |
Sep
|
Oct
|
Nov
(2) |
Dec
(4) |
| 2016 |
Jan
(2) |
Feb
(7) |
Mar
(2) |
Apr
(1) |
May
(14) |
Jun
(3) |
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(1) |
Dec
(3) |
| 2017 |
Jan
(6) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(12) |
Sep
(6) |
Oct
|
Nov
(3) |
Dec
|
| 2018 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2019 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(8) |
Oct
|
Nov
(2) |
Dec
(25) |
| 2020 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
(53) |
Nov
(33) |
Dec
|
| 2021 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
(5) |
| 2022 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(93) |
Aug
(206) |
Sep
(39) |
Oct
(19) |
Nov
(11) |
Dec
|
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(150) |
Jul
(124) |
Aug
(14) |
Sep
(5) |
Oct
|
Nov
(1) |
Dec
|
| 2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(62) |
Aug
|
Sep
(7) |
Oct
|
Nov
(7) |
Dec
|
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
(14) |
May
(3) |
Jun
|
Jul
|
Aug
(76) |
Sep
(214) |
Oct
(6) |
Nov
|
Dec
|
|
From: <kin...@us...> - 2003-12-19 08:03:01
|
Update of /cvsroot/teem/teem/src/ell/test
In directory sc8-pr-cvs1:/tmp/cvs-serv21657
Modified Files:
tq.c
Log Message:
ELL_3M_TRAN --> ELL_3M_TRANPOSE laggard
Index: tq.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ell/test/tq.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** tq.c 30 Aug 2003 22:34:43 -0000 1.2
--- tq.c 19 Dec 2003 08:02:58 -0000 1.3
***************
*** 140,144 ****
det = ELL_3M_DET(mat3A_f);
frob = ELL_3M_FROB(mat3A_f);
! ELL_3M_TRAN(mat3B_f, mat3A_f);
ell_3m_inv_f(mat3C_f, mat3A_f);
ELL_3M_SUB(mat3C_f, mat3B_f, mat3C_f);
--- 140,144 ----
det = ELL_3M_DET(mat3A_f);
frob = ELL_3M_FROB(mat3A_f);
! ELL_3M_TRANSPOSE(mat3B_f, mat3A_f);
ell_3m_inv_f(mat3C_f, mat3A_f);
ELL_3M_SUB(mat3C_f, mat3B_f, mat3C_f);
|
|
From: <kin...@us...> - 2003-12-19 07:58:43
|
Update of /cvsroot/teem/teem/src/ten
In directory sc8-pr-cvs1:/tmp/cvs-serv20659
Added Files:
tendHelix.c
Log Message:
"tend helix" makes cool twisting helical tensor datasets
--- NEW FILE: tendHelix.c ---
/*
teem: Gordon Kindlmann's research software
Copyright (C) 2003, 2002, 2001, 2000, 1999, 1998 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 as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
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 the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "ten.h"
#include "privateTen.h"
#define INFO "Generate twisting helical tensor field"
char *_tend_helixInfoL =
(INFO
". The main utility of such a field is to expose the handedness of the "
"raster coordinate frame, and to see if it agrees with the coordinate "
"frame in which the tensor is expressed. With the default settings, the "
"region of high anisotropy is a right-handed helix (same as DNA), "
"provided that the three axis sizes given to the \"-s\" option (below) "
"correspond to a right-handed ordered basis (\"slow equals fast cross "
"medium\"). In addition, the tensors twist relative to the helix. "
"If you trace paths guided by the principal eigenvector of the tensors, "
"along the surface of the helical cylinder, you get another "
"right-handed helix, as if the the tensor field is modeling the result "
"if twisting a set of fibers into single-straded helical bundle. "
"On the other hand, "
"if you sample in a straight light along the diameter of the cylinder, "
"the principal axis of the tensors twist in a *left*-handed helix. ");
void
tend_helixDoit(Nrrd *nout, float bnd,
float r, float R, float S, float angle) {
int sx, sy, sz, xi, yi, zi, idx;
double th, t0, t1, t2, t3, v0, v1, v2, v3,
wpos[3], vpos[3],
W2H[9], H2W[9], H2C[9], C2H[9], fv[3], rv[3], uv[3], mA[9], mB[9], inside,
tmp[3], len;
float *out;
out = (float*)nout->data;
sx = nout->axis[1].size;
sy = nout->axis[2].size;
sz = nout->axis[3].size;
idx = 0;
for (zi=0; zi<sz; zi++) {
fprintf(stderr, "zi = %d/%d\n", zi, sz);
vpos[2] = AIR_AFFINE(0, zi, sz-1, nout->axis[3].min, nout->axis[3].max);
for (yi=0; yi<sy; yi++) {
vpos[1] = AIR_AFFINE(0, yi, sy-1, nout->axis[2].min, nout->axis[2].max);
for (xi=0; xi<sx; xi++, idx++) {
vpos[0] = AIR_AFFINE(0, xi, sx-1, nout->axis[1].min,nout->axis[1].max);
#define WPOS(pos, th) ELL_3V_SET((pos), R*cos(th), R*sin(th), S*(th)/(2*M_PI))
#define VAL(th) (WPOS(wpos, th), ELL_3V_DIST(wpos, vpos))
#define RR 0.61803399
#define CC (1.0-RR)
#define SHIFT3(a,b,c,d) (a)=(b); (b)=(c); (c)=(d)
#define SHIFT2(a,b,c) (a)=(b); (b)=(c)
th = atan2(vpos[1], vpos[0]);
th += 2*M_PI*floor(0.5 + vpos[2]/S - th/(2*M_PI));
if (S*th/(2*M_PI) > vpos[2]) {
t0 = th - M_PI; t3 = th;
} else {
t0 = th; t3 = th + M_PI;
}
t1 = RR*t0 + CC*t3;
t2 = CC*t0 + RR*t3;
v0 = VAL(t0);
v1 = VAL(t1);
v2 = VAL(t2);
v3 = VAL(t3);
while ( t3-t0 > 0.0001*(AIR_ABS(t1+t2)) ) {
if (v1 < v2) {
SHIFT3(t3, t2, t1, CC*t0 + RR*t2);
SHIFT2(v2, v1, VAL(t1));
} else {
SHIFT3(t0, t1, t2, RR*t1 + CC*t3);
SHIFT2(v1, v2, VAL(t2));
}
}
/* well-written code is self-documenting */
WPOS(wpos, t1);
ELL_3V_SUB(wpos, vpos, wpos);
ELL_3V_SET(fv, -R*sin(t1), R*cos(t1), S/M_PI);
ELL_3V_NORM(fv, fv, len);
ELL_3V_COPY(rv, wpos);
ELL_3V_NORM(rv, rv, len);
len = ELL_3V_DOT(rv, fv);
ELL_3V_SCALE(tmp, -len, fv);
ELL_3V_ADD2(rv, rv, tmp);
ELL_3V_NORM(rv, rv, len);
ELL_3V_CROSS(uv, rv, fv);
ELL_3V_NORM(uv, uv, len);
ELL_3MV_ROW0_SET(W2H, uv);
ELL_3MV_ROW1_SET(W2H, rv);
ELL_3MV_ROW2_SET(W2H, fv);
ELL_3M_TRANSPOSE(H2W, W2H);
inside = 0.5 - 0.5*airErf((ELL_3V_LEN(wpos)-r)/(bnd + 0.0001));
th = angle*ELL_3V_LEN(wpos)/r;
ELL_3M_ROTATE_Y_SET(H2C, th);
ELL_3M_TRANSPOSE(C2H, H2C);
ELL_3M_SCALE_SET(mA,
AIR_LERP(inside, 0.5, 0.4),
AIR_LERP(inside, 0.5, 0.2),
AIR_LERP(inside, 0.5, 0.9));
ELL_3M_MUL(mB, mA, H2C);
ELL_3M_MUL(mA, mB, W2H);
ELL_3M_MUL(mB, C2H, mA);
ELL_3M_MUL(mA, H2W, mB);
TEN_MAT2LIST(out + 7*idx, mA);
(out + 7*idx)[0] = 1.0;
}
}
}
return;
}
int
tend_helixMain(int argc, char **argv, char *me, hestParm *hparm) {
int pret;
hestOpt *hopt = NULL;
char *perr, *err;
airArray *mop;
int size[3];
Nrrd *nout;
float R, r, S, bnd, angle;
double min[4], max[4];
char *outS;
hestOptAdd(&hopt, "s", "size", airTypeInt, 3, 3, size, NULL,
"sizes along fast, medium, and slow axes of the sampled volume, "
"often called \"X\", \"Y\", and \"Z\". It is best to use "
"slightly different sizes here, to expose errors in interpreting "
"axis ordering (e.g. \"-s 39 40 41\")");
hestOptAdd(&hopt, "min", "min corner", airTypeDouble, 3, 3, min+1,
"-2 -2 -2",
"location of low corner of sampled tensor volume");
hestOptAdd(&hopt, "max", "max corner", airTypeDouble, 3, 3, max+1, "2 2 2",
"location of high corner of sampled tensor volume");
hestOptAdd(&hopt, "b", "boundary", airTypeFloat, 1, 1, &bnd, "0.05",
"parameter governing how fuzzy the boundary between high and "
"low anisotropy is. Use \"-b 0\" for no fuzziness");
hestOptAdd(&hopt, "r", "little radius", airTypeFloat, 1, 1, &r, "0.5",
"(minor) radius of cylinder tracing helix");
hestOptAdd(&hopt, "R", "big radius", airTypeFloat, 1, 1, &R, "1.2",
"(major) radius of helical turns");
hestOptAdd(&hopt, "S", "spacing", airTypeFloat, 1, 1, &S, "2",
"spacing between turns of helix (along its axis)");
hestOptAdd(&hopt, "a", "angle", airTypeFloat, 1, 1, &angle, "1.0",
"maximal angle of twist of tensors along path. There is no "
"twist at helical core of path, and twist increases linearly "
"with radius around this path. Positive twist angle with "
"positive spacing resulting in a right-handed twist around a "
"right-handed helix. ");
hestOptAdd(&hopt, "o", "nout", airTypeString, 1, 1, &outS, "-",
"output file");
mop = airMopNew();
airMopAdd(mop, hopt, (airMopper)hestOptFree, airMopAlways);
USAGE(_tend_helixInfoL);
PARSE();
airMopAdd(mop, hopt, (airMopper)hestParseFree, airMopAlways);
nout = nrrdNew();
airMopAdd(mop, nout, (airMopper)nrrdNuke, airMopAlways);
if (nrrdAlloc(nout, nrrdTypeFloat, 4, 7, size[0], size[1], size[2])) {
airMopAdd(mop, err=biffGetDone(NRRD), airFree, airMopAlways);
fprintf(stderr, "%s: trouble allocating output:\n%s\n", me, err);
airMopError(mop); return 1;
}
min[0] = max[0] = AIR_NAN;
nrrdAxisInfoSet_nva(nout, nrrdAxisInfoMin, min);
nrrdAxisInfoSet_nva(nout, nrrdAxisInfoMax, max);
tend_helixDoit(nout, bnd, r, R, S, angle);
if (nrrdSave(outS, nout, NULL)) {
airMopAdd(mop, err=biffGetDone(NRRD), airFree, airMopAlways);
fprintf(stderr, "%s: trouble writing:\n%s\n", me, err);
airMopError(mop); return 1;
}
airMopOkay(mop);
return 0;
}
TEND_CMD(helix, INFO);
|
|
From: <kin...@us...> - 2003-12-19 03:53:10
|
Update of /cvsroot/teem/teem/src/nrrd/test
In directory sc8-pr-cvs1:/tmp/cvs-serv18671/test
Added Files:
reuse.c
Log Message:
for testing memory re-used on input
--- NEW FILE: reuse.c ---
/*
teem: Gordon Kindlmann's research software
Copyright (C) 2003, 2002, 2001, 2000, 1999, 1998 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 as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
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 the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../nrrd.h"
void
usage(char *me) {
/* 0 1 2 (3) */
fprintf(stderr, "usage: %s <nin1> <nin2>\n", me);
exit(1);
}
int
main(int argc, char **argv) {
char *me, *err;
Nrrd *nrrd;
NrrdIoState *io;
me = argv[0];
if (3 != argc)
usage(me);
io = nrrdIoStateNew();
nrrdStateVerboseIO = 10;
if (nrrdLoad(nrrd=nrrdNew(), argv[1], NULL)) {
fprintf(stderr, "%s: trouble loading \"%s\":\n%s",
me, argv[1], err = biffGet(NRRD));
free(err);
exit(1);
}
fprintf(stderr, "%s: data for \"%s\" at %p\n", me, argv[1], nrrd->data);
if (nrrdLoad(nrrd, argv[2], NULL)) {
fprintf(stderr, "%s: trouble loading \"%s\":\n%s",
me, argv[2], err = biffGet(NRRD));
free(err);
exit(1);
}
fprintf(stderr, "%s: data for \"%s\" at %p\n", me, argv[2], nrrd->data);
nrrdIoStateNix(io);
nrrdNuke(nrrd);
exit(0);
}
|
|
From: <kin...@us...> - 2003-12-19 03:53:10
|
Update of /cvsroot/teem/teem/src/nrrd In directory sc8-pr-cvs1:/tmp/cvs-serv18671 Modified Files: GNUmakefile Log Message: for testing memory re-used on input Index: GNUmakefile =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/GNUmakefile,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** GNUmakefile 30 Sep 2003 04:13:06 -0000 1.21 --- GNUmakefile 19 Dec 2003 03:53:07 -0000 1.22 *************** *** 62,66 **** write.o keyvalue.o $(L).TESTS = test/tread test/trand test/ax test/io test/minmax test/tkernel \ ! test/typestest test/tline test/genvol test/quadvol test/convo test/kv #### --- 62,67 ---- write.o keyvalue.o $(L).TESTS = test/tread test/trand test/ax test/io test/minmax test/tkernel \ ! test/typestest test/tline test/genvol test/quadvol test/convo test/kv \ ! test/reuse #### |
|
From: <kin...@us...> - 2003-12-19 03:52:33
|
Update of /cvsroot/teem/teem/src/nrrd
In directory sc8-pr-cvs1:/tmp/cvs-serv18521
Modified Files:
encoding.c encodingAscii.c encodingBzip2.c encodingGzip.c
encodingHex.c encodingRaw.c formatPNG.c formatText.c
methodsNrrd.c nrrd.h privateNrrd.h read.c
Log Message:
This is a functionality change relating to use of pre-allocated data
in nrrdRead(). There is no public API change.
Prior to this change, a nrrd that was already already valid and allocated
with some amount of memory would be stripped of that memory (the memory
was freed) by nrrdRead(). The various encodings would allocate new memory
via _nrrdCalloc. This meant that even when the caller to nrrdRead knew
in advance that the given nrrd could hold the data that would be read from
the given file, the memory was freed and re-allocated. This presented a
problem for ITK's use of nrrd in NrrdIO.
Now, near the beginning of nrrdRead(), any existing memory (via nrrd->data
being non-NULL) and its allocated size (via nrrd->type and nrrd->axis[i].size)
are remembered in the NrrdIoState struct (void *oldData, size_t oldDataSize),
which is then referred to via _nrrdCalloc, or directly by the format's reader.
The result is that existing memory is used whenever the allocated size
matches the size described by the new nrrd's header. This change has been
made in all existing formats, which involved more modifications for
formatText.c and formatPNG.c, since these do not use (nor should they)
functions in the existing encodingXXX.c files.
Near the end of nrrdRead(), the old data is freed if it turns out that it
wasn't re-used.
Index: encoding.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/encoding.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** encoding.c 29 Nov 2003 08:16:07 -0000 1.2
--- encoding.c 19 Dec 2003 03:52:29 -0000 1.3
***************
*** 27,33 ****
**
** what a NrrdEncoding has to do:
! ** -- allocate nrrd->data for the amount of space required (very likely
! ** via _nrrdCalloc). That this has to be done here is because of the
! ** restrictions imposed by DirectIO (used by nrrdEncodingRaw).
** -- do nothing on read/write if nio->skipData
** -- read data from nio->dataFile into nrrd->data, or vice versa.
--- 27,34 ----
**
** what a NrrdEncoding has to do:
! ** -- allocate nrrd->data for the amount of space required, or use existing
! ** memory described by nio->oldData and nio->oldDataSize. This is most
! ** easily done via _nrrdCalloc(). Allocation has to be done here because
! ** of the restrictions imposed by DirectIO (used by nrrdEncodingRaw).
** -- do nothing on read/write if nio->skipData
** -- read data from nio->dataFile into nrrd->data, or vice versa.
Index: encodingAscii.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/encodingAscii.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** encodingAscii.c 29 Nov 2003 08:16:07 -0000 1.3
--- encodingAscii.c 19 Dec 2003 03:52:29 -0000 1.4
***************
*** 44,48 ****
}
num = nrrdElementNumber(nrrd);
! if (_nrrdCalloc(nrrd)) {
sprintf(err, "%s: couldn't allocate sufficient memory for all data", me);
biffAdd(NRRD, err); return 1;
--- 44,48 ----
}
num = nrrdElementNumber(nrrd);
! if (_nrrdCalloc(nrrd, nio)) {
sprintf(err, "%s: couldn't allocate sufficient memory for all data", me);
biffAdd(NRRD, err); return 1;
Index: encodingBzip2.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/encodingBzip2.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** encodingBzip2.c 29 Nov 2003 08:16:07 -0000 1.3
--- encodingBzip2.c 19 Dec 2003 03:52:29 -0000 1.4
***************
*** 57,61 ****
/* Allocate memory for the incoming data. */
! if (_nrrdCalloc(nrrd)) {
sprintf(err, "%s: couldn't allocate sufficient memory for all data", me);
biffAdd(NRRD, err); return 1;
--- 57,61 ----
/* Allocate memory for the incoming data. */
! if (_nrrdCalloc(nrrd, nio)) {
sprintf(err, "%s: couldn't allocate sufficient memory for all data", me);
biffAdd(NRRD, err); return 1;
Index: encodingGzip.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/encodingGzip.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** encodingGzip.c 29 Nov 2003 08:16:07 -0000 1.3
--- encodingGzip.c 19 Dec 2003 03:52:29 -0000 1.4
***************
*** 54,58 ****
/* Allocate memory for the incoming data. */
! if (_nrrdCalloc(nrrd)) {
sprintf(err, "%s: couldn't allocate sufficient memory for all data", me);
biffAdd(NRRD, err); return 1;
--- 54,58 ----
/* Allocate memory for the incoming data. */
! if (_nrrdCalloc(nrrd, nio)) {
sprintf(err, "%s: couldn't allocate sufficient memory for all data", me);
biffAdd(NRRD, err); return 1;
Index: encodingHex.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/encodingHex.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** encodingHex.c 29 Nov 2003 08:16:07 -0000 1.4
--- encodingHex.c 19 Dec 2003 03:52:29 -0000 1.5
***************
*** 67,71 ****
return 0;
}
! if (_nrrdCalloc(nrrd)) {
sprintf(err, "%s: couldn't allocate sufficient memory for all data", me);
biffAdd(NRRD, err); return 1;
--- 67,71 ----
return 0;
}
! if (_nrrdCalloc(nrrd, nio)) {
sprintf(err, "%s: couldn't allocate sufficient memory for all data", me);
biffAdd(NRRD, err); return 1;
Index: encodingRaw.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/encodingRaw.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** encodingRaw.c 29 Nov 2003 08:16:07 -0000 1.4
--- encodingRaw.c 19 Dec 2003 03:52:29 -0000 1.5
***************
*** 51,55 ****
dio = airNoDio_format;
}
! if (airNoDio_okay == dio) {
if (nio->format->usesDIO) {
if (3 <= nrrdStateVerboseIO) {
--- 51,59 ----
dio = airNoDio_format;
}
! /* Notice that DIO will NOT be used if we are given pre-allocated memory
! that fits the new nrrd. The memory could be used if we were to check
! its alignment here, but there currently is a laziness problem */
! if (airNoDio_okay == dio
! && !(nio->oldData && bsize == nio->oldDataSize) ) {
if (nio->format->usesDIO) {
if (3 <= nrrdStateVerboseIO) {
***************
*** 68,72 ****
}
} else {
! if (_nrrdCalloc(nrrd)) {
sprintf(err, "%s: couldn't allocate sufficient memory for all data", me);
biffAdd(NRRD, err); return 1;
--- 72,82 ----
}
} else {
! if (airNoDio_okay == dio && nio->oldData && bsize == nio->oldDataSize) {
! if (nrrdStateVerboseIO) {
! fprintf(stderr,
! "%s: sorry, too lazy to use existing memory for DIO\n", me);
! }
! }
! if (_nrrdCalloc(nrrd, nio)) {
sprintf(err, "%s: couldn't allocate sufficient memory for all data", me);
biffAdd(NRRD, err); return 1;
Index: formatPNG.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/formatPNG.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** formatPNG.c 29 Nov 2003 08:16:07 -0000 1.3
--- formatPNG.c 19 Dec 2003 03:52:29 -0000 1.4
***************
*** 165,169 ****
png_uint_32 width, height, rowsize;
png_text* txt;
! int depth, type, i, channels, numtxt;
int ntype, ndim, nsize[3];
#endif /* TEEM_PNG */
--- 165,169 ----
png_uint_32 width, height, rowsize;
png_text* txt;
! int depth, type, i, channels, numtxt, ret;
int ntype, ndim, nsize[3];
#endif /* TEEM_PNG */
***************
*** 246,262 ****
ntype = depth > 8 ? nrrdTypeUShort : nrrdTypeUChar;
switch (type) {
! case PNG_COLOR_TYPE_GRAY:
ndim = 2; nsize[0] = width; nsize[1] = height;
break;
! case PNG_COLOR_TYPE_GRAY_ALPHA:
ndim = 3; nsize[0] = 2; nsize[1] = width; nsize[2] = height;
break;
! case PNG_COLOR_TYPE_RGB:
ndim = 3; nsize[0] = 3; nsize[1] = width; nsize[2] = height;
break;
! case PNG_COLOR_TYPE_RGB_ALPHA:
ndim = 3; nsize[0] = 4; nsize[1] = width; nsize[2] = height;
break;
! case PNG_COLOR_TYPE_PALETTE:
/* TODO: merge this with the outer switch, needs to be tested */
channels = png_get_channels(png, info);
--- 246,263 ----
ntype = depth > 8 ? nrrdTypeUShort : nrrdTypeUChar;
switch (type) {
! case PNG_COLOR_TYPE_GRAY:
ndim = 2; nsize[0] = width; nsize[1] = height;
+ nsize[2] = 1; /* to simplify code below */
break;
! case PNG_COLOR_TYPE_GRAY_ALPHA:
ndim = 3; nsize[0] = 2; nsize[1] = width; nsize[2] = height;
break;
! case PNG_COLOR_TYPE_RGB:
ndim = 3; nsize[0] = 3; nsize[1] = width; nsize[2] = height;
break;
! case PNG_COLOR_TYPE_RGB_ALPHA:
ndim = 3; nsize[0] = 4; nsize[1] = width; nsize[2] = height;
break;
! case PNG_COLOR_TYPE_PALETTE:
/* TODO: merge this with the outer switch, needs to be tested */
channels = png_get_channels(png, info);
***************
*** 267,271 ****
}
break;
! default:
png_destroy_read_struct(&png, &info, NULL);
sprintf(err, "%s: unknown png type: %d", me, type);
--- 268,272 ----
}
break;
! default:
png_destroy_read_struct(&png, &info, NULL);
sprintf(err, "%s: unknown png type: %d", me, type);
***************
*** 273,277 ****
break;
}
! if (nrrdMaybeAlloc_nva(nrrd, ntype, ndim, nsize)) {
png_destroy_read_struct(&png, &info, NULL);
sprintf(err, "%s: failed to allocate nrrd", me);
--- 274,285 ----
break;
}
! if (nio->oldData
! && (nio->oldDataSize
! == nrrdTypeSize[ntype]*nsize[0]*nsize[1]*nsize[2])) {
! ret = nrrdWrap_nva(nrrd, nio->oldData, ntype, ndim, nsize);
! } else {
! ret = nrrdMaybeAlloc_nva(nrrd, ntype, ndim, nsize);
! }
! if (ret) {
png_destroy_read_struct(&png, &info, NULL);
sprintf(err, "%s: failed to allocate nrrd", me);
Index: formatText.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/formatText.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** formatText.c 29 Nov 2003 08:16:07 -0000 1.3
--- formatText.c 19 Dec 2003 03:52:29 -0000 1.4
***************
*** 67,71 ****
char me[]="_nrrdFormatText_read", err[AIR_STRLEN_MED], *errS;
const char *fs;
! int line, len, ret, sx, sy, settwo = 0, gotOnePerAxis = AIR_FALSE;
/* fl: first line, al: all lines */
airArray *flArr, *alArr;
--- 67,72 ----
char me[]="_nrrdFormatText_read", err[AIR_STRLEN_MED], *errS;
const char *fs;
! int line, len, ret, sx, sy, settwo = 0, gotOnePerAxis = AIR_FALSE,
! size[NRRD_DIM_MAX];
/* fl: first line, al: all lines */
airArray *flArr, *alArr;
***************
*** 195,198 ****
--- 196,200 ----
biffAdd(NRRD, err); UNSETTWO; return 1;
}
+ /* else sx == 1 when nrrd->dim == 1 */
/* now see how many more lines there are */
***************
*** 225,246 ****
me, nrrd->dim, sx, sy);
*/
!
! switch (nrrd->dim) {
! case 2:
! if (nrrdMaybeAlloc(nrrd, nrrdTypeFloat, 2, sx, sy)) {
! sprintf(err, "%s: couldn't allocate plain text data", me);
! biffAdd(NRRD, err); UNSETTWO; return 1;
! }
! break;
! case 1:
! if (nrrdMaybeAlloc(nrrd, nrrdTypeFloat, 1, sy)) {
! sprintf(err, "%s: couldn't allocate plain text data", me);
! biffAdd(NRRD, err); UNSETTWO; return 1;
! }
! break;
! default:
fprintf(stderr, "%s: PANIC about to save, but dim = %d\n", me, nrrd->dim);
exit(1);
! break;
}
memcpy(nrrd->data, al, sx*sy*sizeof(float));
--- 227,251 ----
me, nrrd->dim, sx, sy);
*/
!
! if (!( 1 == nrrd->dim || 2 == nrrd->dim )) {
fprintf(stderr, "%s: PANIC about to save, but dim = %d\n", me, nrrd->dim);
exit(1);
! }
! if (1 == nrrd->dim) {
! size[0] = sy;
! } else {
! size[0] = sx;
! size[1] = sy;
! }
!
! if (nio->oldData
! && nio->oldDataSize == sx*sy*nrrdTypeSize[nrrdTypeFloat]) {
! ret = nrrdWrap_nva(nrrd, nio->oldData, nrrdTypeFloat, nrrd->dim, size);
! } else {
! ret = nrrdMaybeAlloc_nva(nrrd, nrrdTypeFloat, nrrd->dim, size);
! }
! if (ret) {
! sprintf(err, "%s: couldn't create nrrd for plain text data", me);
! biffAdd(NRRD, err); UNSETTWO; return 1;
}
memcpy(nrrd->data, al, sx*sy*sizeof(float));
Index: methodsNrrd.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/methodsNrrd.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** methodsNrrd.c 1 Dec 2003 09:21:20 -0000 1.36
--- methodsNrrd.c 19 Dec 2003 03:52:29 -0000 1.37
***************
*** 50,53 ****
--- 50,55 ----
nio->skipData = AIR_FALSE;
nio->keepNrrdDataFileOpen = AIR_FALSE;
+ nio->oldData = NULL;
+ nio->oldDataSize = 0;
memset(nio->seen, 0, (NRRD_FIELD_MAX+1)*sizeof(int));
}
***************
*** 81,84 ****
--- 83,87 ----
AIR_FREE(nio->line);
AIR_FREE(nio);
+ /* the NrrdIoState never owned nio->oldData; we don't free it */
return NULL;
}
Index: nrrd.h
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/nrrd.h,v
retrieving revision 1.126
retrieving revision 1.127
diff -C2 -d -r1.126 -r1.127
*** nrrd.h 1 Dec 2003 09:21:21 -0000 1.126
--- nrrd.h 19 Dec 2003 03:52:29 -0000 1.127
***************
*** 276,279 ****
--- 276,282 ----
roughly equivalent to better but slower
(1-9, -1 for default[9]). */
+ void *oldData; /* ON READ: data pointer that may have already been
+ allocated for the right size to hold the data */
+ size_t oldDataSize; /* ON READ: size of data pointed to by oldData */
/* format and encoding. These are initialized to nrrdFormatUnknown
and nrrdEncodingUnknown, respectively. USE THESE VALUES for
***************
*** 315,319 ****
** around zero, but does not assume anything about even- or oddness
**
! ** It is a strong but very simplifying assumption that the paramater
** array ("parm") is always type double. There is essentially no
** value in allowing flexibility between float and double, and much
--- 318,322 ----
** around zero, but does not assume anything about even- or oddness
**
! ** It is a strong but very simplifying assumption that the parameter
** array ("parm") is always type double. There is essentially no
** value in allowing flexibility between float and double, and much
Index: privateNrrd.h
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/privateNrrd.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** privateNrrd.h 29 Nov 2003 08:16:07 -0000 1.28
--- privateNrrd.h 19 Dec 2003 03:52:29 -0000 1.29
***************
*** 87,92 ****
/* read.c */
! extern int _nrrdOneLine (int *lenP, NrrdIoState *io, FILE *file);
! extern int _nrrdCalloc (Nrrd *nrrd);
/* arrays.c */
--- 87,92 ----
/* read.c */
! extern int _nrrdOneLine (int *lenP, NrrdIoState *nio, FILE *file);
! extern int _nrrdCalloc (Nrrd *nrrd, NrrdIoState *nio);
/* arrays.c */
***************
*** 136,142 ****
/* parseNrrd.c */
! extern int (*_nrrdReadNrrdParseInfo[NRRD_FIELD_MAX+1])(Nrrd *, NrrdIoState *,
int useBiff);
! extern int _nrrdReadNrrdParseField(Nrrd *nrrd, NrrdIoState *io, int useBiff);
/* methods.c */
--- 136,143 ----
/* parseNrrd.c */
! extern int (*_nrrdReadNrrdParseInfo[NRRD_FIELD_MAX+1])(Nrrd *nrrd,
! NrrdIoState *nio,
int useBiff);
! extern int _nrrdReadNrrdParseField(Nrrd *nrrd, NrrdIoState *nio, int useBiff);
/* methods.c */
Index: read.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/read.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -C2 -d -r1.84 -r1.85
*** read.c 30 Nov 2003 22:48:29 -0000 1.84
--- read.c 19 Dec 2003 03:52:29 -0000 1.85
***************
*** 121,138 ****
** _nrrdCalloc()
**
! ** allocates the data for the array. Only to be called by data readers,
** since it assume the validity of size information, as enforced by
** _nrrdHeaderCheck().
*/
int
! _nrrdCalloc (Nrrd *nrrd) {
char me[]="_nrrdCalloc", err[AIR_STRLEN_MED];
! AIR_FREE(nrrd->data);
! nrrd->data = calloc(nrrdElementNumber(nrrd), nrrdElementSize(nrrd));
! if (!nrrd->data) {
! sprintf(err, "%s: couldn't calloc(" _AIR_SIZE_T_FMT
! ", %d)", me, nrrdElementNumber(nrrd), nrrdElementSize(nrrd));
! biffAdd(NRRD, err); return 1;
}
return 0;
--- 121,147 ----
** _nrrdCalloc()
**
! ** allocates the data for the array, but only if necessary (as informed by
! ** nio->oldData and nio->oldDataSate). Only to be called by data readers,
** since it assume the validity of size information, as enforced by
** _nrrdHeaderCheck().
*/
int
! _nrrdCalloc (Nrrd *nrrd, NrrdIoState *nio) {
char me[]="_nrrdCalloc", err[AIR_STRLEN_MED];
+ size_t needDataSize;
! needDataSize = nrrdElementNumber(nrrd)*nrrdElementSize(nrrd);
! if (nio->oldData && needDataSize == nio->oldDataSize) {
! nrrd->data = nio->oldData;
! /* make the data look like it came from calloc() */
! memset(nrrd->data, 0, needDataSize);
! } else {
! AIR_FREE(nrrd->data);
! nrrd->data = calloc(nrrdElementNumber(nrrd), nrrdElementSize(nrrd));
! if (!nrrd->data) {
! sprintf(err, "%s: couldn't calloc(" _AIR_SIZE_T_FMT
! ", %d)", me, nrrdElementNumber(nrrd), nrrdElementSize(nrrd));
! biffAdd(NRRD, err); return 1;
! }
}
return 0;
***************
*** 226,230 ****
char me[]="nrrdRead", err[AIR_STRLEN_MED];
int len, fi;
! airArray *mop;
/* sanity check, for good measure */
--- 235,239 ----
char me[]="nrrdRead", err[AIR_STRLEN_MED];
int len, fi;
! airArray *mop;
/* sanity check, for good measure */
***************
*** 247,252 ****
airMopAdd(mop, nio, (airMopper)nrrdIoStateNix, airMopAlways);
}
! /* clear out anything in the given nrrd */
nrrdInit(nrrd);
--- 256,273 ----
airMopAdd(mop, nio, (airMopper)nrrdIoStateNix, airMopAlways);
}
+
+ /* remember old data pointer and allocated size. Whether or not to
+ free() this memory will be decided later */
+ nio->oldData = nrrd->data;
+ nio->oldDataSize = (nio->oldData
+ ? nrrdElementNumber(nrrd)*nrrdElementSize(nrrd)
+ : 0);
+ /*
+ fprintf(stderr, "!%s: nio->oldData = %p, oldDataSize = %d\n", me,
+ nio->oldData, (int)(nio->oldDataSize));
+ */
+ nrrd->data = NULL;
! /* initialize given nrrd (but we have thwarted freeing existing memory) */
nrrdInit(nrrd);
***************
*** 287,290 ****
--- 308,317 ----
biffAdd(NRRD, err); return 1;
}
+ }
+
+ /* free prior memory if we didn't end up using it */
+ if (nio->oldData != nrrd->data) {
+ AIR_FREE(nio->oldData);
+ nio->oldDataSize = 0;
}
|
|
From: <kin...@us...> - 2003-12-19 03:38:50
|
Update of /cvsroot/teem/teem/src/nrrd In directory sc8-pr-cvs1:/tmp/cvs-serv16379 Modified Files: reorder.c Log Message: notes to self on eventual implementation of nrrdTile Index: reorder.c =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/reorder.c,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** reorder.c 1 Dec 2003 09:21:21 -0000 1.53 --- reorder.c 19 Dec 2003 03:38:47 -0000 1.54 *************** *** 1045,1047 **** --- 1045,1060 ---- } + /* for nrrdTile... + + will require that # slices be <= number of images: won't crop for you, + but will happy pad with black + + pick which axis to slice along + + pick which two axis (in order) will be tiled into + + then write nrrdUntile + + */ + /* ---- END non-NrrdIO */ |
|
From: <kin...@us...> - 2003-12-19 03:38:22
|
Update of /cvsroot/teem/teem/src/nrrd
In directory sc8-pr-cvs1:/tmp/cvs-serv16303
Modified Files:
parseNrrd.c
Log Message:
nothing, just variable renaming
Index: parseNrrd.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/parseNrrd.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** parseNrrd.c 29 Nov 2003 08:16:07 -0000 1.19
--- parseNrrd.c 19 Dec 2003 03:38:18 -0000 1.20
***************
*** 22,26 ****
int
! _nrrdReadNrrdParse_nonfield (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
/*
char c;
--- 22,26 ----
int
! _nrrdReadNrrdParse_nonfield (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
/*
char c;
***************
*** 36,45 ****
int
! _nrrdReadNrrdParse_comment (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_comment", err[AIR_STRLEN_MED];
char *info;
! info = io->line + io->pos;
! /* this skips the '#' at io->line[io->pos] and any other ' ' and '#' */
if (nrrdCommentAdd(nrrd, info)) {
sprintf(err, "%s: trouble adding comment", me);
--- 36,45 ----
int
! _nrrdReadNrrdParse_comment (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_comment", err[AIR_STRLEN_MED];
char *info;
! info = nio->line + nio->pos;
! /* this skips the '#' at nio->line[nio->pos] and any other ' ' and '#' */
if (nrrdCommentAdd(nrrd, info)) {
sprintf(err, "%s: trouble adding comment", me);
***************
*** 50,58 ****
int
! _nrrdReadNrrdParse_type (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_type", err[AIR_STRLEN_MED];
char *info;
! info = io->line + io->pos;
if (!(nrrd->type = airEnumVal(nrrdType, info))) {
sprintf(err, "%s: couldn't parse type \"%s\"", me, info);
--- 50,58 ----
int
! _nrrdReadNrrdParse_type (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_type", err[AIR_STRLEN_MED];
char *info;
! info = nio->line + nio->pos;
if (!(nrrd->type = airEnumVal(nrrdType, info))) {
sprintf(err, "%s: couldn't parse type \"%s\"", me, info);
***************
*** 63,72 ****
int
! _nrrdReadNrrdParse_encoding (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_encoding", err[AIR_STRLEN_MED];
char *info;
int etype;
! info = io->line + io->pos;
if (!(etype = airEnumVal(nrrdEncodingType, info))) {
sprintf(err, "%s: couldn't parse encoding \"%s\"", me, info);
--- 63,72 ----
int
! _nrrdReadNrrdParse_encoding (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_encoding", err[AIR_STRLEN_MED];
char *info;
int etype;
! info = nio->line + nio->pos;
if (!(etype = airEnumVal(nrrdEncodingType, info))) {
sprintf(err, "%s: couldn't parse encoding \"%s\"", me, info);
***************
*** 74,88 ****
}
! io->encoding = nrrdEncodingArray[etype];
return 0;
}
int
! _nrrdReadNrrdParse_endian (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_endian", err[AIR_STRLEN_MED];
char *info;
! info = io->line + io->pos;
! if (!(io->endian = airEnumVal(airEndian, info))) {
sprintf(err, "%s: couldn't parse endian \"%s\"", me, info);
biffMaybeAdd(NRRD, err, useBiff); return 1;
--- 74,88 ----
}
! nio->encoding = nrrdEncodingArray[etype];
return 0;
}
int
! _nrrdReadNrrdParse_endian (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_endian", err[AIR_STRLEN_MED];
char *info;
! info = nio->line + nio->pos;
! if (!(nio->endian = airEnumVal(airEndian, info))) {
sprintf(err, "%s: couldn't parse endian \"%s\"", me, info);
biffMaybeAdd(NRRD, err, useBiff); return 1;
***************
*** 98,106 ****
int
! _nrrdReadNrrdParse_dimension (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_dimension", err[AIR_STRLEN_MED];
char *info;
! info = io->line + io->pos;
_PARSE_ONE_VAL(nrrd->dim, "%d", "int");
if (!AIR_IN_CL(1, nrrd->dim, NRRD_DIM_MAX)) {
--- 98,106 ----
int
! _nrrdReadNrrdParse_dimension (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_dimension", err[AIR_STRLEN_MED];
char *info;
! info = nio->line + nio->pos;
_PARSE_ONE_VAL(nrrd->dim, "%d", "int");
if (!AIR_IN_CL(1, nrrd->dim, NRRD_DIM_MAX)) {
***************
*** 131,140 ****
int
! _nrrdReadNrrdParse_sizes (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_sizes", err[AIR_STRLEN_MED];
int ret, val[NRRD_DIM_MAX];
char *info;
! info = io->line + io->pos;
_CHECK_HAVE_DIM;
ret = airParseStrI(val, info, _nrrdFieldSep, nrrd->dim);
--- 131,140 ----
int
! _nrrdReadNrrdParse_sizes (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_sizes", err[AIR_STRLEN_MED];
int ret, val[NRRD_DIM_MAX];
char *info;
! info = nio->line + nio->pos;
_CHECK_HAVE_DIM;
ret = airParseStrI(val, info, _nrrdFieldSep, nrrd->dim);
***************
*** 149,153 ****
int
! _nrrdReadNrrdParse_spacings (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_spacings", err[AIR_STRLEN_MED];
int i, ret;
--- 149,153 ----
int
! _nrrdReadNrrdParse_spacings (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_spacings", err[AIR_STRLEN_MED];
int i, ret;
***************
*** 155,159 ****
char *info;
! info = io->line + io->pos;
_CHECK_HAVE_DIM;
ret = airParseStrD(val, info, _nrrdFieldSep, nrrd->dim);
--- 155,159 ----
char *info;
! info = nio->line + nio->pos;
_CHECK_HAVE_DIM;
ret = airParseStrD(val, info, _nrrdFieldSep, nrrd->dim);
***************
*** 170,174 ****
int
! _nrrdReadNrrdParse_axis_mins (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_axis_mins", err[AIR_STRLEN_MED];
int ret, i, sgn;
--- 170,174 ----
int
! _nrrdReadNrrdParse_axis_mins (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_axis_mins", err[AIR_STRLEN_MED];
int ret, i, sgn;
***************
*** 176,180 ****
char *info;
! info = io->line + io->pos;
_CHECK_HAVE_DIM;
ret = airParseStrD(val, info, _nrrdFieldSep, nrrd->dim);
--- 176,180 ----
char *info;
! info = nio->line + nio->pos;
_CHECK_HAVE_DIM;
ret = airParseStrD(val, info, _nrrdFieldSep, nrrd->dim);
***************
*** 191,195 ****
int
! _nrrdReadNrrdParse_axis_maxs (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_axis_maxs", err[AIR_STRLEN_MED];
int ret, i, sgn;
--- 191,195 ----
int
! _nrrdReadNrrdParse_axis_maxs (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_axis_maxs", err[AIR_STRLEN_MED];
int ret, i, sgn;
***************
*** 197,201 ****
char *info;
! info = io->line + io->pos;
_CHECK_HAVE_DIM;
ret = airParseStrD(val, info, _nrrdFieldSep, nrrd->dim);
--- 197,201 ----
char *info;
! info = nio->line + nio->pos;
_CHECK_HAVE_DIM;
ret = airParseStrD(val, info, _nrrdFieldSep, nrrd->dim);
***************
*** 215,219 ****
*/
int
! _nrrdReadNrrdParse_centers (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_centers", err[AIR_STRLEN_MED];
int i;
--- 215,219 ----
*/
int
! _nrrdReadNrrdParse_centers (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_centers", err[AIR_STRLEN_MED];
int i;
***************
*** 221,225 ****
char *info, *last;
! info = io->line + io->pos;
_CHECK_HAVE_DIM;
for (i=0; i<=nrrd->dim-1; i++) {
--- 221,225 ----
char *info, *last;
! info = nio->line + nio->pos;
_CHECK_HAVE_DIM;
for (i=0; i<=nrrd->dim-1; i++) {
***************
*** 305,309 ****
int
! _nrrdReadNrrdParse_labels (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_labels", err[AIR_STRLEN_MED];
char *h; /* this is the "here" pointer which gradually progresses
--- 305,309 ----
int
! _nrrdReadNrrdParse_labels (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_labels", err[AIR_STRLEN_MED];
char *h; /* this is the "here" pointer which gradually progresses
***************
*** 314,318 ****
/* because we have to correctly interpret quote marks, we
can't simply rely on airParseStrS */
! info = io->line + io->pos;
/* printf("!%s: info |%s|\n", me, info); */
_CHECK_HAVE_DIM;
--- 314,318 ----
/* because we have to correctly interpret quote marks, we
can't simply rely on airParseStrS */
! info = nio->line + nio->pos;
/* printf("!%s: info |%s|\n", me, info); */
_CHECK_HAVE_DIM;
***************
*** 330,334 ****
int
! _nrrdReadNrrdParse_units (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_unitss", err[AIR_STRLEN_MED];
char *h;
--- 330,334 ----
int
! _nrrdReadNrrdParse_units (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_unitss", err[AIR_STRLEN_MED];
char *h;
***************
*** 338,342 ****
/* because we have to correctly interpret quote marks, we
can't simply rely on airParseStrS */
! info = io->line + io->pos;
/* printf("!%s: info |%s|\n", me, info); */
_CHECK_HAVE_DIM;
--- 338,342 ----
/* because we have to correctly interpret quote marks, we
can't simply rely on airParseStrS */
! info = nio->line + nio->pos;
/* printf("!%s: info |%s|\n", me, info); */
_CHECK_HAVE_DIM;
***************
*** 354,363 ****
int
! _nrrdReadNrrdParse_number (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
/*
char me[]="_nrrdReadNrrdParse_number", err[AIR_STRLEN_MED];
char *info;
! info = io->line + io->pos;
if (1 != sscanf(info, NRRD_BIG_INT_PRINTF, &(nrrd->num))) {
sprintf(err, "%s: couldn't parse number \"%s\"", me, info);
--- 354,363 ----
int
! _nrrdReadNrrdParse_number (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
/*
char me[]="_nrrdReadNrrdParse_number", err[AIR_STRLEN_MED];
char *info;
! info = nio->line + nio->pos;
if (1 != sscanf(info, NRRD_BIG_INT_PRINTF, &(nrrd->num))) {
sprintf(err, "%s: couldn't parse number \"%s\"", me, info);
***************
*** 381,389 ****
int
! _nrrdReadNrrdParse_content (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_content", err[AIR_STRLEN_MED];
char *info;
! info = io->line + io->pos;
if (strlen(info) && !(nrrd->content = airStrdup(info))) {
sprintf(err, "%s: couldn't strdup() content", me);
--- 381,389 ----
int
! _nrrdReadNrrdParse_content (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_content", err[AIR_STRLEN_MED];
char *info;
! info = nio->line + nio->pos;
if (strlen(info) && !(nrrd->content = airStrdup(info))) {
sprintf(err, "%s: couldn't strdup() content", me);
***************
*** 394,402 ****
int
! _nrrdReadNrrdParse_block_size (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_block_size", err[AIR_STRLEN_MED];
char *info;
! info = io->line + io->pos;
/*
if (nrrdTypeBlock != nrrd->type) {
--- 394,402 ----
int
! _nrrdReadNrrdParse_block_size (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_block_size", err[AIR_STRLEN_MED];
char *info;
! info = nio->line + nio->pos;
/*
if (nrrdTypeBlock != nrrd->type) {
***************
*** 416,420 ****
int
! _nrrdReadNrrdParse_min (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
/* This field is no longer assumed to be anything meaningful,
--- 416,420 ----
int
! _nrrdReadNrrdParse_min (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
/* This field is no longer assumed to be anything meaningful,
***************
*** 427,431 ****
int
! _nrrdReadNrrdParse_max (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
/* nrrd->max no longer exists, see above */
--- 427,431 ----
int
! _nrrdReadNrrdParse_max (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
/* nrrd->max no longer exists, see above */
***************
*** 435,444 ****
int
! _nrrdReadNrrdParse_old_min (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_old_min", err[AIR_STRLEN_MED];
char *info;
int sgn;
! info = io->line + io->pos;
_PARSE_ONE_VAL(nrrd->oldMin, "%lg", "double");
if ((sgn=airIsInf_d(nrrd->oldMin))) {
--- 435,444 ----
int
! _nrrdReadNrrdParse_old_min (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_old_min", err[AIR_STRLEN_MED];
char *info;
int sgn;
! info = nio->line + nio->pos;
_PARSE_ONE_VAL(nrrd->oldMin, "%lg", "double");
if ((sgn=airIsInf_d(nrrd->oldMin))) {
***************
*** 450,459 ****
int
! _nrrdReadNrrdParse_old_max (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_old_max", err[AIR_STRLEN_MED];
char *info;
int sgn;
! info = io->line + io->pos;
_PARSE_ONE_VAL(nrrd->oldMax, "%lg", "double");
if ((sgn=airIsInf_d(nrrd->oldMax))) {
--- 450,459 ----
int
! _nrrdReadNrrdParse_old_max (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_old_max", err[AIR_STRLEN_MED];
char *info;
int sgn;
! info = nio->line + nio->pos;
_PARSE_ONE_VAL(nrrd->oldMax, "%lg", "double");
if ((sgn=airIsInf_d(nrrd->oldMax))) {
***************
*** 470,482 ****
** Note lack of thread-safety: strerror(errno) */
int
! _nrrdReadNrrdParse_data_file (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_data_file", err[AIR_STRLEN_MED],
dataName[AIR_STRLEN_HUGE];
char *info;
! info = io->line + io->pos;
if (!strncmp(info, _nrrdRelativePathFlag, strlen(_nrrdRelativePathFlag))) {
/* data file directory is relative to header directory */
! if (!io->path) {
sprintf(err, "%s: nrrd file refers to header-relative data file "
"\"%s\", but don't know path of header", me, info);
--- 470,482 ----
** Note lack of thread-safety: strerror(errno) */
int
! _nrrdReadNrrdParse_data_file (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_data_file", err[AIR_STRLEN_MED],
dataName[AIR_STRLEN_HUGE];
char *info;
! info = nio->line + nio->pos;
if (!strncmp(info, _nrrdRelativePathFlag, strlen(_nrrdRelativePathFlag))) {
/* data file directory is relative to header directory */
! if (!nio->path) {
sprintf(err, "%s: nrrd file refers to header-relative data file "
"\"%s\", but don't know path of header", me, info);
***************
*** 484,493 ****
}
info += strlen(_nrrdRelativePathFlag);
! sprintf(dataName, "%s/%s", io->path, info);
} else {
/* data file's name is absolute (not header-relative) */
strcpy(dataName, info);
}
! if (!(io->dataFile = fopen(dataName, "rb"))) {
sprintf(err, "%s: fopen(\"%s\",\"rb\") failed: %s",
me, dataName, strerror(errno));
--- 484,493 ----
}
info += strlen(_nrrdRelativePathFlag);
! sprintf(dataName, "%s/%s", nio->path, info);
} else {
/* data file's name is absolute (not header-relative) */
strcpy(dataName, info);
}
! if (!(nio->dataFile = fopen(dataName, "rb"))) {
sprintf(err, "%s: fopen(\"%s\",\"rb\") failed: %s",
me, dataName, strerror(errno));
***************
*** 499,510 ****
int
! _nrrdReadNrrdParse_line_skip (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_line_skip", err[AIR_STRLEN_MED];
char *info;
! info = io->line + io->pos;
! _PARSE_ONE_VAL(io->lineSkip, "%d", "int");
! if (!(0 <= io->lineSkip)) {
! sprintf(err, "%s: lineSkip value %d invalid", me, io->lineSkip);
biffMaybeAdd(NRRD, err, useBiff); return 1;
}
--- 499,510 ----
int
! _nrrdReadNrrdParse_line_skip (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_line_skip", err[AIR_STRLEN_MED];
char *info;
! info = nio->line + nio->pos;
! _PARSE_ONE_VAL(nio->lineSkip, "%d", "int");
! if (!(0 <= nio->lineSkip)) {
! sprintf(err, "%s: lineSkip value %d invalid", me, nio->lineSkip);
biffMaybeAdd(NRRD, err, useBiff); return 1;
}
***************
*** 513,524 ****
int
! _nrrdReadNrrdParse_byte_skip (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_byte_skip", err[AIR_STRLEN_MED];
char *info;
! info = io->line + io->pos;
! _PARSE_ONE_VAL(io->byteSkip, "%d", "int");
! if (!(-1 <= io->byteSkip)) {
! sprintf(err, "%s: byteSkip value %d invalid", me, io->byteSkip);
biffMaybeAdd(NRRD, err, useBiff); return 1;
}
--- 513,524 ----
int
! _nrrdReadNrrdParse_byte_skip (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_byte_skip", err[AIR_STRLEN_MED];
char *info;
! info = nio->line + nio->pos;
! _PARSE_ONE_VAL(nio->byteSkip, "%d", "int");
! if (!(-1 <= nio->byteSkip)) {
! sprintf(err, "%s: byteSkip value %d invalid", me, nio->byteSkip);
biffMaybeAdd(NRRD, err, useBiff); return 1;
}
***************
*** 527,536 ****
int
! _nrrdReadNrrdParse_keyvalue (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParse_keyvalue", err[AIR_STRLEN_MED];
char *keysep, *line, *key, *value;
/* we know this will find something */
! line = airStrdup(io->line);
if (!line) {
sprintf(err, "%s: can't allocate parse line", me);
--- 527,536 ----
int
! _nrrdReadNrrdParse_keyvalue (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParse_keyvalue", err[AIR_STRLEN_MED];
char *keysep, *line, *key, *value;
/* we know this will find something */
! line = airStrdup(nio->line);
if (!line) {
sprintf(err, "%s: can't allocate parse line", me);
***************
*** 597,606 ****
*/
int
! _nrrdReadNrrdParseField (Nrrd *nrrd, NrrdIoState *io, int useBiff) {
char me[]="_nrrdReadNrrdParseField", err[AIR_STRLEN_MED], *next,
*buff, *colon, *keysep;
int fld=nrrdField_unknown, noField=AIR_FALSE, badField=AIR_FALSE;
! next = io->line + io->pos;
/* determining if the line is a comment is simple */
--- 597,606 ----
*/
int
! _nrrdReadNrrdParseField (Nrrd *nrrd, NrrdIoState *nio, int useBiff) {
char me[]="_nrrdReadNrrdParseField", err[AIR_STRLEN_MED], *next,
*buff, *colon, *keysep;
int fld=nrrdField_unknown, noField=AIR_FALSE, badField=AIR_FALSE;
! next = nio->line + nio->pos;
/* determining if the line is a comment is simple */
***************
*** 655,659 ****
next += strspn(next, _nrrdFieldSep);
! io->pos = next - io->line;
return fld;
--- 655,659 ----
next += strspn(next, _nrrdFieldSep);
! nio->pos = next - nio->line;
return fld;
|
|
From: <kin...@us...> - 2003-12-18 01:04:23
|
Update of /cvsroot/teem/teem/src/ten In directory sc8-pr-cvs1:/tmp/cvs-serv30430 Modified Files: GNUmakefile ten.h Log Message: added \"tend helix\" for making cool twisting helical tensor fields Index: GNUmakefile =================================================================== RCS file: /cvsroot/teem/teem/src/ten/GNUmakefile,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** GNUmakefile 8 Dec 2003 23:19:02 -0000 1.34 --- GNUmakefile 18 Dec 2003 01:04:20 -0000 1.35 *************** *** 54,58 **** tendFiber.o tendEpireg.o tendBmat.o tendEstim.o tendSim.o \ tendSlice.o tendEllipse.o tendEvecrgb.o tendNorm.o tendAnscale.o \ ! tendEvalpow.o tendEvalclamp.o tendEvaladd.o $(L).TESTS = test/tg test/tt test/tem #### --- 54,58 ---- tendFiber.o tendEpireg.o tendBmat.o tendEstim.o tendSim.o \ tendSlice.o tendEllipse.o tendEvecrgb.o tendNorm.o tendAnscale.o \ ! tendEvalpow.o tendEvalclamp.o tendEvaladd.o tendHelix.o $(L).TESTS = test/tg test/tt test/tem #### Index: ten.h =================================================================== RCS file: /cvsroot/teem/teem/src/ten/ten.h,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** ten.h 18 Nov 2003 10:04:54 -0000 1.66 --- ten.h 18 Dec 2003 01:04:20 -0000 1.67 *************** *** 464,467 **** --- 464,468 ---- F(sim) \ F(make) \ + F(helix) \ F(sten) \ F(glyph) \ |
|
From: <kin...@us...> - 2003-12-18 01:02:16
|
Update of /cvsroot/teem/teem/src/ell
In directory sc8-pr-cvs1:/tmp/cvs-serv30105/ell
Modified Files:
ellMacros.h
Log Message:
renamed macros ELL_{3,4}M_TRAN* to ELL_{3,4}M_TRANSPOSE*, added ELL_3M_{SCALE,ROTATE{X,Y,Z}}
Index: ellMacros.h
===================================================================
RCS file: /cvsroot/teem/teem/src/ell/ellMacros.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** ellMacros.h 6 Oct 2003 11:16:51 -0000 1.35
--- ellMacros.h 18 Dec 2003 01:02:13 -0000 1.36
***************
*** 155,158 ****
--- 155,163 ----
#define ELL_3V_LEN(v) (sqrt(ELL_3V_DOT((v),(v))))
+ #define ELL_3V_DIST(a, b) \
+ sqrt(((a)[0] - (b)[0])*((a)[0] - (b)[0]) + \
+ ((a)[1] - (b)[1])*((a)[1] - (b)[1]) + \
+ ((a)[2] - (b)[2])*((a)[2] - (b)[2]))
+
#define ELL_3V_NORM(v2, v1, length) \
(length = ELL_3V_LEN(v1), ELL_3V_SCALE(v2, 1.0/length, v1))
***************
*** 233,237 ****
((m)[0] = (a), (m)[4] = (b), (m)[8] = (c))
! #define ELL_3M_TRAN(m2, m1) \
((m2)[0] = (m1)[0], \
(m2)[1] = (m1)[3], \
--- 238,242 ----
((m)[0] = (a), (m)[4] = (b), (m)[8] = (c))
! #define ELL_3M_TRANSPOSE(m2, m1) \
((m2)[0] = (m1)[0], \
(m2)[1] = (m1)[3], \
***************
*** 244,248 ****
(m2)[8] = (m1)[8])
! #define ELL_3M_TRAN_IP(m, t) \
(ELL_SWAP2((m)[1],(m)[3],(t)), \
ELL_SWAP2((m)[2],(m)[6],(t)), \
--- 249,253 ----
(m2)[8] = (m1)[8])
! #define ELL_3M_TRANSPOSE_IP(m, t) \
(ELL_SWAP2((m)[1],(m)[3],(t)), \
ELL_SWAP2((m)[2],(m)[6],(t)), \
***************
*** 337,340 ****
--- 342,364 ----
(m3)[8] = (m1)[2]*(m2)[6] + (m1)[5]*(m2)[7] + (m1)[8]*(m2)[8])
+ #define ELL_3M_SCALE_SET(m, x, y, z) \
+ (ELL_3V_SET((m)+ 0, (x), 0 , 0 ), \
+ ELL_3V_SET((m)+ 3, 0 , (y), 0 ), \
+ ELL_3V_SET((m)+ 6, 0 , 0 , (z)))
+
+ #define ELL_3M_ROTATE_X_SET(m, th) \
+ (ELL_3V_SET((m)+ 0, 1 , 0 , 0 ), \
+ ELL_3V_SET((m)+ 3, 0 , cos(th) , +sin(th)), \
+ ELL_3V_SET((m)+ 6, 0 , -sin(th) , cos(th)))
+
+ #define ELL_3M_ROTATE_Y_SET(m, th) \
+ (ELL_3V_SET((m)+ 0, cos(th) , 0 , -sin(th)), \
+ ELL_3V_SET((m)+ 3, 0 , 1 , 0 ), \
+ ELL_3V_SET((m)+ 6, +sin(th) , 0 , cos(th)))
+
+ #define ELL_3M_ROTATE_Z_SET(m, th) \
+ (ELL_3V_SET((m)+ 0, cos(th) , +sin(th) , 0), \
+ ELL_3V_SET((m)+ 3, -sin(th) , cos(th) , 0), \
+ ELL_3V_SET((m)+ 6, 0 , 0 , 1))
/*
***************
*** 431,435 ****
ELL_4V_COPY((m2)+12, (m1)+12))
! #define ELL_4M_TRAN(m2, m1) \
((m2)[ 0] = (m1)[ 0], \
(m2)[ 1] = (m1)[ 4], \
--- 455,459 ----
ELL_4V_COPY((m2)+12, (m1)+12))
! #define ELL_4M_TRANSPOSE(m2, m1) \
((m2)[ 0] = (m1)[ 0], \
(m2)[ 1] = (m1)[ 4], \
***************
*** 449,453 ****
(m2)[15] = (m1)[15])
! #define ELL_4M_TRAN_IP(m, t) \
(ELL_SWAP2((m)[ 1],(m)[ 4],(t)), \
ELL_SWAP2((m)[ 2],(m)[ 8],(t)), \
--- 473,477 ----
(m2)[15] = (m1)[15])
! #define ELL_4M_TRANSPOSE_IP(m, t) \
(ELL_SWAP2((m)[ 1],(m)[ 4],(t)), \
ELL_SWAP2((m)[ 2],(m)[ 8],(t)), \
|
|
From: <kin...@us...> - 2003-12-18 01:02:16
|
Update of /cvsroot/teem/teem/src/gage
In directory sc8-pr-cvs1:/tmp/cvs-serv30105/gage
Modified Files:
vecGage.c
Log Message:
renamed macros ELL_{3,4}M_TRAN* to ELL_{3,4}M_TRANSPOSE*, added ELL_3M_{SCALE,ROTATE{X,Y,Z}}
Index: vecGage.c
===================================================================
RCS file: /cvsroot/teem/teem/src/gage/vecGage.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** vecGage.c 26 Aug 2003 21:36:06 -0000 1.11
--- vecGage.c 18 Dec 2003 01:02:13 -0000 1.12
***************
*** 174,178 ****
derivatives of the X component; this should be the 1st row, and
likewise for the 2nd and 3rd column/rows. */
! ELL_3M_TRAN_IP(jac, tmp);
}
--- 174,178 ----
derivatives of the X component; this should be the 1st row, and
likewise for the 2nd and 3rd column/rows. */
! ELL_3M_TRANSPOSE_IP(jac, tmp);
}
|
|
From: <kin...@us...> - 2003-12-18 01:02:16
|
Update of /cvsroot/teem/teem/src/ten
In directory sc8-pr-cvs1:/tmp/cvs-serv30105/ten
Modified Files:
tensor.c
Log Message:
renamed macros ELL_{3,4}M_TRAN* to ELL_{3,4}M_TRANSPOSE*, added ELL_3M_{SCALE,ROTATE{X,Y,Z}}
Index: tensor.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tensor.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** tensor.c 8 Dec 2003 23:19:03 -0000 1.24
--- tensor.c 18 Dec 2003 01:02:13 -0000 1.25
***************
*** 289,293 ****
ELL_3M_ZERO_SET(diag);
ELL_3M_DIAG_SET(diag, eval[0], eval[1], eval[2]);
! ELL_3M_TRAN(evecT, evec);
ELL_3M_MUL(tmpMat1, diag, evecT);
ELL_3M_MUL(tmpMat2, evec, tmpMat1);
--- 289,293 ----
ELL_3M_ZERO_SET(diag);
ELL_3M_DIAG_SET(diag, eval[0], eval[1], eval[2]);
! ELL_3M_TRANSPOSE(evecT, evec);
ELL_3M_MUL(tmpMat1, diag, evecT);
ELL_3M_MUL(tmpMat2, evec, tmpMat1);
|
|
From: <kin...@us...> - 2003-12-18 01:02:16
|
Update of /cvsroot/teem/teem/src/ten/test
In directory sc8-pr-cvs1:/tmp/cvs-serv30105/ten/test
Modified Files:
tt.c tg.c
Log Message:
renamed macros ELL_{3,4}M_TRAN* to ELL_{3,4}M_TRANSPOSE*, added ELL_3M_{SCALE,ROTATE{X,Y,Z}}
Index: tt.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/test/tt.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** tt.c 29 Nov 2003 08:17:11 -0000 1.10
--- tt.c 18 Dec 2003 01:02:13 -0000 1.11
***************
*** 129,133 ****
ELL_4V_SCALE(q, 1.0/len, q);
washQtoM3(mRF, q);
! ELL_3M_TRAN(mRI, mRF);
for (yi=0; yi<samp; yi++) {
ca = AIR_AFFINE(0, yi, samp-1, hack, maxca);
--- 129,133 ----
ELL_4V_SCALE(q, 1.0/len, q);
washQtoM3(mRF, q);
! ELL_3M_TRANSPOSE(mRI, mRF);
for (yi=0; yi<samp; yi++) {
ca = AIR_AFFINE(0, yi, samp-1, hack, maxca);
Index: tg.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/test/tg.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** tg.c 6 Oct 2003 09:23:07 -0000 1.5
--- tg.c 18 Dec 2003 01:02:13 -0000 1.6
***************
*** 114,118 ****
ELL_4V_SCALE(q, 1.0/len, q);
washQtoM3(mRF, q);
! ELL_3M_TRAN(mRI, mRF);
ELL_3M_IDENTITY_SET(mT);
--- 114,118 ----
ELL_4V_SCALE(q, 1.0/len, q);
washQtoM3(mRF, q);
! ELL_3M_TRANSPOSE(mRI, mRF);
ELL_3M_IDENTITY_SET(mT);
|
|
From: <kin...@us...> - 2003-12-18 01:00:29
|
Update of /cvsroot/teem/teem/src
In directory sc8-pr-cvs1:/tmp/cvs-serv29646
Modified Files:
TODO.txt
Log Message:
the road ahead
Index: TODO.txt
===================================================================
RCS file: /cvsroot/teem/teem/src/TODO.txt,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** TODO.txt 30 Oct 2003 21:31:46 -0000 1.15
--- TODO.txt 18 Dec 2003 01:00:16 -0000 1.16
***************
*** 1,2 ****
--- 1,6 ----
+ DESTROY the airType* enum! I wasted quite awhile debugging a problem caused by:
+ if (nrrdAlloc(nout, airTypeFloat, 3, size[0], size[1], size[2])) { ...
+ Do you see the problem? Grrr.
+
FAQ on teem coding standards
Banks's policy.txt:
|
|
From: <kin...@us...> - 2003-12-16 01:28:28
|
Update of /cvsroot/teem/teem/src/air In directory sc8-pr-cvs1:/tmp/cvs-serv13312 Modified Files: air.h Log Message: fix for M_PI et al on Windows for NrrdIO Index: air.h =================================================================== RCS file: /cvsroot/teem/teem/src/air/air.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** air.h 16 Dec 2003 01:22:48 -0000 1.30 --- air.h 16 Dec 2003 01:28:25 -0000 1.31 *************** *** 46,50 **** #endif ! #ifdef _WIN32 && !defined(__CYGWIN__) typedef signed __int64 airLLong; typedef unsigned __int64 airULLong; --- 46,50 ---- #endif ! #if defined(_WIN32) && !defined(__CYGWIN__) typedef signed __int64 airLLong; typedef unsigned __int64 airULLong; |
|
From: <kin...@us...> - 2003-12-16 01:22:51
|
Update of /cvsroot/teem/teem/src/air In directory sc8-pr-cvs1:/tmp/cvs-serv12578 Modified Files: air.h Log Message: fix for M_PI et al on Windows for NrrdIO Index: air.h =================================================================== RCS file: /cvsroot/teem/teem/src/air/air.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** air.h 1 Dec 2003 09:21:19 -0000 1.29 --- air.h 16 Dec 2003 01:22:48 -0000 1.30 *************** *** 40,49 **** #ifdef _WIN32 - /* ---- BEGIN non-NrrdIO */ #if _MSC_VER < 1300 || !defined(_USE_MATH_DEFINES) #define M_PI 3.14159265358979323846 #define M_E 2.71828182845904523536 #endif ! /* ---- END non-NrrdIO */ typedef signed __int64 airLLong; typedef unsigned __int64 airULLong; --- 40,50 ---- #ifdef _WIN32 #if _MSC_VER < 1300 || !defined(_USE_MATH_DEFINES) #define M_PI 3.14159265358979323846 #define M_E 2.71828182845904523536 #endif ! #endif ! ! #ifdef _WIN32 && !defined(__CYGWIN__) typedef signed __int64 airLLong; typedef unsigned __int64 airULLong; |
Update of /cvsroot/teem/teem/src/ten
In directory sc8-pr-cvs1:/tmp/cvs-serv25421
Modified Files:
GNUmakefile aniso.c bimod.c chan.c defaultsTen.c enumsTen.c
epireg.c fiber.c fiberMethods.c glyph.c miscTen.c mod.c
tenGage.c tendAnhist.c tendAnplot.c tendAnscale.c tendAnvol.c
tendBmat.c tendCalc.c tendEllipse.c tendEpireg.c tendEstim.c
tendEval.c tendEvaladd.c tendEvalclamp.c tendEvalpow.c
tendEvec.c tendEvecrgb.c tendEvq.c tendExpand.c tendFiber.c
tendFlotsam.c tendGlyph.c tendMake.c tendNorm.c tendPoint.c
tendSatin.c tendShrink.c tendSim.c tendSlice.c tendSten.c
tensor.c
Added Files:
privateTen.h
Removed Files:
tenPrivate.h
Log Message:
FILE RENAME: tenPrivate.h --> privateTen.h
--- NEW FILE: privateTen.h ---
/*
teem: Gordon Kindlmann's research software
Copyright (C) 2003, 2002, 2001, 2000, 1999, 1998 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 as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
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 the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef TEN_PRIVATE_HAS_BEEN_INCLUDED
#define TEN_PRIVATE_HAS_BEEN_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#define TEND_CMD(name, info) \
unrrduCmd tend_##name##Cmd = { #name, info, tend_##name##Main }
/* USAGE, PARSE: both copied verbatim from unrrdu/privateUnrrdu.h */
#define USAGE(info) \
if (!argc) { \
hestInfo(stderr, me, (info), hparm); \
hestUsage(stderr, hopt, me, hparm); \
hestGlossary(stderr, hopt, hparm); \
airMopError(mop); \
return 2; \
}
#define PARSE() \
if ((pret=hestParse(hopt, argc, argv, &perr, hparm))) { \
if (1 == pret) { \
fprintf(stderr, "%s: %s\n", me, perr); free(perr); \
hestUsage(stderr, hopt, me, hparm); \
airMopError(mop); \
return 2; \
} else { \
/* ... like tears ... in rain. Time ... to die. */ \
exit(1); \
} \
}
#ifdef __cplusplus
}
#endif
#endif /* TEN_PRIVATE_HAS_BEEN_INCLUDED */
Index: GNUmakefile
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/GNUmakefile,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** GNUmakefile 16 Oct 2003 20:33:54 -0000 1.33
--- GNUmakefile 8 Dec 2003 23:19:02 -0000 1.34
***************
*** 46,50 ****
$(L).NEED = echo limn gage dye unrrdu ell nrrd biff air
$(L).PUBLIC_HEADERS = ten.h tenMacros.h
! $(L).PRIVATE_HEADERS = tenPrivate.h
$(L).OBJS = tensor.o chan.o aniso.o glyph.o enumsTen.o miscTen.o mod.o \
tenGage.o fiberMethods.o fiber.o epireg.o defaultsTen.o bimod.o \
--- 46,50 ----
$(L).NEED = echo limn gage dye unrrdu ell nrrd biff air
$(L).PUBLIC_HEADERS = ten.h tenMacros.h
! $(L).PRIVATE_HEADERS = privateTen.h
$(L).OBJS = tensor.o chan.o aniso.o glyph.o enumsTen.o miscTen.o mod.o \
tenGage.o fiberMethods.o fiber.o epireg.o defaultsTen.o bimod.o \
Index: aniso.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/aniso.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** aniso.c 13 Oct 2003 13:18:45 -0000 1.23
--- aniso.c 8 Dec 2003 23:19:02 -0000 1.24
***************
*** 18,24 ****
*/
-
#include "ten.h"
! #include "tenPrivate.h"
float tenAnisoSigma = 0.000001;
--- 18,23 ----
*/
#include "ten.h"
! #include "privateTen.h"
float tenAnisoSigma = 0.000001;
Index: bimod.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/bimod.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** bimod.c 18 Sep 2003 09:05:19 -0000 1.4
--- bimod.c 8 Dec 2003 23:19:02 -0000 1.5
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
tenEMBimodalParm*
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
tenEMBimodalParm*
Index: chan.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/chan.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** chan.c 16 Oct 2003 20:29:14 -0000 1.27
--- chan.c 8 Dec 2003 23:19:02 -0000 1.28
***************
*** 18,24 ****
*/
-
#include "ten.h"
! #include "tenPrivate.h"
/*
--- 18,23 ----
*/
#include "ten.h"
! #include "privateTen.h"
/*
Index: defaultsTen.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/defaultsTen.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** defaultsTen.c 14 Oct 2003 08:20:38 -0000 1.6
--- defaultsTen.c 8 Dec 2003 23:19:02 -0000 1.7
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
const char *
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
const char *
Index: enumsTen.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/enumsTen.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** enumsTen.c 13 Oct 2003 13:19:05 -0000 1.11
--- enumsTen.c 8 Dec 2003 23:19:02 -0000 1.12
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
/* -------------------------------------------------------------- */
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
/* -------------------------------------------------------------- */
Index: epireg.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/epireg.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** epireg.c 7 Oct 2003 20:05:19 -0000 1.21
--- epireg.c 8 Dec 2003 23:19:02 -0000 1.22
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
int
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
int
Index: fiber.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/fiber.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** fiber.c 16 Oct 2003 10:28:53 -0000 1.9
--- fiber.c 8 Dec 2003 23:19:03 -0000 1.10
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define TEN_FIBER_INCR 512
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define TEN_FIBER_INCR 512
Index: fiberMethods.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/fiberMethods.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** fiberMethods.c 14 Oct 2003 08:20:38 -0000 1.10
--- fiberMethods.c 8 Dec 2003 23:19:03 -0000 1.11
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
/*
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
/*
Index: glyph.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/glyph.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** glyph.c 18 Nov 2003 10:04:54 -0000 1.29
--- glyph.c 8 Dec 2003 23:19:03 -0000 1.30
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
tenGlyphParm *
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
tenGlyphParm *
Index: miscTen.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/miscTen.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** miscTen.c 30 Oct 2003 21:35:25 -0000 1.19
--- miscTen.c 8 Dec 2003 23:19:03 -0000 1.20
***************
*** 20,24 ****
#include "ten.h"
! #include "tenPrivate.h"
int
--- 20,24 ----
#include "ten.h"
! #include "privateTen.h"
int
Index: mod.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/mod.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** mod.c 16 Oct 2003 20:34:52 -0000 1.7
--- mod.c 8 Dec 2003 23:19:03 -0000 1.8
***************
*** 20,24 ****
#include "ten.h"
! #include "tenPrivate.h"
int
--- 20,24 ----
#include "ten.h"
! #include "privateTen.h"
int
Index: tenGage.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tenGage.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** tenGage.c 26 Aug 2003 21:36:06 -0000 1.7
--- tenGage.c 8 Dec 2003 23:19:03 -0000 1.8
***************
*** 20,24 ****
#include "ten.h"
! #include "tenPrivate.h"
/*
--- 20,24 ----
#include "ten.h"
! #include "privateTen.h"
/*
Index: tendAnhist.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendAnhist.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** tendAnhist.c 23 Jul 2003 01:20:30 -0000 1.3
--- tendAnhist.c 8 Dec 2003 23:19:03 -0000 1.4
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Generate barycentric histograms of anisotropy"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Generate barycentric histograms of anisotropy"
Index: tendAnplot.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendAnplot.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** tendAnplot.c 27 Jul 2003 09:33:26 -0000 1.7
--- tendAnplot.c 8 Dec 2003 23:19:03 -0000 1.8
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Graph anisotropy metric in barycentric coords"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Graph anisotropy metric in barycentric coords"
Index: tendAnscale.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendAnscale.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** tendAnscale.c 16 Oct 2003 20:37:15 -0000 1.3
--- tendAnscale.c 8 Dec 2003 23:19:03 -0000 1.4
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Scale the anisotropic component of the tensors"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Scale the anisotropic component of the tensors"
Index: tendAnvol.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendAnvol.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** tendAnvol.c 23 Jul 2003 01:20:30 -0000 1.5
--- tendAnvol.c 8 Dec 2003 23:19:03 -0000 1.6
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Apply an anisotropy metric to a DT volume"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Apply an anisotropy metric to a DT volume"
Index: tendBmat.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendBmat.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** tendBmat.c 16 Oct 2003 10:01:01 -0000 1.3
--- tendBmat.c 8 Dec 2003 23:19:03 -0000 1.4
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Calculate B-matrix given gradient directions"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Calculate B-matrix given gradient directions"
Index: tendCalc.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendCalc.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** tendCalc.c 23 Jul 2003 01:20:30 -0000 1.8
--- tendCalc.c 8 Dec 2003 23:19:03 -0000 1.9
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Calculate tensors from DW images"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Calculate tensors from DW images"
Index: tendEllipse.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendEllipse.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** tendEllipse.c 6 Oct 2003 11:05:41 -0000 1.2
--- tendEllipse.c 8 Dec 2003 23:19:03 -0000 1.3
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Generate postscript renderings of 2D glyphs"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Generate postscript renderings of 2D glyphs"
Index: tendEpireg.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendEpireg.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** tendEpireg.c 7 Oct 2003 21:01:01 -0000 1.12
--- tendEpireg.c 8 Dec 2003 23:19:03 -0000 1.13
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Register diffusion-weighted echo-planar images"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Register diffusion-weighted echo-planar images"
Index: tendEstim.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendEstim.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** tendEstim.c 16 Oct 2003 20:33:01 -0000 1.10
--- tendEstim.c 8 Dec 2003 23:19:03 -0000 1.11
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Estimate tensors from a set of DW images"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Estimate tensors from a set of DW images"
Index: tendEval.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendEval.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** tendEval.c 12 Oct 2003 23:19:34 -0000 1.12
--- tendEval.c 8 Dec 2003 23:19:03 -0000 1.13
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Calculate one or more eigenvalues in a DT volume"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Calculate one or more eigenvalues in a DT volume"
Index: tendEvaladd.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendEvaladd.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** tendEvaladd.c 16 Oct 2003 21:20:42 -0000 1.1
--- tendEvaladd.c 8 Dec 2003 23:19:03 -0000 1.2
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Modify shape by adding a constant to all eigenvalues"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Modify shape by adding a constant to all eigenvalues"
Index: tendEvalclamp.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendEvalclamp.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** tendEvalclamp.c 7 Oct 2003 13:57:41 -0000 1.1
--- tendEvalclamp.c 8 Dec 2003 23:19:03 -0000 1.2
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Modify shape by clamping eigenvalues in some range"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Modify shape by clamping eigenvalues in some range"
Index: tendEvalpow.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendEvalpow.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** tendEvalpow.c 7 Oct 2003 13:57:41 -0000 1.1
--- tendEvalpow.c 8 Dec 2003 23:19:03 -0000 1.2
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Modify shape by raising eigenvalues to some power"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Modify shape by raising eigenvalues to some power"
Index: tendEvec.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendEvec.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** tendEvec.c 12 Oct 2003 23:19:35 -0000 1.13
--- tendEvec.c 8 Dec 2003 23:19:03 -0000 1.14
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Calculate one or more eigenvectors in a DT volume"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Calculate one or more eigenvectors in a DT volume"
Index: tendEvecrgb.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendEvecrgb.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** tendEvecrgb.c 13 Oct 2003 13:21:18 -0000 1.3
--- tendEvecrgb.c 8 Dec 2003 23:19:03 -0000 1.4
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Make an RGB volume from an eigenvector and an anisotropy"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Make an RGB volume from an eigenvector and an anisotropy"
Index: tendEvq.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendEvq.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** tendEvq.c 23 Jul 2003 01:20:30 -0000 1.5
--- tendEvq.c 8 Dec 2003 23:19:03 -0000 1.6
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Quantize directions of diffusion"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Quantize directions of diffusion"
Index: tendExpand.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendExpand.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** tendExpand.c 23 Jul 2003 01:20:30 -0000 1.5
--- tendExpand.c 8 Dec 2003 23:19:03 -0000 1.6
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Converts a 7-value DT volume to a 9-value DT volume"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Converts a 7-value DT volume to a 9-value DT volume"
Index: tendFiber.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendFiber.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** tendFiber.c 14 Oct 2003 08:28:38 -0000 1.5
--- tendFiber.c 8 Dec 2003 23:19:03 -0000 1.6
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Extract a single fiber tract, given a start point"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Extract a single fiber tract, given a start point"
Index: tendFlotsam.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendFlotsam.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** tendFlotsam.c 23 Jul 2003 01:20:30 -0000 1.3
--- tendFlotsam.c 8 Dec 2003 23:19:03 -0000 1.4
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
/*
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
/*
Index: tendGlyph.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendGlyph.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** tendGlyph.c 18 Nov 2003 10:04:55 -0000 1.19
--- tendGlyph.c 8 Dec 2003 23:19:03 -0000 1.20
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Generate postscript or ray-traced renderings of 3D glyphs"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Generate postscript or ray-traced renderings of 3D glyphs"
Index: tendMake.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendMake.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** tendMake.c 23 Jul 2003 01:20:30 -0000 1.4
--- tendMake.c 8 Dec 2003 23:19:03 -0000 1.5
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Create DT volume from confidence and eigensystem"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Create DT volume from confidence and eigensystem"
Index: tendNorm.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendNorm.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** tendNorm.c 7 Oct 2003 16:08:22 -0000 1.2
--- tendNorm.c 8 Dec 2003 23:19:03 -0000 1.3
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Normalize tensor size"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Normalize tensor size"
Index: tendPoint.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendPoint.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** tendPoint.c 12 Oct 2003 23:19:35 -0000 1.5
--- tendPoint.c 8 Dec 2003 23:19:03 -0000 1.6
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Describe everything about one sample in a DT volume"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Describe everything about one sample in a DT volume"
Index: tendSatin.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendSatin.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** tendSatin.c 16 Oct 2003 09:40:33 -0000 1.14
--- tendSatin.c 8 Dec 2003 23:19:03 -0000 1.15
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Generate a pretty synthetic DT volume"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Generate a pretty synthetic DT volume"
Index: tendShrink.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendShrink.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** tendShrink.c 23 Jul 2003 01:20:30 -0000 1.3
--- tendShrink.c 8 Dec 2003 23:19:03 -0000 1.4
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Converts a 9-value DT volume to a 7-value DT volume"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Converts a 9-value DT volume to a 7-value DT volume"
Index: tendSim.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendSim.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** tendSim.c 23 Jul 2003 01:20:30 -0000 1.3
--- tendSim.c 8 Dec 2003 23:19:03 -0000 1.4
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Simulate DW images from a tensor field"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Simulate DW images from a tensor field"
Index: tendSlice.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendSlice.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** tendSlice.c 7 Oct 2003 13:56:18 -0000 1.2
--- tendSlice.c 8 Dec 2003 23:19:03 -0000 1.3
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Slice 3D tensors to get slab/image of 3D/2D tensors"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Slice 3D tensors to get slab/image of 3D/2D tensors"
Index: tendSten.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tendSten.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** tendSten.c 23 Jul 2003 01:20:30 -0000 1.3
--- tendSten.c 8 Dec 2003 23:19:03 -0000 1.4
***************
*** 19,23 ****
#include "ten.h"
! #include "tenPrivate.h"
#define INFO "Calculate structure tensors from a scalar field"
--- 19,23 ----
#include "ten.h"
! #include "privateTen.h"
#define INFO "Calculate structure tensors from a scalar field"
Index: tensor.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/tensor.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** tensor.c 12 Oct 2003 23:19:35 -0000 1.23
--- tensor.c 8 Dec 2003 23:19:03 -0000 1.24
***************
*** 20,24 ****
#include "ten.h"
! #include "tenPrivate.h"
int tenVerbose = 0;
--- 20,24 ----
#include "ten.h"
! #include "privateTen.h"
int tenVerbose = 0;
--- tenPrivate.h DELETED ---
|
|
From: <kin...@us...> - 2003-12-08 23:17:21
|
Update of /cvsroot/teem/teem/src/unrrdu In directory sc8-pr-cvs1:/tmp/cvs-serv24848/unrrdu Modified Files: convert.c Log Message: fixed type in usage info Index: convert.c =================================================================== RCS file: /cvsroot/teem/teem/src/unrrdu/convert.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** convert.c 23 Jul 2003 01:20:30 -0000 1.15 --- convert.c 8 Dec 2003 23:17:16 -0000 1.16 *************** *** 26,30 **** "values; it just copies them from one type to another, which replicates " "exactly what you'd get in C when you assign from a variable of one type to " ! "another, or when you cast to a differet type. See also \"unu quantize\"," "\"unu 2op x\", and \"unu 3op clamp\"."); --- 26,30 ---- "values; it just copies them from one type to another, which replicates " "exactly what you'd get in C when you assign from a variable of one type to " ! "another, or when you cast to a different type. See also \"unu quantize\"," "\"unu 2op x\", and \"unu 3op clamp\"."); |
|
From: <kin...@us...> - 2003-12-01 09:21:53
|
Update of /cvsroot/teem/teem/src/air In directory sc8-pr-cvs1:/tmp/cvs-serv22980/air Modified Files: air.h Log Message: Nothing actually changed: just re-arranging source files and adding "BEGIN non-NrrdIO" and "END non-NrrdIO" comments to facilitate building NrrdIO Index: air.h =================================================================== RCS file: /cvsroot/teem/teem/src/air/air.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** air.h 4 Oct 2003 10:14:30 -0000 1.28 --- air.h 1 Dec 2003 09:21:19 -0000 1.29 *************** *** 40,47 **** --- 40,49 ---- #ifdef _WIN32 + /* ---- BEGIN non-NrrdIO */ #if _MSC_VER < 1300 || !defined(_USE_MATH_DEFINES) #define M_PI 3.14159265358979323846 #define M_E 2.71828182845904523536 #endif + /* ---- END non-NrrdIO */ typedef signed __int64 airLLong; typedef unsigned __int64 airULLong; *************** *** 171,174 **** --- 173,178 ---- extern airArray *airArrayNuke(airArray *a); + /* ---- BEGIN non-NrrdIO */ + /* threadAir.c: simplistic wrapper functions for multi-threading */ /* *************** *** 220,223 **** --- 224,229 ---- extern int airThreadBarrierWait(airThreadBarrier *barrier); extern airThreadBarrier *airThreadBarrierNix(airThreadBarrier *barrier); + + /* ---- END non-NrrdIO */ /* |
Update of /cvsroot/teem/teem/src/nrrd
In directory sc8-pr-cvs1:/tmp/cvs-serv22980/nrrd
Modified Files:
enumsNrrd.c methodsNrrd.c nrrd.h nrrdEnums.h nrrdMacros.h
reorder.c simple.c
Log Message:
Nothing actually changed: just re-arranging source files and adding "BEGIN non-NrrdIO" and "END non-NrrdIO" comments to facilitate building NrrdIO
Index: enumsNrrd.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/enumsNrrd.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** enumsNrrd.c 6 Nov 2003 14:44:35 -0000 1.26
--- enumsNrrd.c 1 Dec 2003 09:21:20 -0000 1.27
***************
*** 95,130 ****
nrrdFormatType = &_nrrdFormatType;
- /* ------------------------ nrrdBoundary ------------------------- */
-
- char
- _nrrdBoundaryStr[NRRD_BOUNDARY_MAX+1][AIR_STRLEN_SMALL] = {
- "(unknown_boundary)",
- "pad",
- "bleed",
- "wrap",
- "weight"
- };
-
- char
- _nrrdBoundaryDesc[NRRD_BOUNDARY_MAX+1][AIR_STRLEN_MED] = {
- "unknown boundary behavior",
- "pad with some specified value",
- "copy values from edge outward as needed",
- "wrap around to other end of axis",
- "re-weight (by normalization) samples within axis range"
- };
-
- airEnum
- _nrrdBoundary = {
- "boundary behavior",
- NRRD_BOUNDARY_MAX,
- _nrrdBoundaryStr, NULL,
- _nrrdBoundaryDesc,
- NULL, NULL,
- AIR_FALSE
- };
- airEnum *
- nrrdBoundary = &_nrrdBoundary;
-
/* ------------------------ nrrdType ------------------------- */
--- 95,98 ----
***************
*** 274,399 ****
nrrdEncodingType = &_nrrdEncodingType;
- /* ------------------------ nrrdMeasure ------------------------- */
-
- char
- _nrrdMeasureStr[NRRD_MEASURE_MAX+1][AIR_STRLEN_SMALL] = {
- "(unknown_measure)",
- "min",
- "max",
- "mean",
- "median",
- "mode",
- "product",
- "sum",
- "L1",
- "L2",
- "Linf",
- "variance",
- "SD",
- "histo-min",
- "histo-max",
- "histo-mean",
- "histo-median",
- "histo-mode",
- "histo-product",
- "histo-sum",
- "histo-L2",
- "histo-variance",
- "histo-SD"
- };
-
- char
- _nrrdMeasureDesc[NRRD_MEASURE_MAX+1][AIR_STRLEN_MED] = {
- "unknown measure",
- "minimum of values",
- "maximum of values",
- "mean of values",
- "median of values",
- "mode of values",
- "product of values",
- "sum of values",
- "L1 norm of values",
- "L2 norm of values",
- "Linf norm of values",
- "variance of values",
- "standard deviation of values",
- "minimum of histogrammed values",
- "maximum of histogrammed values",
- "mean of histogrammed values",
- "median of histogrammed values",
- "mode of histogrammed values",
- "product of histogrammed values",
- "sum of histogrammed values",
- "L2 norm of histogrammed values",
- "variance of histogrammed values",
- "standard deviation of histogrammed values"
- };
-
- char
- _nrrdMeasureStrEqv[][AIR_STRLEN_SMALL] = {
- "(unknown_measure)",
- "min",
- "max",
- "mean",
- "median",
- "mode",
- "product", "prod",
- "sum",
- "L1",
- "L2",
- "Linf",
- "variance", "var",
- "SD",
- "histo-min",
- "histo-max",
- "histo-mean",
- "histo-median",
- "histo-mode",
- "histo-product",
- "histo-sum",
- "histo-l2",
- "histo-variance", "histo-var",
- "histo-sd"
- };
-
- int
- _nrrdMeasureValEqv[] = {
- nrrdMeasureUnknown,
- nrrdMeasureMin,
- nrrdMeasureMax,
- nrrdMeasureMean,
- nrrdMeasureMedian,
- nrrdMeasureMode,
- nrrdMeasureProduct, nrrdMeasureProduct,
- nrrdMeasureSum,
- nrrdMeasureL1,
- nrrdMeasureL2,
- nrrdMeasureLinf,
- nrrdMeasureVariance, nrrdMeasureVariance,
- nrrdMeasureSD,
- nrrdMeasureHistoMin,
- nrrdMeasureHistoMax,
- nrrdMeasureHistoMean,
- nrrdMeasureHistoMedian,
- nrrdMeasureHistoMode,
- nrrdMeasureHistoProduct,
- nrrdMeasureHistoSum,
- nrrdMeasureHistoL2,
- nrrdMeasureHistoVariance, nrrdMeasureHistoVariance,
- nrrdMeasureHistoSD
- };
-
- airEnum
- _nrrdMeasure = {
- "measure",
- NRRD_MEASURE_MAX,
- _nrrdMeasureStr, NULL,
- _nrrdMeasureDesc,
- _nrrdMeasureStrEqv, _nrrdMeasureValEqv,
- AIR_FALSE
- };
- airEnum *
- nrrdMeasure = &_nrrdMeasure;
-
/* ------------------------ nrrdCenter ------------------------- */
--- 242,245 ----
***************
*** 587,590 ****
--- 433,592 ----
nrrdField = &_nrrdField;
+ /* ---- BEGIN non-NrrdIO */
+
+ /* ------------------------ nrrdBoundary ------------------------- */
+
+ char
+ _nrrdBoundaryStr[NRRD_BOUNDARY_MAX+1][AIR_STRLEN_SMALL] = {
+ "(unknown_boundary)",
+ "pad",
+ "bleed",
+ "wrap",
+ "weight"
+ };
+
+ char
+ _nrrdBoundaryDesc[NRRD_BOUNDARY_MAX+1][AIR_STRLEN_MED] = {
+ "unknown boundary behavior",
+ "pad with some specified value",
+ "copy values from edge outward as needed",
+ "wrap around to other end of axis",
+ "re-weight (by normalization) samples within axis range"
+ };
+
+ airEnum
+ _nrrdBoundary = {
+ "boundary behavior",
+ NRRD_BOUNDARY_MAX,
+ _nrrdBoundaryStr, NULL,
+ _nrrdBoundaryDesc,
+ NULL, NULL,
+ AIR_FALSE
+ };
+ airEnum *
+ nrrdBoundary = &_nrrdBoundary;
+
+ /* ------------------------ nrrdMeasure ------------------------- */
+
+ char
+ _nrrdMeasureStr[NRRD_MEASURE_MAX+1][AIR_STRLEN_SMALL] = {
+ "(unknown_measure)",
+ "min",
+ "max",
+ "mean",
+ "median",
+ "mode",
+ "product",
+ "sum",
+ "L1",
+ "L2",
+ "Linf",
+ "variance",
+ "SD",
+ "histo-min",
+ "histo-max",
+ "histo-mean",
+ "histo-median",
+ "histo-mode",
+ "histo-product",
+ "histo-sum",
+ "histo-L2",
+ "histo-variance",
+ "histo-SD"
+ };
+
+ char
+ _nrrdMeasureDesc[NRRD_MEASURE_MAX+1][AIR_STRLEN_MED] = {
+ "unknown measure",
+ "minimum of values",
+ "maximum of values",
+ "mean of values",
+ "median of values",
+ "mode of values",
+ "product of values",
+ "sum of values",
+ "L1 norm of values",
+ "L2 norm of values",
+ "Linf norm of values",
+ "variance of values",
+ "standard deviation of values",
+ "minimum of histogrammed values",
+ "maximum of histogrammed values",
+ "mean of histogrammed values",
+ "median of histogrammed values",
+ "mode of histogrammed values",
+ "product of histogrammed values",
+ "sum of histogrammed values",
+ "L2 norm of histogrammed values",
+ "variance of histogrammed values",
+ "standard deviation of histogrammed values"
+ };
+
+ char
+ _nrrdMeasureStrEqv[][AIR_STRLEN_SMALL] = {
+ "(unknown_measure)",
+ "min",
+ "max",
+ "mean",
+ "median",
+ "mode",
+ "product", "prod",
+ "sum",
+ "L1",
+ "L2",
+ "Linf",
+ "variance", "var",
+ "SD",
+ "histo-min",
+ "histo-max",
+ "histo-mean",
+ "histo-median",
+ "histo-mode",
+ "histo-product",
+ "histo-sum",
+ "histo-l2",
+ "histo-variance", "histo-var",
+ "histo-sd"
+ };
+
+ int
+ _nrrdMeasureValEqv[] = {
+ nrrdMeasureUnknown,
+ nrrdMeasureMin,
+ nrrdMeasureMax,
+ nrrdMeasureMean,
+ nrrdMeasureMedian,
+ nrrdMeasureMode,
+ nrrdMeasureProduct, nrrdMeasureProduct,
+ nrrdMeasureSum,
+ nrrdMeasureL1,
+ nrrdMeasureL2,
+ nrrdMeasureLinf,
+ nrrdMeasureVariance, nrrdMeasureVariance,
+ nrrdMeasureSD,
+ nrrdMeasureHistoMin,
+ nrrdMeasureHistoMax,
+ nrrdMeasureHistoMean,
+ nrrdMeasureHistoMedian,
+ nrrdMeasureHistoMode,
+ nrrdMeasureHistoProduct,
+ nrrdMeasureHistoSum,
+ nrrdMeasureHistoL2,
+ nrrdMeasureHistoVariance, nrrdMeasureHistoVariance,
+ nrrdMeasureHistoSD
+ };
+
+ airEnum
+ _nrrdMeasure = {
+ "measure",
+ NRRD_MEASURE_MAX,
+ _nrrdMeasureStr, NULL,
+ _nrrdMeasureDesc,
+ _nrrdMeasureStrEqv, _nrrdMeasureValEqv,
+ AIR_FALSE
+ };
+ airEnum *
+ nrrdMeasure = &_nrrdMeasure;
+
/* ------------------------ nrrdUnaryOp ---------------------- */
***************
*** 936,937 ****
--- 938,940 ----
nrrdTernaryOp = &_nrrdTernaryOp_enum;
+ /* ---- END non-NrrdIO */
Index: methodsNrrd.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/methodsNrrd.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** methodsNrrd.c 30 Nov 2003 00:27:06 -0000 1.35
--- methodsNrrd.c 1 Dec 2003 09:21:20 -0000 1.36
***************
*** 84,87 ****
--- 84,89 ----
}
+ /* ---- BEGIN non-NrrdIO */
+
/* ------------------------------------------------------------ */
***************
*** 174,177 ****
--- 176,181 ----
}
}
+
+ /* ---- END non-NrrdIO */
/* ------------------------------------------------------------ */
Index: nrrd.h
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/nrrd.h,v
retrieving revision 1.125
retrieving revision 1.126
diff -C2 -d -r1.125 -r1.126
*** nrrd.h 30 Nov 2003 00:27:06 -0000 1.125
--- nrrd.h 1 Dec 2003 09:21:21 -0000 1.126
***************
*** 31,35 ****
--- 31,37 ----
#include <teem/air.h>
+ /* ---- BEGIN non-NrrdIO */
#include <teem/hest.h>
+ /* ---- END non-NrrdIO */
#include <teem/biff.h>
***************
*** 79,104 ****
/*
- ******** NrrdRange
- **
- ** information about a range of values, used as both a description
- ** of an existing nrrd, or as input to functions like nrrdQuantize
- ** (in which case the given min,max may not correspond to the actual
- ** min,max of the nrrd in question).
- **
- ** This information has been removed from the Nrrd struct (as of teem1.6)
- ** and put into this seperate entity because:
- ** 1) when intended to be descriptive of a nrrd, it can't be guaranteed
- ** to be true across nrrd calls
- ** 2) when used as input parameters (e.g. to nrrdQuantize), its not
- ** data-flow friendly (you can't modify input)
- */
- typedef struct {
- double min, max; /* if non-NaN, nominally: extremal values for array, but
- practically: the min and max values to use for nrrd
- calls for which a min and max values are used */
- int hasNonExist; /* from the nrrdHasNonExist* enum values */
- } NrrdRange;
-
- /*
******** Nrrd struct
**
--- 81,84 ----
***************
*** 152,264 ****
} Nrrd;
- /*
- ******** NrrdKernel struct
- **
- ** these are essentially the methods of the various kernels implemented.
- **
- ** Nrrd's use of this sort of kernel always assumes support symmetric
- ** around zero, but does not assume anything about even- or oddness
- **
- ** It is a strong but very simplifying assumption that the paramater
- ** array ("parm") is always type double. There is essentially no
- ** value in allowing flexibility between float and double, and much
- ** teem code assumes that it will always be type double.
- */
- typedef struct {
- /* terse string representation of kernel function, irrespective of
- the parameter vector */
- char name[AIR_STRLEN_SMALL];
-
- /* number of parameters needed (# elements in parm[] used) */
- int numParm;
-
- /* smallest x (x > 0) such that k(y) = 0 for all y > x, y < -x */
- double (*support)(const double *parm);
-
- /* integral of kernel from -support to +support */
- double (*integral)(const double *parm);
-
- /* evaluate once, single precision */
- float (*eval1_f)(float x, const double *parm);
-
- /* evaluate N times, single precision */
- void (*evalN_f)(float *f, const float *x, size_t N, const double *parm);
-
- /* evaluate once, double precision */
- double (*eval1_d)(double x, const double *parm);
-
- /* eval. N times, double precision */
- void (*evalN_d)(double *f, const double *x, size_t N, const double *parm);
- } NrrdKernel;
-
- /*
- ******** NrrdKernelSpec struct
- **
- ** for those times when it makes most sense to directly associate a
- ** NrrdKernel with its parameter vector (that is, a full kernel
- ** "spec"ification), basically: using hest.
- */
- typedef struct {
- NrrdKernel *kernel;
- double parm[NRRD_KERNEL_PARMS_NUM];
- } NrrdKernelSpec;
-
- /*
- ******** NrrdResampleInfo struct
- **
- ** a struct to contain the many parameters needed for nrrdSpatialResample()
- */
- typedef struct {
- const NrrdKernel
- *kernel[NRRD_DIM_MAX]; /* which kernel to use on each axis; use NULL to
- say no resampling whatsoever on this axis */
- int samples[NRRD_DIM_MAX]; /* number of samples per axis */
- double parm[NRRD_DIM_MAX][NRRD_KERNEL_PARMS_NUM], /* kernel arguments */
- min[NRRD_DIM_MAX],
- max[NRRD_DIM_MAX]; /* min[i] and max[i] are the range, in WORLD
- space, along which to resample
- axis i. axis mins and maxs are required
- on resampled axes. */
- int boundary, /* value from the nrrdBoundary enum */
- type, /* desired type of output, use
- nrrdTypeUnknown for "same as input" */
- renormalize, /* when downsampling with a kernel with
- non-zero integral, should we renormalize
- the weights to match the kernel integral
- so as to remove annoying ripple */
- round, /* when copying from the last intermediate
- (floating point) result to the output
- nrrd, for integer outputs, do we round
- to the nearest integer first, before
- clamping and assigning. Enabling this
- fixed the mystery of downsampling large
- constant regions of 255 (uchar), and
- ending up with 254 */
- clamp; /* when copying from the last intermediate
- (floating point) result to the output
- nrrd, should we clamp the values to the
- range of values for the output type, a
- concern only for integer outputs */
- double padValue; /* if padding, what value to pad with */
- } NrrdResampleInfo;
-
- /*
- ******** NrrdIter struct
- **
- ** To hold values: either a single value, or a whole nrrd of values.
- ** Also, this facilitates iterating through those values
- */
- typedef struct {
- const Nrrd *nrrd; /* read-only nrrd to get values from */
- Nrrd *ownNrrd; /* another nrrd to get values from, which we
- do "own", and do delete on nrrdIterNix */
- double val; /* single fixed value */
- int size; /* type size */
- char *data; /* where to get the next value */
- size_t left; /* number of values beyond what "data"
- currently points to */
- double (*load)(const void*); /* how to get a value out of "data" */
- } NrrdIter;
-
struct NrrdIoState_t;
struct NrrdEncoding_t;
--- 132,135 ----
***************
*** 412,434 ****
} NrrdIoState;
/*
! ******** nrrdIoState* enum
**
! ** the various things it makes sense to get and set in nrrdIoState struct
! ** via nrrdIoStateGet and nrrdIoStateSet
*/
! enum {
! nrrdIoStateUnknown,
! nrrdIoStateDetachedHeader,
! nrrdIoStateBareText,
! nrrdIoStateCharsPerLine,
! nrrdIoStateValsPerLine,
! nrrdIoStateSkipData,
! nrrdIoStateKeepNrrdDataFileOpen,
! nrrdIoStateZlibLevel,
! nrrdIoStateZlibStrategy,
! nrrdIoStateBzip2BlockSize,
! nrrdIoStateLast
! };
/******** defaults (nrrdDef..) and state (nrrdState..) */
--- 283,420 ----
} NrrdIoState;
+ /* ---- BEGIN non-NrrdIO */
+
/*
! ******** NrrdRange
! **
! ** information about a range of values, used as both a description
! ** of an existing nrrd, or as input to functions like nrrdQuantize
! ** (in which case the given min,max may not correspond to the actual
! ** min,max of the nrrd in question).
! **
! ** This information has been removed from the Nrrd struct (as of teem1.6)
! ** and put into this seperate entity because:
! ** 1) when intended to be descriptive of a nrrd, it can't be guaranteed
! ** to be true across nrrd calls
! ** 2) when used as input parameters (e.g. to nrrdQuantize), its not
! ** data-flow friendly (you can't modify input)
! */
! typedef struct {
! double min, max; /* if non-NaN, nominally: extremal values for array, but
! practically: the min and max values to use for nrrd
! calls for which a min and max values are used */
! int hasNonExist; /* from the nrrdHasNonExist* enum values */
! } NrrdRange;
!
! /*
! ******** NrrdKernel struct
! **
! ** these are essentially the methods of the various kernels implemented.
! **
! ** Nrrd's use of this sort of kernel always assumes support symmetric
! ** around zero, but does not assume anything about even- or oddness
! **
! ** It is a strong but very simplifying assumption that the paramater
! ** array ("parm") is always type double. There is essentially no
! ** value in allowing flexibility between float and double, and much
! ** teem code assumes that it will always be type double.
! */
! typedef struct {
! /* terse string representation of kernel function, irrespective of
! the parameter vector */
! char name[AIR_STRLEN_SMALL];
!
! /* number of parameters needed (# elements in parm[] used) */
! int numParm;
!
! /* smallest x (x > 0) such that k(y) = 0 for all y > x, y < -x */
! double (*support)(const double *parm);
!
! /* integral of kernel from -support to +support */
! double (*integral)(const double *parm);
!
! /* evaluate once, single precision */
! float (*eval1_f)(float x, const double *parm);
!
! /* evaluate N times, single precision */
! void (*evalN_f)(float *f, const float *x, size_t N, const double *parm);
!
! /* evaluate once, double precision */
! double (*eval1_d)(double x, const double *parm);
!
! /* eval. N times, double precision */
! void (*evalN_d)(double *f, const double *x, size_t N, const double *parm);
! } NrrdKernel;
!
! /*
! ******** NrrdKernelSpec struct
**
! ** for those times when it makes most sense to directly associate a
! ** NrrdKernel with its parameter vector (that is, a full kernel
! ** "spec"ification), basically: using hest.
*/
! typedef struct {
! NrrdKernel *kernel;
! double parm[NRRD_KERNEL_PARMS_NUM];
! } NrrdKernelSpec;
!
! /*
! ******** NrrdResampleInfo struct
! **
! ** a struct to contain the many parameters needed for nrrdSpatialResample()
! */
! typedef struct {
! const NrrdKernel
! *kernel[NRRD_DIM_MAX]; /* which kernel to use on each axis; use NULL to
! say no resampling whatsoever on this axis */
! int samples[NRRD_DIM_MAX]; /* number of samples per axis */
! double parm[NRRD_DIM_MAX][NRRD_KERNEL_PARMS_NUM], /* kernel arguments */
! min[NRRD_DIM_MAX],
! max[NRRD_DIM_MAX]; /* min[i] and max[i] are the range, in WORLD
! space, along which to resample
! axis i. axis mins and maxs are required
! on resampled axes. */
! int boundary, /* value from the nrrdBoundary enum */
! type, /* desired type of output, use
! nrrdTypeUnknown for "same as input" */
! renormalize, /* when downsampling with a kernel with
! non-zero integral, should we renormalize
! the weights to match the kernel integral
! so as to remove annoying ripple */
! round, /* when copying from the last intermediate
! (floating point) result to the output
! nrrd, for integer outputs, do we round
! to the nearest integer first, before
! clamping and assigning. Enabling this
! fixed the mystery of downsampling large
! constant regions of 255 (uchar), and
! ending up with 254 */
! clamp; /* when copying from the last intermediate
! (floating point) result to the output
! nrrd, should we clamp the values to the
! range of values for the output type, a
! concern only for integer outputs */
! double padValue; /* if padding, what value to pad with */
! } NrrdResampleInfo;
!
! /*
! ******** NrrdIter struct
! **
! ** To hold values: either a single value, or a whole nrrd of values.
! ** Also, this facilitates iterating through those values
! */
! typedef struct {
! const Nrrd *nrrd; /* read-only nrrd to get values from */
! Nrrd *ownNrrd; /* another nrrd to get values from, which we
! do "own", and do delete on nrrdIterNix */
! double val; /* single fixed value */
! int size; /* type size */
! char *data; /* where to get the next value */
! size_t left; /* number of values beyond what "data"
! currently points to */
! double (*load)(const void*); /* how to get a value out of "data" */
! } NrrdIter;
!
! /* ---- END non-NrrdIO */
/******** defaults (nrrdDef..) and state (nrrdState..) */
***************
*** 466,479 ****
/* enumsNrrd.c */
extern nrrd_export airEnum *nrrdFormatType;
- extern nrrd_export airEnum *nrrdBoundary;
extern nrrd_export airEnum *nrrdType;
extern nrrd_export airEnum *nrrdEncodingType;
- extern nrrd_export airEnum *nrrdMeasure;
extern nrrd_export airEnum *nrrdCenter;
extern nrrd_export airEnum *nrrdAxisInfo;
extern nrrd_export airEnum *nrrdField;
extern nrrd_export airEnum *nrrdUnaryOp;
extern nrrd_export airEnum *nrrdBinaryOp;
extern nrrd_export airEnum *nrrdTernaryOp;
/******** arrays of things (poor-man's functions/predicates) */
--- 452,467 ----
/* enumsNrrd.c */
extern nrrd_export airEnum *nrrdFormatType;
extern nrrd_export airEnum *nrrdType;
extern nrrd_export airEnum *nrrdEncodingType;
extern nrrd_export airEnum *nrrdCenter;
extern nrrd_export airEnum *nrrdAxisInfo;
extern nrrd_export airEnum *nrrdField;
+ /* ---- BEGIN non-NrrdIO */
+ extern nrrd_export airEnum *nrrdBoundary;
+ extern nrrd_export airEnum *nrrdMeasure;
extern nrrd_export airEnum *nrrdUnaryOp;
extern nrrd_export airEnum *nrrdBinaryOp;
extern nrrd_export airEnum *nrrdTernaryOp;
+ /* ---- END non-NrrdIO */
/******** arrays of things (poor-man's functions/predicates) */
***************
*** 487,496 ****
extern nrrd_export double nrrdTypeNumberOfValues[];
- /******** things useful with hest */
- /* hestNrrd.c */
- extern nrrd_export hestCB *nrrdHestNrrd;
- extern nrrd_export hestCB *nrrdHestKernelSpec;
- extern nrrd_export hestCB *nrrdHestIter;
-
/******** pseudo-constructors, pseudo-destructors, and such */
/* methodsNrrd.c */
--- 475,478 ----
***************
*** 498,501 ****
--- 480,484 ----
extern void nrrdIoStateInit(NrrdIoState *io);
extern NrrdIoState *nrrdIoStateNix(NrrdIoState *io);
+ /* ---- BEGIN non-NrrdIO */
extern NrrdResampleInfo *nrrdResampleInfoNew(void);
extern NrrdResampleInfo *nrrdResampleInfoNix(NrrdResampleInfo *info);
***************
*** 507,510 ****
--- 490,494 ----
NrrdKernelSpec *ksp);
extern NrrdKernelSpec *nrrdKernelSpecNix(NrrdKernelSpec *ksp);
+ /* ---- END non-NrrdIO */
extern void nrrdInit(Nrrd *nrrd);
extern Nrrd *nrrdNew(void);
***************
*** 526,539 ****
extern int nrrdPGM(Nrrd *, int sx, int sy);
- /******** nrrd value iterator gadget */
- /* iter.c */
- extern NrrdIter *nrrdIterNew(void);
- extern void nrrdIterSetValue(NrrdIter *iter, double val);
- extern void nrrdIterSetNrrd(NrrdIter *iter, const Nrrd *nrrd);
- extern void nrrdIterSetOwnNrrd(NrrdIter *iter, Nrrd *nrrd);
- extern double nrrdIterValue(NrrdIter *iter);
- extern char *nrrdIterContent(NrrdIter *iter);
- extern NrrdIter *nrrdIterNix(NrrdIter *iter);
-
/******** axis info related */
/* axis.c */
--- 510,513 ----
***************
*** 594,628 ****
extern void nrrdSwapEndian(Nrrd *nrrd);
- /******** getting value into and out of an array of general type, and
- all other simplistic functionality pseudo-parameterized by type */
- /* accessors.c */
- extern nrrd_export int (*nrrdILoad[NRRD_TYPE_MAX+1])(const void *v);
- extern nrrd_export float (*nrrdFLoad[NRRD_TYPE_MAX+1])(const void *v);
- extern nrrd_export double (*nrrdDLoad[NRRD_TYPE_MAX+1])(const void *v);
- extern nrrd_export int (*nrrdIStore[NRRD_TYPE_MAX+1])(void *v, int j);
- extern nrrd_export float (*nrrdFStore[NRRD_TYPE_MAX+1])(void *v, float f);
- extern nrrd_export double (*nrrdDStore[NRRD_TYPE_MAX+1])(void *v, double d);
- extern nrrd_export int (*nrrdILookup[NRRD_TYPE_MAX+1])(const void *v,
- size_t I);
- extern nrrd_export float (*nrrdFLookup[NRRD_TYPE_MAX+1])(const void *v,
- size_t I);
- extern nrrd_export double (*nrrdDLookup[NRRD_TYPE_MAX+1])(const void *v,
- size_t I);
- extern nrrd_export int (*nrrdIInsert[NRRD_TYPE_MAX+1])(void *v,
- size_t I, int j);
- extern nrrd_export float (*nrrdFInsert[NRRD_TYPE_MAX+1])(void *v,
- size_t I, float f);
- extern nrrd_export double (*nrrdDInsert[NRRD_TYPE_MAX+1])(void *v,
- size_t I, double d);
- extern nrrd_export int (*nrrdSprint[NRRD_TYPE_MAX+1])(char *, const void *);
- extern nrrd_export int (*nrrdFprint[NRRD_TYPE_MAX+1])(FILE *, const void *);
- extern nrrd_export float (*nrrdFClamp[NRRD_TYPE_MAX+1])(float);
- extern nrrd_export double (*nrrdDClamp[NRRD_TYPE_MAX+1])(double);
- extern nrrd_export void
- (*nrrdMinMaxExactFind[NRRD_TYPE_MAX+1])(void *minP, void *maxP,
- int *hasNonExistP, const Nrrd *nrrd);
- extern nrrd_export int (*nrrdValCompare[NRRD_TYPE_MAX+1])(const void *,
- const void *);
-
/******** getting information to and from files */
/* formatXXX.c */
--- 568,571 ----
***************
*** 664,667 ****
--- 607,679 ----
extern int nrrdWrite(FILE *file, const Nrrd *nrrd, NrrdIoState *io);
+ /******** getting value into and out of an array of general type, and
+ all other simplistic functionality pseudo-parameterized by type */
+ /* accessors.c */
+ extern nrrd_export int (*nrrdILoad[NRRD_TYPE_MAX+1])(const void *v);
+ extern nrrd_export float (*nrrdFLoad[NRRD_TYPE_MAX+1])(const void *v);
+ extern nrrd_export double (*nrrdDLoad[NRRD_TYPE_MAX+1])(const void *v);
+ extern nrrd_export int (*nrrdIStore[NRRD_TYPE_MAX+1])(void *v, int j);
+ extern nrrd_export float (*nrrdFStore[NRRD_TYPE_MAX+1])(void *v, float f);
+ extern nrrd_export double (*nrrdDStore[NRRD_TYPE_MAX+1])(void *v, double d);
+ extern nrrd_export int (*nrrdILookup[NRRD_TYPE_MAX+1])(const void *v,
+ size_t I);
+ extern nrrd_export float (*nrrdFLookup[NRRD_TYPE_MAX+1])(const void *v,
+ size_t I);
+ extern nrrd_export double (*nrrdDLookup[NRRD_TYPE_MAX+1])(const void *v,
+ size_t I);
+ extern nrrd_export int (*nrrdIInsert[NRRD_TYPE_MAX+1])(void *v,
+ size_t I, int j);
+ extern nrrd_export float (*nrrdFInsert[NRRD_TYPE_MAX+1])(void *v,
+ size_t I, float f);
+ extern nrrd_export double (*nrrdDInsert[NRRD_TYPE_MAX+1])(void *v,
+ size_t I, double d);
+ extern nrrd_export int (*nrrdSprint[NRRD_TYPE_MAX+1])(char *, const void *);
+ extern nrrd_export int (*nrrdFprint[NRRD_TYPE_MAX+1])(FILE *, const void *);
+ extern nrrd_export float (*nrrdFClamp[NRRD_TYPE_MAX+1])(float);
+ extern nrrd_export double (*nrrdDClamp[NRRD_TYPE_MAX+1])(double);
+ extern nrrd_export void
+ (*nrrdMinMaxExactFind[NRRD_TYPE_MAX+1])(void *minP, void *maxP,
+ int *hasNonExistP, const Nrrd *nrrd);
+ extern nrrd_export int (*nrrdValCompare[NRRD_TYPE_MAX+1])(const void *,
+ const void *);
+
+ /******** permuting, shuffling, and all flavors of reshaping */
+ /* reorder.c */
+ extern int nrrdAxesInsert(Nrrd *nout, const Nrrd *nin, int ax);
+ /* ---- BEGIN non-NrrdIO */
+ extern int nrrdInvertPerm(int *invp, const int *perm, int n);
+ extern int nrrdAxesPermute(Nrrd *nout, const Nrrd *nin, const int *axes);
+ extern int nrrdAxesSwap(Nrrd *nout, const Nrrd *nin, int ax1, int ax2);
+ extern int nrrdShuffle(Nrrd *nout, const Nrrd *nin, int axis, const int *perm);
+ extern int nrrdFlip(Nrrd *nout, const Nrrd *nin, int axis);
+ extern int nrrdJoin(Nrrd *nout, const Nrrd *const *nin, int numNin,
+ int axis, int incrDim);
+ extern int nrrdReshape(Nrrd *nout, const Nrrd *nin, int dim,
+ ... /* sx, sy, .., axis(dim-1) size */ );
+ extern int nrrdReshape_nva(Nrrd *nout, const Nrrd *nin,
+ int dim, const int *size);
+ extern int nrrdAxesSplit(Nrrd *nout, const Nrrd *nin, int ax,
+ int sizeFast, int sizeSlow);
+ extern int nrrdAxesDelete(Nrrd *nout, const Nrrd *nin, int ax);
+ extern int nrrdAxesMerge(Nrrd *nout, const Nrrd *nin, int ax);
+ extern int nrrdBlock(Nrrd *nout, const Nrrd *nin);
+ extern int nrrdUnblock(Nrrd *nout, const Nrrd *nin, int type);
+
+ /******** things useful with hest */
+ /* hestNrrd.c */
+ extern nrrd_export hestCB *nrrdHestNrrd;
+ extern nrrd_export hestCB *nrrdHestKernelSpec;
+ extern nrrd_export hestCB *nrrdHestIter;
+
+ /******** nrrd value iterator gadget */
+ /* iter.c */
+ extern NrrdIter *nrrdIterNew(void);
+ extern void nrrdIterSetValue(NrrdIter *iter, double val);
+ extern void nrrdIterSetNrrd(NrrdIter *iter, const Nrrd *nrrd);
+ extern void nrrdIterSetOwnNrrd(NrrdIter *iter, Nrrd *nrrd);
+ extern double nrrdIterValue(NrrdIter *iter);
+ extern char *nrrdIterContent(NrrdIter *iter);
+ extern NrrdIter *nrrdIterNix(NrrdIter *iter);
+
/******** expressing the range of values in a nrrd */
/* range.c */
***************
*** 729,753 ****
const Nrrd *nsub, const int *min);
- /******** permuting, shuffling, and all flavors of reshaping */
- /* reorder.c */
- extern int nrrdInvertPerm(int *invp, const int *perm, int n);
- extern int nrrdAxesPermute(Nrrd *nout, const Nrrd *nin, const int *axes);
- extern int nrrdAxesSwap(Nrrd *nout, const Nrrd *nin, int ax1, int ax2);
- extern int nrrdShuffle(Nrrd *nout, const Nrrd *nin, int axis, const int *perm);
- extern int nrrdFlip(Nrrd *nout, const Nrrd *nin, int axis);
- extern int nrrdJoin(Nrrd *nout, const Nrrd *const *nin, int numNin,
- int axis, int incrDim);
- extern int nrrdReshape(Nrrd *nout, const Nrrd *nin, int dim,
- ... /* sx, sy, .., axis(dim-1) size */ );
- extern int nrrdReshape_nva(Nrrd *nout, const Nrrd *nin,
- int dim, const int *size);
- extern int nrrdAxesInsert(Nrrd *nout, const Nrrd *nin, int ax);
- extern int nrrdAxesSplit(Nrrd *nout, const Nrrd *nin, int ax,
- int sizeFast, int sizeSlow);
- extern int nrrdAxesDelete(Nrrd *nout, const Nrrd *nin, int ax);
- extern int nrrdAxesMerge(Nrrd *nout, const Nrrd *nin, int ax);
- extern int nrrdBlock(Nrrd *nout, const Nrrd *nin);
- extern int nrrdUnblock(Nrrd *nout, const Nrrd *nin, int type);
-
/******** measuring and projecting */
/* measure.c */
--- 741,744 ----
***************
*** 874,877 ****
--- 865,870 ----
const char *str);
extern int nrrdKernelSpecParse(NrrdKernelSpec *ksp, const char *str);
+
+ /* ---- END non-NrrdIO */
#ifdef __cplusplus
Index: nrrdEnums.h
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/nrrdEnums.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** nrrdEnums.h 6 Nov 2003 14:44:35 -0000 1.39
--- nrrdEnums.h 1 Dec 2003 09:21:21 -0000 1.40
***************
*** 34,37 ****
--- 34,57 ----
/*
+ ******** nrrdIoState* enum
+ **
+ ** the various things it makes sense to get and set in nrrdIoState struct
+ ** via nrrdIoStateGet and nrrdIoStateSet
+ */
+ enum {
+ nrrdIoStateUnknown,
+ nrrdIoStateDetachedHeader,
+ nrrdIoStateBareText,
+ nrrdIoStateCharsPerLine,
+ nrrdIoStateValsPerLine,
+ nrrdIoStateSkipData,
+ nrrdIoStateKeepNrrdDataFileOpen,
+ nrrdIoStateZlibLevel,
+ nrrdIoStateZlibStrategy,
+ nrrdIoStateBzip2BlockSize,
+ nrrdIoStateLast
+ };
+
+ /*
******** nrrdFormatType enum
**
***************
*** 134,190 ****
/*
- ******** nrrdMeasure enum
- **
- ** ways to "measure" some portion of the array
- ** NEEDS TO BE IN SYNC WITH:
- ** - nrrdMeasure airEnum in enumsNrrd.c
- ** - nrrdMeasureLine function array in measure.c
- */
- enum {
- nrrdMeasureUnknown,
- nrrdMeasureMin, /* 1: smallest value */
- nrrdMeasureMax, /* 2: biggest value */
- nrrdMeasureMean, /* 3: average of values */
- nrrdMeasureMedian, /* 4: value at 50th percentile */
- nrrdMeasureMode, /* 5: most common value */
- nrrdMeasureProduct, /* 6: product of all values */
- nrrdMeasureSum, /* 7: sum of all values */
- nrrdMeasureL1, /* 8 */
- nrrdMeasureL2, /* 9 */
- nrrdMeasureLinf, /* 10 */
- nrrdMeasureVariance, /* 11 */
- nrrdMeasureSD, /* 12: standard deviation */
- /*
- ** the nrrduMeasureHisto... measures interpret the array as a
- ** histogram of some implied value distribution
- */
- nrrdMeasureHistoMin, /* 13 */
- nrrdMeasureHistoMax, /* 14 */
- nrrdMeasureHistoMean, /* 15 */
- nrrdMeasureHistoMedian, /* 16 */
- nrrdMeasureHistoMode, /* 17 */
- nrrdMeasureHistoProduct, /* 18 */
- nrrdMeasureHistoSum, /* 19 */
- nrrdMeasureHistoL2, /* 20 */
- nrrdMeasureHistoVariance, /* 21 */
- nrrdMeasureHistoSD, /* 22 */
- nrrdMeasureLast
- };
- #define NRRD_MEASURE_MAX 22
- #define NRRD_MEASURE_DESC \
- "Possibilities include:\n " \
- "\b\bo \"min\", \"max\", \"mean\", \"median\", \"mode\", \"variance\"\n " \
- "(self-explanatory)\n " \
- "\b\bo \"sd\": standard deviation\n " \
- "\b\bo \"product\", \"sum\": product or sum of all values\n " \
- "\b\bo \"L1\", \"L2\", \"Linf\": different norms\n " \
- "\b\bo \"histo-min\", \"histo-max\", \"histo-mean\", " \
- "\"histo-median\", \"histo-mode\", \"histo-product\", \"histo-l2\", " \
- "\"histo-sum\", \"histo-variance\", \"histo-sd\": same measures, " \
- "but for situations " \
- "where we're given not the original values, but a histogram of them."
-
-
- /*
******** nrrdCenter enum
**
--- 154,157 ----
***************
*** 297,300 ****
--- 264,322 ----
#define NRRD_HAS_NON_EXIST_MAX 3
+ /* ---- BEGIN non-NrrdIO */
+
+ /*
+ ******** nrrdMeasure enum
+ **
+ ** ways to "measure" some portion of the array
+ ** NEEDS TO BE IN SYNC WITH:
+ ** - nrrdMeasure airEnum in enumsNrrd.c
+ ** - nrrdMeasureLine function array in measure.c
+ */
+ enum {
+ nrrdMeasureUnknown,
+ nrrdMeasureMin, /* 1: smallest value */
+ nrrdMeasureMax, /* 2: biggest value */
+ nrrdMeasureMean, /* 3: average of values */
+ nrrdMeasureMedian, /* 4: value at 50th percentile */
+ nrrdMeasureMode, /* 5: most common value */
+ nrrdMeasureProduct, /* 6: product of all values */
+ nrrdMeasureSum, /* 7: sum of all values */
+ nrrdMeasureL1, /* 8 */
+ nrrdMeasureL2, /* 9 */
+ nrrdMeasureLinf, /* 10 */
+ nrrdMeasureVariance, /* 11 */
+ nrrdMeasureSD, /* 12: standard deviation */
+ /*
+ ** the nrrduMeasureHisto... measures interpret the array as a
+ ** histogram of some implied value distribution
+ */
+ nrrdMeasureHistoMin, /* 13 */
+ nrrdMeasureHistoMax, /* 14 */
+ nrrdMeasureHistoMean, /* 15 */
+ nrrdMeasureHistoMedian, /* 16 */
+ nrrdMeasureHistoMode, /* 17 */
+ nrrdMeasureHistoProduct, /* 18 */
+ nrrdMeasureHistoSum, /* 19 */
+ nrrdMeasureHistoL2, /* 20 */
+ nrrdMeasureHistoVariance, /* 21 */
+ nrrdMeasureHistoSD, /* 22 */
+ nrrdMeasureLast
+ };
+ #define NRRD_MEASURE_MAX 22
+ #define NRRD_MEASURE_DESC \
+ "Possibilities include:\n " \
+ "\b\bo \"min\", \"max\", \"mean\", \"median\", \"mode\", \"variance\"\n " \
+ "(self-explanatory)\n " \
+ "\b\bo \"sd\": standard deviation\n " \
+ "\b\bo \"product\", \"sum\": product or sum of all values\n " \
+ "\b\bo \"L1\", \"L2\", \"Linf\": different norms\n " \
+ "\b\bo \"histo-min\", \"histo-max\", \"histo-mean\", " \
+ "\"histo-median\", \"histo-mode\", \"histo-product\", \"histo-l2\", " \
+ "\"histo-sum\", \"histo-variance\", \"histo-sd\": same measures, " \
+ "but for situations " \
+ "where we're given not the original values, but a histogram of them."
+
+
/*
******** nrrdBlind8BitRange
***************
*** 348,352 ****
#define NRRD_UNARY_OP_MAX 23
-
/*
******** nrrdBinaryOp enum
--- 370,373 ----
***************
*** 398,401 ****
--- 419,424 ----
};
#define NRRD_TERNARY_OP_MAX 10
+
+ /* ---- END non-NrrdIO */
#ifdef __cplusplus
Index: nrrdMacros.h
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/nrrdMacros.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** nrrdMacros.h 17 Nov 2003 07:45:31 -0000 1.22
--- nrrdMacros.h 1 Dec 2003 09:21:21 -0000 1.23
***************
*** 78,81 ****
--- 78,83 ----
: ((max) - (min))/((size) - 1)) \
+ /* ---- BEGIN non-NrrdIO */
+
/*
******** NRRD_COORD_UPDATE
***************
*** 154,157 ****
--- 156,161 ----
} \
} while (0)
+
+ /* ---- END non-NrrdIO */
#ifdef __cplusplus
Index: reorder.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/reorder.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** reorder.c 13 Oct 2003 13:17:28 -0000 1.52
--- reorder.c 1 Dec 2003 09:21:21 -0000 1.53
***************
*** 24,27 ****
--- 24,78 ----
/*
+ ******** nrrdAxesInsert
+ **
+ ** like reshape, but preserves axis information on old axes, and
+ ** this is only for adding a "stub" axis with length 1. All other
+ ** axis attributes are initialized as usual.
+ */
+ int
+ nrrdAxesInsert(Nrrd *nout, const Nrrd *nin, int ax) {
+ char me[]="nrrdAxesInsert", func[]="axinsert", err[AIR_STRLEN_MED];
+ int d;
+
+ if (!(nout && nin)) {
+ sprintf(err, "%s: got NULL pointer", me);
+ biffAdd(NRRD, err); return 1;
+ }
+ if (!AIR_IN_CL(0, ax, nin->dim)) {
+ sprintf(err, "%s: given axis (%d) outside valid range [0, %d]",
+ me, ax, nin->dim);
+ biffAdd(NRRD, err); return 1;
+ }
+ if (NRRD_DIM_MAX == nin->dim) {
+ sprintf(err, "%s: given nrrd already at NRRD_DIM_MAX (%d)",
+ me, NRRD_DIM_MAX);
+ biffAdd(NRRD, err); return 1;
+ }
+ if (nout != nin) {
+ if (nrrdCopy(nout, nin)) {
+ sprintf(err, "%s:", me);
+ biffAdd(NRRD, err); return 1;
+ }
+ /* HEY: comments have been copied, perhaps that's not appropriate */
+ }
+ nout->dim = 1 + nin->dim;
+ for (d=nin->dim-1; d>=ax; d--) {
+ _nrrdAxisInfoCopy(&(nout->axis[d+1]), &(nin->axis[d]),
+ NRRD_AXIS_INFO_NONE);
+ }
+ /* the ONLY thing we can say about the new axis is its size */
+ _nrrdAxisInfoInit(&(nout->axis[ax]));
+ nout->axis[ax].size = 1;
+ if (nrrdContentSet(nout, func, nin, "%d", ax)) {
+ sprintf(err, "%s:", me);
+ biffAdd(NRRD, err); return 1;
+ }
+ nrrdPeripheralCopy(nout, nin);
+ return 0;
+ }
+
+ /* ---- BEGIN non-NrrdIO */
+
+ /*
******** nrrdInvertPerm()
**
***************
*** 612,664 ****
/*
- ******** nrrdAxesInsert
- **
- ** like reshape, but preserves axis information on old axes, and
- ** this is only for adding a "stub" axis with length 1. All other
- ** axis attributes are initialized as usual.
- */
- int
- nrrdAxesInsert(Nrrd *nout, const Nrrd *nin, int ax) {
- char me[]="nrrdAxesInsert", func[]="axinsert", err[AIR_STRLEN_MED];
- int d;
-
- if (!(nout && nin)) {
- sprintf(err, "%s: got NULL pointer", me);
- biffAdd(NRRD, err); return 1;
- }
- if (!AIR_IN_CL(0, ax, nin->dim)) {
- sprintf(err, "%s: given axis (%d) outside valid range [0, %d]",
- me, ax, nin->dim);
- biffAdd(NRRD, err); return 1;
- }
- if (NRRD_DIM_MAX == nin->dim) {
- sprintf(err, "%s: given nrrd already at NRRD_DIM_MAX (%d)",
- me, NRRD_DIM_MAX);
- biffAdd(NRRD, err); return 1;
- }
- if (nout != nin) {
- if (nrrdCopy(nout, nin)) {
- sprintf(err, "%s:", me);
- biffAdd(NRRD, err); return 1;
- }
- /* HEY: comments have been copied, perhaps that's not appropriate */
- }
- nout->dim = 1 + nin->dim;
- for (d=nin->dim-1; d>=ax; d--) {
- _nrrdAxisInfoCopy(&(nout->axis[d+1]), &(nin->axis[d]),
- NRRD_AXIS_INFO_NONE);
- }
- /* the ONLY thing we can say about the new axis is its size */
- _nrrdAxisInfoInit(&(nout->axis[ax]));
- nout->axis[ax].size = 1;
- if (nrrdContentSet(nout, func, nin, "%d", ax)) {
- sprintf(err, "%s:", me);
- biffAdd(NRRD, err); return 1;
- }
- nrrdPeripheralCopy(nout, nin);
- return 0;
- }
-
- /*
******** nrrdAxesSplit
**
--- 663,666 ----
***************
*** 1043,1044 ****
--- 1045,1047 ----
}
+ /* ---- END non-NrrdIO */
Index: simple.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/simple.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** simple.c 3 Oct 2003 19:20:33 -0000 1.56
--- simple.c 1 Dec 2003 09:21:21 -0000 1.57
***************
*** 496,502 ****
strcpy(which, "nrrdFormat"); goto err;
}
- if (nrrdBoundaryLast-1 != NRRD_BOUNDARY_MAX) {
- strcpy(which, "nrrdBoundary"); goto err;
- }
if (nrrdTypeLast-1 != NRRD_TYPE_MAX) {
strcpy(which, "nrrdType"); goto err;
--- 496,499 ----
***************
*** 505,511 ****
strcpy(which, "nrrdEncodingType"); goto err;
}
- if (nrrdMeasureLast-1 != NRRD_MEASURE_MAX) {
- strcpy(which, "nrrdMeasure"); goto err;
- }
if (nrrdCenterLast-1 != NRRD_CENTER_MAX) {
strcpy(which, "nrrdCenter"); goto err;
--- 502,505 ----
***************
*** 521,524 ****
--- 515,525 ----
strcpy(which, "nrrdHasNonExist"); goto err;
}
+ /* ---- BEGIN non-NrrdIO */
+ if (nrrdBoundaryLast-1 != NRRD_BOUNDARY_MAX) {
+ strcpy(which, "nrrdBoundary"); goto err;
+ }
+ if (nrrdMeasureLast-1 != NRRD_MEASURE_MAX) {
+ strcpy(which, "nrrdMeasure"); goto err;
+ }
if (nrrdUnaryOpLast-1 != NRRD_UNARY_OP_MAX) {
strcpy(which, "nrrdUnaryOp"); goto err;
***************
*** 530,533 ****
--- 531,535 ----
strcpy(which, "nrrdTernaryOp"); goto err;
}
+ /* ---- END non-NrrdIO */
/* no errors so far */
***************
*** 574,583 ****
biffAdd(NRRD, err); return 0;
}
- if (airEnumValCheck(nrrdBoundary, nrrdDefRsmpBoundary)) {
- sprintf(err, "%s: nrrdDefRsmpBoundary (%d) not in valid range [%d,%d]",
- me, nrrdDefRsmpBoundary,
- nrrdBoundaryUnknown+1, nrrdBoundaryLast-1);
- biffAdd(NRRD, err); return 0;
- }
if (airEnumValCheck(nrrdCenter, nrrdDefCenter)) {
sprintf(err, "%s: nrrdDefCenter (%d) not in valid range [%d,%d]",
--- 576,579 ----
***************
*** 593,596 ****
--- 589,599 ----
biffAdd(NRRD, err); return 0;
}
+ /* ---- BEGIN non-NrrdIO */
+ if (airEnumValCheck(nrrdBoundary, nrrdDefRsmpBoundary)) {
+ sprintf(err, "%s: nrrdDefRsmpBoundary (%d) not in valid range [%d,%d]",
+ me, nrrdDefRsmpBoundary,
+ nrrdBoundaryUnknown+1, nrrdBoundaryLast-1);
+ biffAdd(NRRD, err); return 0;
+ }
if (airEnumValCheck(nrrdType, nrrdStateMeasureType)) {
sprintf(err, "%s: nrrdStateMeasureType (%d) not in valid range [%d,%d]",
***************
*** 606,609 ****
--- 609,613 ----
biffAdd(NRRD, err); return 0;
}
+ /* ---- END non-NrrdIO */
if (!( nrrdTypeSize[nrrdTypeChar] == sizeof(char)
***************
*** 665,669 ****
tmpLLI = NRRD_LLONG_MAX;
if (tmpLLI != NRRD_LLONG_MAX) {
! sprintf(err, "%s: long long int can't hold NRRD_LLONG_MAX (" AIR_ULLONG_FMT ")", me,
NRRD_LLONG_MAX);
biffAdd(NRRD, err); return 0;
--- 669,674 ----
tmpLLI = NRRD_LLONG_MAX;
if (tmpLLI != NRRD_LLONG_MAX) {
! sprintf(err, "%s: long long int can't hold NRRD_LLONG_MAX ("
! AIR_ULLONG_FMT ")", me,
NRRD_LLONG_MAX);
biffAdd(NRRD, err); return 0;
***************
*** 671,675 ****
tmpLLI += 1;
if (NRRD_LLONG_MIN != tmpLLI) {
! sprintf(err, "%s: long long int min (" AIR_LLONG_FMT ") or max (" AIR_LLONG_FMT ") incorrect", me,
NRRD_LLONG_MIN, NRRD_LLONG_MAX);
biffAdd(NRRD, err); return 0;
--- 676,681 ----
tmpLLI += 1;
if (NRRD_LLONG_MIN != tmpLLI) {
! sprintf(err, "%s: long long int min (" AIR_LLONG_FMT ") or max ("
! AIR_LLONG_FMT ") incorrect", me,
NRRD_LLONG_MIN, NRRD_LLONG_MAX);
biffAdd(NRRD, err); return 0;
***************
*** 678,682 ****
if (tmpULLI != NRRD_ULLONG_MAX) {
sprintf(err,
! "%s: unsigned long long int can't hold NRRD_ULLONG_MAX (" AIR_ULLONG_FMT ")",
me, NRRD_ULLONG_MAX);
biffAdd(NRRD, err); return 0;
--- 684,689 ----
if (tmpULLI != NRRD_ULLONG_MAX) {
sprintf(err,
! "%s: unsigned long long int can't hold NRRD_ULLONG_MAX ("
! AIR_ULLONG_FMT ")",
me, NRRD_ULLONG_MAX);
biffAdd(NRRD, err); return 0;
***************
*** 684,688 ****
tmpULLI += 1;
if (tmpULLI != 0) {
! sprintf(err, "%s: unsigned long long int max (" AIR_ULLONG_FMT ") incorrect", me,
NRRD_ULLONG_MAX);
biffAdd(NRRD, err); return 0;
--- 691,696 ----
tmpULLI += 1;
if (tmpULLI != 0) {
! sprintf(err, "%s: unsigned long long int max (" AIR_ULLONG_FMT
! ") incorrect", me,
NRRD_ULLONG_MAX);
biffAdd(NRRD, err); return 0;
|
|
From: <kin...@us...> - 2003-11-30 22:48:32
|
Update of /cvsroot/teem/teem/src/nrrd
In directory sc8-pr-cvs1:/tmp/cvs-serv22953/nrrd
Modified Files:
read.c
Log Message:
added nrrdSanity call to nrrdRead
Index: read.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/read.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -C2 -d -r1.83 -r1.84
*** read.c 29 Nov 2003 08:16:07 -0000 1.83
--- read.c 30 Nov 2003 22:48:29 -0000 1.84
***************
*** 224,230 ****
int
nrrdRead (Nrrd *nrrd, FILE *file, NrrdIoState *nio) {
! char err[AIR_STRLEN_MED], me[] = "nrrdRead";
int len, fi;
airArray *mop;
if (!(file && nrrd)) {
--- 224,236 ----
int
nrrdRead (Nrrd *nrrd, FILE *file, NrrdIoState *nio) {
! char me[]="nrrdRead", err[AIR_STRLEN_MED];
int len, fi;
airArray *mop;
+
+ /* sanity check, for good measure */
+ if (!nrrdSanity()) {
+ sprintf(err, "%s: sanity check FAILED: have to fix and re-compile", me);
+ biffAdd(NRRD, err); return 1;
+ }
if (!(file && nrrd)) {
|
|
From: <kin...@us...> - 2003-11-30 00:27:10
|
Update of /cvsroot/teem/teem/src/nrrd
In directory sc8-pr-cvs1:/tmp/cvs-serv1322/nrrd
Modified Files:
methodsNrrd.c nrrd.h write.c
Log Message:
added accessor methods for nrrdIoState: nrrdIoState{Set,Get}, nrrdIoStateEncoding{Set,Get}, nrrdIoStateFormat{Set,Get}
Index: methodsNrrd.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/methodsNrrd.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** methodsNrrd.c 29 Nov 2003 08:16:07 -0000 1.34
--- methodsNrrd.c 30 Nov 2003 00:27:06 -0000 1.35
***************
*** 66,71 ****
nio->line = NULL;
nio->dataFile = NULL;
! nio->format = NULL;
! nio->encoding = NULL;
nrrdIoStateInit(nio);
}
--- 66,71 ----
nio->line = NULL;
nio->dataFile = NULL;
! nio->format = nrrdFormatUnknown;
! nio->encoding = nrrdEncodingUnknown;
nrrdIoStateInit(nio);
}
Index: nrrd.h
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/nrrd.h,v
retrieving revision 1.124
retrieving revision 1.125
diff -C2 -d -r1.124 -r1.125
*** nrrd.h 29 Nov 2003 08:16:07 -0000 1.124
--- nrrd.h 30 Nov 2003 00:27:06 -0000 1.125
***************
*** 363,366 ****
--- 363,367 ----
instead of lines. First the lines are
skipped, then the bytes */
+ seen[NRRD_FIELD_MAX+1], /* for error checking in header parsing */
detachedHeader, /* ON READ+WRITE: nrrd is split into distinct
header and data (for nrrd format only) */
***************
*** 401,408 ****
of the nrrdZlibStrategy enums, default is
nrrdZlibStrategyDefault. */
! bzip2BlockSize, /* block size used for compression,
roughly equivalent to better but slower
(1-9, -1 for default[9]). */
- seen[NRRD_FIELD_MAX+1]; /* for error checking in header parsing */
/* format and encoding. These are initialized to nrrdFormatUnknown
and nrrdEncodingUnknown, respectively. USE THESE VALUES for
--- 402,408 ----
of the nrrdZlibStrategy enums, default is
nrrdZlibStrategyDefault. */
! bzip2BlockSize; /* block size used for compression,
roughly equivalent to better but slower
(1-9, -1 for default[9]). */
/* format and encoding. These are initialized to nrrdFormatUnknown
and nrrdEncodingUnknown, respectively. USE THESE VALUES for
***************
*** 412,415 ****
--- 412,435 ----
} NrrdIoState;
+ /*
+ ******** nrrdIoState* enum
+ **
+ ** the various things it makes sense to get and set in nrrdIoState struct
+ ** via nrrdIoStateGet and nrrdIoStateSet
+ */
+ enum {
+ nrrdIoStateUnknown,
+ nrrdIoStateDetachedHeader,
+ nrrdIoStateBareText,
+ nrrdIoStateCharsPerLine,
+ nrrdIoStateValsPerLine,
+ nrrdIoStateSkipData,
+ nrrdIoStateKeepNrrdDataFileOpen,
+ nrrdIoStateZlibLevel,
+ nrrdIoStateZlibStrategy,
+ nrrdIoStateBzip2BlockSize,
+ nrrdIoStateLast
+ };
+
/******** defaults (nrrdDef..) and state (nrrdState..) */
/* defaultsNrrd.c */
***************
*** 633,636 ****
--- 653,664 ----
extern int nrrdRead(Nrrd *nrrd, FILE *file, NrrdIoState *io);
/* write.c */
+ extern int nrrdIoStateSet(NrrdIoState *io, int parm, int value);
+ extern int nrrdIoStateSetEncoding(NrrdIoState *io,
+ const NrrdEncoding *encoding);
+ extern int nrrdIoStateSetFormat(NrrdIoState *io,
+ const NrrdFormat *format);
+ extern int nrrdIoStateGet(NrrdIoState *io, int parm);
+ extern const NrrdEncoding *nrrdIoStateGetEncoding(NrrdIoState *io);
+ extern const NrrdFormat *nrrdIoStateBetFormat(NrrdIoState *io);
extern int nrrdSave(const char *filename, const Nrrd *nrrd, NrrdIoState *io);
extern int nrrdWrite(FILE *file, const Nrrd *nrrd, NrrdIoState *io);
Index: write.c
===================================================================
RCS file: /cvsroot/teem/teem/src/nrrd/write.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -C2 -d -r1.86 -r1.87
*** write.c 29 Nov 2003 08:16:07 -0000 1.86
--- write.c 30 Nov 2003 00:27:06 -0000 1.87
***************
*** 28,31 ****
--- 28,209 ----
int
+ nrrdIoStateSet (NrrdIoState *nio, int parm, int value) {
+ char me[]="nrrdIoStateSet", err[AIR_STRLEN_MED];
+
+ if (!nio) {
+ sprintf(err, "%s: got NULL pointer", me);
+ biffAdd(NRRD, err); return 1;
+ }
+ if (!( AIR_IN_OP(nrrdIoStateUnknown, parm, nrrdIoStateLast) )) {
+ sprintf(err, "%s: identifier %d not in valid range [%d,%d]", me,
+ parm, nrrdIoStateUnknown+1, nrrdIoStateLast-1);
+ biffAdd(NRRD, err); return 1;
+ }
+ switch (parm) {
+ case nrrdIoStateDetachedHeader:
+ nio->detachedHeader = !!value;
+ break;
+ case nrrdIoStateBareText:
+ nio->bareText = !!value;
+ break;
+ case nrrdIoStateCharsPerLine:
+ if (value < 40) {
+ sprintf(err, "%s: %d charsPerLine is awfully small", me, value);
+ biffAdd(NRRD, err); return 1;
+ }
+ nio->charsPerLine = value;
+ break;
+ case nrrdIoStateValsPerLine:
+ if (value < 4) {
+ sprintf(err, "%s: %d valsPerLine is awfully small", me, value);
+ biffAdd(NRRD, err); return 1;
+ }
+ nio->valsPerLine = value;
+ break;
+ case nrrdIoStateSkipData:
+ nio->skipData = !!value;
+ break;
+ case nrrdIoStateKeepNrrdDataFileOpen:
+ nio->keepNrrdDataFileOpen = !!value;
+ break;
+ case nrrdIoStateZlibLevel:
+ if (!( AIR_IN_CL(-1, value, 9) )) {
+ sprintf(err, "%s: zlibLevel %d invalid", me, value);
+ biffAdd(NRRD, err); return 1;
+ }
+ nio->zlibLevel = value;
+ break;
+ case nrrdIoStateZlibStrategy:
+ if (!( AIR_IN_OP(nrrdZlibStrategyUnknown, value, nrrdZlibStrategyLast) )) {
+ sprintf(err, "%s: zlibStrategy %d invalid", me, value);
+ biffAdd(NRRD, err); return 1;
+ }
+ nio->zlibStrategy = value;
+ break;
+ case nrrdIoStateBzip2BlockSize:
+ if (!( AIR_IN_CL(-1, value, 9) )) {
+ sprintf(err, "%s: bzip2BlockSize %d invalid", me, value);
+ biffAdd(NRRD, err); return 1;
+ }
+ nio->bzip2BlockSize = value;
+ break;
+ default:
+ fprintf(stderr, "!%s: PANIC: didn't recognize parm %d\n", me, parm);
+ exit(1);
+ }
+ return 0;
+ }
+
+ int
+ nrrdIoStateSetEncoding (NrrdIoState *nio, const NrrdEncoding *encoding) {
+ char me[]="nrrdIoStateSetEncoding", err[AIR_STRLEN_MED];
+
+ if (!( nio && encoding )) {
+ sprintf(err, "%s: got NULL pointer", me);
+ if (nio) {
+ nio->encoding = nrrdEncodingUnknown;
+ }
+ biffAdd(NRRD, err); return 1;
+ }
+ if (!encoding->available()) {
+ sprintf(err, "%s: %s encoding isn't actually available", me,
+ encoding->name);
+ nio->encoding = nrrdEncodingUnknown;
+ biffAdd(NRRD, err); return 1;
+ }
+ nio->encoding = encoding;
+ return 0;
+ }
+
+ int
+ nrrdIoStateSetFormat (NrrdIoState *nio, const NrrdFormat *format) {
+ char me[]="nrrdIoStateSetFormat", err[AIR_STRLEN_MED];
+
+ if (!( nio && format )) {
+ sprintf(err, "%s: got NULL pointer", me);
+ if (nio) {
+ nio->format = nrrdFormatUnknown;
+ }
+ biffAdd(NRRD, err); return 1;
+ }
+ if (!format->available()) {
+ sprintf(err, "%s: %s format isn't actually available", me, format->name);
+ nio->format = nrrdFormatUnknown;
+ biffAdd(NRRD, err); return 1;
+ }
+ nio->format = format;
+ return 0;
+ }
+
+ /*
+ ** no biff
+ */
+ int
+ nrrdIoStateGet (NrrdIoState *nio, int parm) {
+ char me[]="nrrdIoStateGet";
+ int value;
+
+ if (!nio) {
+ /* got NULL pointer */
+ return -1;
+ }
+ if (!( AIR_IN_OP(nrrdIoStateUnknown, parm, nrrdIoStateLast) )) {
+ /* got bogus parameter identifier */
+ return -1;
+ }
+ switch (parm) {
+ case nrrdIoStateDetachedHeader:
+ value = !!nio->detachedHeader;
+ break;
+ case nrrdIoStateBareText:
+ value = !!nio->bareText;
+ break;
+ case nrrdIoStateCharsPerLine:
+ value = nio->charsPerLine;
+ break;
+ case nrrdIoStateValsPerLine:
+ value = nio->valsPerLine;
+ break;
+ case nrrdIoStateSkipData:
+ value = !!nio->skipData;
+ break;
+ case nrrdIoStateKeepNrrdDataFileOpen:
+ value = !!nio->keepNrrdDataFileOpen;
+ break;
+ case nrrdIoStateZlibLevel:
+ value = nio->zlibLevel;
+ break;
+ case nrrdIoStateZlibStrategy:
+ value = nio->zlibStrategy;
+ break;
+ case nrrdIoStateBzip2BlockSize:
+ value = nio->bzip2BlockSize;
+ break;
+ default:
+ fprintf(stderr, "!%s: PANIC: didn't recognize parm %d\n", me, parm);
+ exit(1);
+ }
+ return value;
+ }
+
+ /*
+ ** no biff
+ */
+ const NrrdEncoding *
+ nrrdIoStateGetEncoding (NrrdIoState *nio) {
+
+ return nio ? nio->encoding : nrrdEncodingUnknown;
+ }
+
+ /*
+ ** no biff
+ */
+ const NrrdFormat *
+ nrrdIoStateGetFormat (NrrdIoState *nio) {
+
+ return nio ? nio->format : nrrdFormatUnknown;
+ }
+
+ int
_nrrdFieldInteresting (const Nrrd *nrrd, NrrdIoState *nio, int field) {
int d, ret;
***************
*** 366,370 ****
*/
int
! _nrrdFormatMaybeGuess (const Nrrd *nrrd, NrrdIoState *nio, const char *filename) {
char me[]="_nrrdFormatMaybeGuess", err[AIR_STRLEN_MED], mesg[AIR_STRLEN_MED];
int fi, guessed, available, fits;
--- 544,549 ----
*/
int
! _nrrdFormatMaybeGuess (const Nrrd *nrrd, NrrdIoState *nio,
! const char *filename) {
char me[]="_nrrdFormatMaybeGuess", err[AIR_STRLEN_MED], mesg[AIR_STRLEN_MED];
int fi, guessed, available, fits;
|
|
From: <kin...@us...> - 2003-11-29 08:17:45
|
Update of /cvsroot/teem/teem/src/ten/test In directory sc8-pr-cvs1:/tmp/cvs-serv5937/ten/test Modified Files: didthis2.txt Log Message: changes needed for VisSym04 submission Index: didthis2.txt =================================================================== RCS file: /cvsroot/teem/teem/src/ten/test/didthis2.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** didthis2.txt 30 Oct 2003 21:30:55 -0000 1.7 --- didthis2.txt 29 Nov 2003 08:17:42 -0000 1.8 *************** *** 20,25 **** | unu quantize -b 8 -min 0 -max 1 -o tri-cyl.png & test/tt -n 7 -p -0.45 0.2 -0.35 \ ! | DOIT -g q -gsc 0.27 \ | unu crop -min 0 0 0 -max 2 M M \ ! | unu quantize -b 8 -min 0 -max 1 -o tri-sqd.png & --- 20,47 ---- | unu quantize -b 8 -min 0 -max 1 -o tri-cyl.png & test/tt -n 7 -p -0.45 0.2 -0.35 \ ! | DOIT -g q -gsc 0.27 -ns 1 \ | unu crop -min 0 0 0 -max 2 M M \ ! | unu quantize -b 8 -min 0 -max 1 -o tri-sqd.png ! ! ! ! echo "1 1 1 1 0 0 -4" \ ! | emap -i - $CAM -amb 0 0 0 -o tmp0.nrrd ! unu 2op ^ tmp0.nrrd 2 | unu 2op - 1 - | unu 2op x - 3.14159 | unu 1op cos \ ! | unu 2op + - 1 | unu 2op / - 2 -o tmp1.nrrd ! unu 3op lerp 1.0 tmp0.nrrd tmp1.nrrd -o emap.nrrd ! rm -f tmp0.nrrd tmp1.nrrd ! ! ! alias DOIT tend glyph -rt -emap emap.nrrd -bg 1 1 1 -sat 0 $CAM \ ! -ur -1.2 1.2 -vr -0.9 0.9 -is 720 540 -or -atr 0 -ns 16 ! ! test/tt -n 7 -p -0.45 0.2 -0.35 -ca 0.6 \ ! | DOIT -g q -sh 4 -gsc 0.27 \ ! | unu crop -min 0 0 0 -max 2 M M \ ! | unu quantize -b 8 -min 0 -max 1 -o tri-sqd2.png ! ! unu pad -i tri-sqd2.png -min 0 0 -90 -max M M m+719 \ ! | unu gamma -g 1.4 -max 240 \ ! | unu quantize -b 8 -min 0 -max 240 -o tri-sqd2-pad.png |
|
From: <kin...@us...> - 2003-11-29 08:17:17
|
Update of /cvsroot/teem/teem/src/ten/test
In directory sc8-pr-cvs1:/tmp/cvs-serv5856/ten/test
Modified Files:
tt.c
Log Message:
changes needed for VisSym04 submission
Index: tt.c
===================================================================
RCS file: /cvsroot/teem/teem/src/ten/test/tt.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** tt.c 7 Oct 2003 14:04:32 -0000 1.9
--- tt.c 29 Nov 2003 08:17:11 -0000 1.10
***************
*** 24,32 ****
void
! _cap2xyz(double xyz[3], double ca, double cp) {
double cl, cs;
cs = 1 - ca;
cl = 1 - cs - cp;
xyz[0] = cs*0.333 + cl*1.0 + cp*0.5;
xyz[1] = cs*0.333 + cl*0.0 + cp*0.5;
--- 24,33 ----
void
! _cap2xyz(double xyz[3], double ca, double cp, int version) {
double cl, cs;
cs = 1 - ca;
cl = 1 - cs - cp;
+ /*
xyz[0] = cs*0.333 + cl*1.0 + cp*0.5;
xyz[1] = cs*0.333 + cl*0.0 + cp*0.5;
***************
*** 35,38 ****
--- 36,49 ----
xyz[1] = AIR_AFFINE(0, ca, 1, 1.1*xyz[1], 0.86*xyz[1]);
xyz[2] = AIR_AFFINE(0, ca, 1, 1.1*xyz[2], 0.86*xyz[2]);
+ */
+ if (1 == version) {
+ xyz[0] = (3 + 3*cl - cs)/6;
+ xyz[1] = (2 - 2*cl + cp)/6;
+ xyz[2] = 2*cs/6;
+ } else {
+ xyz[0] = 1;
+ xyz[1] = 1 - cl;
+ xyz[2] = cs;
+ }
}
***************
*** 70,77 ****
airArray *mop;
! int xi, yi, samp;
float *tdata;
double p[3], xyz[3], q[4], len, hackcp, maxca;
! double ca, cp, mD[9], mRF[9], mRI[9], mT[9];
Nrrd *nten;
mop = airMopNew();
--- 81,88 ----
airArray *mop;
! int xi, yi, samp, version;
float *tdata;
double p[3], xyz[3], q[4], len, hackcp, maxca;
! double ca, cp, mD[9], mRF[9], mRI[9], mT[9], hack;
Nrrd *nten;
mop = airMopNew();
***************
*** 84,87 ****
--- 95,103 ----
hestOptAdd(&hopt, "ca", "max ca", airTypeDouble, 1, 1, &maxca, "0.8",
"maximum ca to use at bottom edge of triangle");
+ hestOptAdd(&hopt, "hack", "hack", airTypeDouble, 1, 1, &hack, "0.04",
+ "this is a hack");
+ hestOptAdd(&hopt, "v", "version", airTypeInt, 1, 1, &version, "1",
+ "which version of the Westin metrics to use to parameterize "
+ "triangle; \"1\" for ISMRM 97, \"2\" for MICCAI 99");
hestOptAdd(&hopt, "o", "nout", airTypeString, 1, 1, &outS, "-",
"output file to save tensors into");
***************
*** 94,97 ****
--- 110,118 ----
airMopAdd(mop, nten, (airMopper)nrrdNuke, airMopAlways);
+ if (!( 1 == version || 2 == version )) {
+ fprintf(stderr, "%s: version must be 1 or 2 (not %d)\n", me, version);
+ airMopError(mop);
+ return 1;
+ }
if (nrrdMaybeAlloc(nten, nrrdTypeFloat, 4,
7, 2*samp-1, samp, 3)) {
***************
*** 110,118 ****
ELL_3M_TRAN(mRI, mRF);
for (yi=0; yi<samp; yi++) {
! ca = AIR_AFFINE(0, yi, samp-1, 0.04, maxca);
! hackcp = AIR_AFFINE(0, yi, samp-1, 0.04, 0);
for (xi=0; xi<=yi; xi++) {
! cp = AIR_AFFINE(0, xi, samp-1, hackcp, maxca-0.02);
! _cap2xyz(xyz, ca, cp);
/*
fprintf(stderr, "%s: (%d,%d) -> (%g,%g) -> %g %g %g\n", me,
--- 131,139 ----
ELL_3M_TRAN(mRI, mRF);
for (yi=0; yi<samp; yi++) {
! ca = AIR_AFFINE(0, yi, samp-1, hack, maxca);
! hackcp = AIR_AFFINE(0, yi, samp-1, hack, 0);
for (xi=0; xi<=yi; xi++) {
! cp = AIR_AFFINE(0, xi, samp-1, hackcp, maxca-hack/2.0);
! _cap2xyz(xyz, ca, cp, version);
/*
fprintf(stderr, "%s: (%d,%d) -> (%g,%g) -> %g %g %g\n", me,
|
|
From: <kin...@us...> - 2003-11-29 08:17:17
|
Update of /cvsroot/teem/teem/src/limn/test
In directory sc8-pr-cvs1:/tmp/cvs-serv5856/limn/test
Modified Files:
soid.c
Log Message:
changes needed for VisSym04 submission
Index: soid.c
===================================================================
RCS file: /cvsroot/teem/teem/src/limn/test/soid.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** soid.c 6 Oct 2003 10:45:59 -0000 1.3
--- soid.c 29 Nov 2003 08:17:11 -0000 1.4
***************
*** 23,31 ****
char *info = ("Render a single ellipsoid in postscript.");
int
main(int argc, char *argv[]) {
char *me, *err, *outS;
limnCamera *cam;
! float matA[16], matB[16], sc[3], rad, edgeWidth[5];
hestOpt *hopt=NULL;
airArray *mop;
--- 23,59 ----
char *info = ("Render a single ellipsoid in postscript.");
+ void
+ washQtoM3(float m[9], float q[4]) {
+ float p[4], w, x, y, z, len;
+
+ ELL_4V_COPY(p, q);
+ len = ELL_4V_LEN(p);
+ ELL_4V_SCALE(p, 1.0/len, p);
+ w = p[0];
+ x = p[1];
+ y = p[2];
+ z = p[3];
+ /* mathematica work implies that we should be
+ setting ROW vectors here */
+ ELL_3V_SET(m+0,
+ 1 - 2*(y*y + z*z),
+ 2*(x*y - w*z),
+ 2*(x*z + w*y));
+ ELL_3V_SET(m+3,
+ 2*(x*y + w*z),
+ 1 - 2*(x*x + z*z),
+ 2*(y*z - w*x));
+ ELL_3V_SET(m+6,
+ 2*(x*z - w*y),
+ 2*(y*z + w*x),
+ 1 - 2*(x*x + y*y));
+ }
+
int
main(int argc, char *argv[]) {
char *me, *err, *outS;
limnCamera *cam;
! float p[3], q[4], mR[9], eval[3], len, sh, cl, cp, qA, qB;
! float matA[16], matB[16], os, sc[3], rad, edgeWidth[5];
hestOpt *hopt=NULL;
airArray *mop;
***************
*** 34,38 ****
limnPart *r;
limnWin *win;
! int ri, si, res;
Nrrd *nmap;
--- 62,66 ----
limnPart *r;
limnWin *win;
! int ri, si, res, axis, sphere;
Nrrd *nmap;
***************
*** 63,70 ****
hestOptAdd(&hopt, "sc", "scalings", airTypeFloat, 3, 3, sc, "1 1 1",
"axis-aligned scaling to do on ellipsoid");
hestOptAdd(&hopt, "r", "radius", airTypeFloat, 1, 1, &rad, "0.015",
! "black axis cylinder radius");
hestOptAdd(&hopt, "res", "resolution", airTypeInt, 1, 1, &res, "25",
! "black axis cylinder radius");
hestOptAdd(&hopt, "wd", "3 widths", airTypeFloat, 3, 3, edgeWidth + 2,
"1.5 0.7 0.0",
--- 91,107 ----
hestOptAdd(&hopt, "sc", "scalings", airTypeFloat, 3, 3, sc, "1 1 1",
"axis-aligned scaling to do on ellipsoid");
+ hestOptAdd(&hopt, "os", "over-all scaling", airTypeFloat, 1, 1, &os, "1",
+ "over-all scaling (multiplied by scalings)");
+ hestOptAdd(&hopt, "sh", "superquad sharpness", airTypeFloat, 1, 1, &sh, "0",
+ "how much to sharpen edges as a "
+ "function of differences between eigenvalues");
+ hestOptAdd(&hopt, "sphere", NULL, airTypeInt, 0, 0, &sphere, NULL,
+ "none of this superquadric crap: use a sphere, dammit");
+ hestOptAdd(&hopt, "p", "x y z", airTypeFloat, 3, 3, p, "0 0 0",
+ "location in quaternion quotient space");
hestOptAdd(&hopt, "r", "radius", airTypeFloat, 1, 1, &rad, "0.015",
! "black axis cylinder radius (or 0.0 to not drawn these)");
hestOptAdd(&hopt, "res", "resolution", airTypeInt, 1, 1, &res, "25",
! "tesselation resolution for both glyph and axis cylinders");
hestOptAdd(&hopt, "wd", "3 widths", airTypeFloat, 3, 3, edgeWidth + 2,
"1.5 0.7 0.0",
***************
*** 102,167 ****
sp->spec = 0;
! ri = limnObjPolarSphereAdd(obj, 0, 0, 2*res, res);
! r = obj->r + ri; ELL_4V_SET(r->rgba, 1, 1, 1, 1);
! ELL_4M_IDENTITY_SET(matA);
! ELL_4M_SCALE_SET(matB, sc[0], sc[1], sc[2]); ell_4m_post_mul_f(matA, matB);
! limnObjPartTransform(obj, ri, matA);
!
! ri = limnObjCylinderAdd(obj, 1, 0, res);
! r = obj->r + ri; ELL_4V_SET(r->rgba, 0, 0, 0, 1);
! ELL_4M_IDENTITY_SET(matA);
! ELL_4M_SCALE_SET(matB, (1-sc[0])/2, rad, rad);
! ell_4m_post_mul_f(matA, matB);
! ELL_4M_TRANSLATE_SET(matB, (1+sc[0])/2, 0.0, 0.0);
! ell_4m_post_mul_f(matA, matB);
! limnObjPartTransform(obj, ri, matA);
!
! ri = limnObjCylinderAdd(obj, 1, 0, res);
! r = obj->r + ri; ELL_4V_SET(r->rgba, 0, 0, 0, 1);
! ELL_4M_IDENTITY_SET(matA);
! ELL_4M_SCALE_SET(matB, (1-sc[0])/2, rad, rad);
! ell_4m_post_mul_f(matA, matB);
! ELL_4M_TRANSLATE_SET(matB, -(1+sc[0])/2, 0.0, 0.0);
! ell_4m_post_mul_f(matA, matB);
! limnObjPartTransform(obj, ri, matA);
!
!
! ri = limnObjCylinderAdd(obj, 1, 1, res);
! r = obj->r + ri; ELL_4V_SET(r->rgba, 0, 0, 0, 1);
! ELL_4M_IDENTITY_SET(matA);
! ELL_4M_SCALE_SET(matB, rad, (1-sc[1])/2, rad);
! ell_4m_post_mul_f(matA, matB);
! ELL_4M_TRANSLATE_SET(matB, 0.0, (1+sc[1])/2, 0.0);
! ell_4m_post_mul_f(matA, matB);
! limnObjPartTransform(obj, ri, matA);
!
! ri = limnObjCylinderAdd(obj, 1, 1, res);
! r = obj->r + ri; ELL_4V_SET(r->rgba, 0, 0, 0, 1);
! ELL_4M_IDENTITY_SET(matA);
! ELL_4M_SCALE_SET(matB, rad, (1-sc[1])/2, rad);
! ell_4m_post_mul_f(matA, matB);
! ELL_4M_TRANSLATE_SET(matB, 0.0, -(1+sc[1])/2, 0.0);
! ell_4m_post_mul_f(matA, matB);
! limnObjPartTransform(obj, ri, matA);
!
! ri = limnObjCylinderAdd(obj, 1, 2, res);
! r = obj->r + ri; ELL_4V_SET(r->rgba, 0, 0, 0, 1);
! ELL_4M_IDENTITY_SET(matA);
! ELL_4M_SCALE_SET(matB, rad, rad, (1-sc[2])/2);
! ell_4m_post_mul_f(matA, matB);
! ELL_4M_TRANSLATE_SET(matB, 0.0, 0.0, (1+sc[2])/2);
! ell_4m_post_mul_f(matA, matB);
! limnObjPartTransform(obj, ri, matA);
! ri = limnObjCylinderAdd(obj, 1, 2, res);
! r = obj->r + ri; ELL_4V_SET(r->rgba, 0, 0, 0, 1);
ELL_4M_IDENTITY_SET(matA);
! ELL_4M_SCALE_SET(matB, rad, rad, (1-sc[2])/2);
ell_4m_post_mul_f(matA, matB);
! ELL_4M_TRANSLATE_SET(matB, 0.0, 0.0, -(1+sc[2])/2);
ell_4m_post_mul_f(matA, matB);
limnObjPartTransform(obj, ri, matA);
win = limnWinNew(limnDevicePS);
--- 139,237 ----
sp->spec = 0;
! q[0] = 1.0;
! q[1] = p[0];
! q[2] = p[1];
! q[3] = p[2];
! len = ELL_4V_LEN(q);
! ELL_4V_SCALE(q, 1.0/len, q);
! washQtoM3(mR, q);
! sc[0] *= os; sc[1] *= os; sc[2] *= os;
! ELL_3V_COPY(eval, sc);
! ELL_SORT3(eval[0], eval[1], eval[2], cl);
! cl = (eval[0] - eval[1])/(eval[0] + eval[1] + eval[2]);
! cp = 2*(eval[1] - eval[2])/(eval[0] + eval[1] + eval[2]);
! if (cl > cp) {
! axis = ELL_MAX3_IDX(sc[0], sc[1], sc[2]);
! qA = pow(1-cp, sh);
! qB = pow(1-cl, sh);
! } else {
! axis = ELL_MIN3_IDX(sc[0], sc[1], sc[2]);
! qA = pow(1-cl, sh);
! qB = pow(1-cp, sh);
! }
! fprintf(stderr, "eval = %g %g %g -> cl=%g %s cp=%g -> axis = %d\n",
! eval[0], eval[1], eval[2], cl, cl > cp ? ">" : "<", cp, axis);
! if (sphere) {
! ri = limnObjPolarSphereAdd(obj, 0, 0, 2*res, res);
! } else {
! ri = limnObjPolarSuperquadAdd(obj, 0, axis, qA, qB, 2*res, res);
! }
! r = obj->r + ri; ELL_4V_SET(r->rgba, 1, 1, 1, 1);
ELL_4M_IDENTITY_SET(matA);
! ELL_4M_SCALE_SET(matB, sc[0], sc[1], sc[2]);
ell_4m_post_mul_f(matA, matB);
! ELL_43M_INSET(matB, mR);
ell_4m_post_mul_f(matA, matB);
limnObjPartTransform(obj, ri, matA);
+ if (rad) {
+ ri = limnObjCylinderAdd(obj, 1, 0, res);
+ r = obj->r + ri; ELL_4V_SET(r->rgba, 0, 0, 0, 1);
+ ELL_4M_IDENTITY_SET(matA);
+ ELL_4M_SCALE_SET(matB, (1-sc[0])/2, rad, rad);
+ ell_4m_post_mul_f(matA, matB);
+ ELL_4M_TRANSLATE_SET(matB, (1+sc[0])/2, 0.0, 0.0);
+ ell_4m_post_mul_f(matA, matB);
+ limnObjPartTransform(obj, ri, matA);
+
+ ri = limnObjCylinderAdd(obj, 1, 0, res);
+ r = obj->r + ri; ELL_4V_SET(r->rgba, 0, 0, 0, 1);
+ ELL_4M_IDENTITY_SET(matA);
+ ELL_4M_SCALE_SET(matB, (1-sc[0])/2, rad, rad);
+ ell_4m_post_mul_f(matA, matB);
+ ELL_4M_TRANSLATE_SET(matB, -(1+sc[0])/2, 0.0, 0.0);
+ ell_4m_post_mul_f(matA, matB);
+ limnObjPartTransform(obj, ri, matA);
+
+
+ ri = limnObjCylinderAdd(obj, 1, 1, res);
+ r = obj->r + ri; ELL_4V_SET(r->rgba, 0, 0, 0, 1);
+ ELL_4M_IDENTITY_SET(matA);
+ ELL_4M_SCALE_SET(matB, rad, (1-sc[1])/2, rad);
+ ell_4m_post_mul_f(matA, matB);
+ ELL_4M_TRANSLATE_SET(matB, 0.0, (1+sc[1])/2, 0.0);
+ ell_4m_post_mul_f(matA, matB);
+ limnObjPartTransform(obj, ri, matA);
+
+ ri = limnObjCylinderAdd(obj, 1, 1, res);
+ r = obj->r + ri; ELL_4V_SET(r->rgba, 0, 0, 0, 1);
+ ELL_4M_IDENTITY_SET(matA);
+ ELL_4M_SCALE_SET(matB, rad, (1-sc[1])/2, rad);
+ ell_4m_post_mul_f(matA, matB);
+ ELL_4M_TRANSLATE_SET(matB, 0.0, -(1+sc[1])/2, 0.0);
+ ell_4m_post_mul_f(matA, matB);
+ limnObjPartTransform(obj, ri, matA);
+
+
+ ri = limnObjCylinderAdd(obj, 1, 2, res);
+ r = obj->r + ri; ELL_4V_SET(r->rgba, 0, 0, 0, 1);
+ ELL_4M_IDENTITY_SET(matA);
+ ELL_4M_SCALE_SET(matB, rad, rad, (1-sc[2])/2);
+ ell_4m_post_mul_f(matA, matB);
+ ELL_4M_TRANSLATE_SET(matB, 0.0, 0.0, (1+sc[2])/2);
+ ell_4m_post_mul_f(matA, matB);
+ limnObjPartTransform(obj, ri, matA);
+
+ ri = limnObjCylinderAdd(obj, 1, 2, res);
+ r = obj->r + ri; ELL_4V_SET(r->rgba, 0, 0, 0, 1);
+ ELL_4M_IDENTITY_SET(matA);
+ ELL_4M_SCALE_SET(matB, rad, rad, (1-sc[2])/2);
+ ell_4m_post_mul_f(matA, matB);
+ ELL_4M_TRANSLATE_SET(matB, 0.0, 0.0, -(1+sc[2])/2);
+ ell_4m_post_mul_f(matA, matB);
+ limnObjPartTransform(obj, ri, matA);
+ }
win = limnWinNew(limnDevicePS);
|
|
From: <kin...@us...> - 2003-11-29 08:16:44
|
Update of /cvsroot/teem/teem/src/limn
In directory sc8-pr-cvs1:/tmp/cvs-serv5720/limn
Modified Files:
shapes.c
Log Message:
bug in Y-axis-aligned limnObjPolarSuperquadAdd
Index: shapes.c
===================================================================
RCS file: /cvsroot/teem/teem/src/limn/shapes.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** shapes.c 6 Oct 2003 11:14:57 -0000 1.13
--- shapes.c 29 Nov 2003 08:16:41 -0000 1.14
***************
*** 290,295 ****
break;
case 1:
! x = airSgnPow(cos(p),B);
! y = airSgnPow(sin(t),A) * airSgnPow(sin(p),B);
z = airSgnPow(cos(t),A) * airSgnPow(sin(p),B);
break;
--- 290,295 ----
break;
case 1:
! x = airSgnPow(sin(t),A) * airSgnPow(sin(p),B);
! y = airSgnPow(cos(p),B);
z = airSgnPow(cos(t),A) * airSgnPow(sin(p),B);
break;
|