|
From: Gordon K. <kin...@us...> - 2004-03-29 21:37:06
|
Update of /cvsroot/teem/teemdoc/html/nrrd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26716 Modified Files: lib.html Log Message: clarified use of nrrdLoad when using a non-nrrd memory allocator Index: lib.html =================================================================== RCS file: /cvsroot/teem/teemdoc/html/nrrd/lib.html,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** lib.html 19 Feb 2004 22:51:12 -0000 1.6 --- lib.html 29 Mar 2004 21:25:35 -0000 1.7 *************** *** 345,351 **** /* we're done with the nrrdIoState, this sets it to NULL */ nios = nrrdIoStateNix(nios); ! /* load the nrrd again, this time the data will be read, but ! the existing nin->data memory will be used, because nrrdRead (called by nrrdLoad) remembers the address and size of incoming allocated data, and eventually it will get used, instead of --- 345,361 ---- /* we're done with the nrrdIoState, this sets it to NULL */ nios = nrrdIoStateNix(nios); + + /* 1) YOU, the nrrd user, look at things like nin->dim, + nrrdElementNumber(nin), nrrdElementSize(nin), + nin->axis[0].size, nin->axis[1].size, etc in order allocate the data + for the nrrd. Make sure that the data is allocated as one single + contiguous address range, or else nrrd will not operate correctly on + the values stored there. */ + + /* 2) YOU now set nin->data to the beginning of your allocated memory */ + nin->data = YOUR POINTER HERE; ! /* 3) Now load the nrrd again, this time actually reading the data. ! The existing nin->data memory will be used, because nrrdRead (called by nrrdLoad) remembers the address and size of incoming allocated data, and eventually it will get used, instead of |