|
From: <kin...@us...> - 2003-11-12 08:38:23
|
Update of /cvsroot/teem/teemdoc/html/nrrd
In directory sc8-pr-cvs1:/tmp/cvs-serv20958
Modified Files:
lib.html
Added Files:
demoIO.c
Log Message:
first stab at some nrrd API documentation
--- NEW FILE: demoIO.c ---
/*
Gordon compiles with this on his powerbook:
cc -o demoIO demoIO.c \
-I/Users/gk/teem/include -I/sw/include \
-L/Users/gk/teem/darwin.32/lib -L/sw/lib \
-lteem -lpng -lbz2 -lz -lm
*/
#include <teem/nrrd.h>
void
demoIO(char *filename) {
char me[]="demoIO", newname[]="foo.nrrd", *err;
Nrrd *nin;
/* create a nrrd; at this point this is just an empty container */
nin = nrrdNew();
/* read in the nrrd from file */
if (nrrdLoad(nin, filename, NULL)) {
err = biffGetDone(NRRD);
fprintf(stderr, "%s: trouble reading \"%s\":\n%s", me, filename, err);
free(err);
return;
}
/* say something about the array */
printf("%s: \"%s\" is a %d-dimensional nrrd of type %d (%s)\n",
me, filename, nin->dim, nin->type,
airEnumStr(nrrdType, nin->type));
printf("%s: the array contains %d elements, each %d bytes in size\n",
me, (int)nrrdElementNumber(nin), (int)nrrdElementSize(nin));
/* write out the nrrd to a different file */
if (nrrdSave(newname, nin, NULL)) {
err = biffGetDone(NRRD);
fprintf(stderr, "%s: trouble writing \"%s\":\n%s", me, newname, err);
free(err);
return;
}
/* blow away both the Nrrd struct *and* the memory at nin->data
(nrrdNix() frees the struct but not the data,
nrrdEmpty() frees the data but not the struct) */
nrrdNuke(nin);
return;
}
int
main(int argc, char **argv) {
if (2 != argc) {
fprintf(stderr, "usage: demoIO <filename>\n");
return 1;
}
demoIO(argv[1]);
return 0;
}
Index: lib.html
===================================================================
RCS file: /cvsroot/teem/teemdoc/html/nrrd/lib.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** lib.html 22 Jul 2003 22:44:12 -0000 1.2
--- lib.html 12 Nov 2003 08:37:59 -0000 1.3
***************
*** 39,46 ****
</table>
! <!--
Currently, the <b>nrrd</b> library, as with all the <b>teem</b>
! libraries, is implemented completely in C. There are various aspects
of <b>nrrd</b> that smack of C++ templates, and some that cry out for
templates, but these are the exceptions. I program in C because its a
--- 39,1136 ----
</table>
[...1077 lines suppressed...]
+ <td align=left>find connected components in 1-D, 2-D or 3-D
+ <tr>
+ <td align=right><tt>nrrdCCMerge</tt>
+ <td><b>-</b>
+ <td align=left>merge some components into others, based on
+ a variety of criteria
+ <tr>
+ <td align=right><tt>nrrdCCSettle</tt>
+ <td><b>-</b>
+ <td align=left>assign set of lowest-valued possible component IDs
+ </table>
+ </center>
+
+ <!--
Currently, the <b>nrrd</b> library, as with all the <b>teem</b>
! libraries, is implemented completely in C.
!
! There are various aspects
of <b>nrrd</b> that smack of C++ templates, and some that cry out for
templates, but these are the exceptions. I program in C because its a
|