From: Gordon K. <gk...@cs...> - 2004-10-22 03:24:29
|
hello, > By default "unu make" creates datasets that are node centered, right? > Is there any way to override this with "unu make" (short of creating a > .nhdr, and editing it) or with some other unu subcommand? This is a source of increasing annoyance for me and many others. The default-ness of node centering does not originate with unu, but with nrrd, via teem/src/nrrd/defaultsNrrd.c: int nrrdDefCenter = nrrdCenterNode; I set this to node centering back in the days (in the late 20th century) when the only things nrrds were used for scalar datasets for volume rendering. In that context, the "voxel" is the conceptual unit of the volume, and is usually a cube with a value at each of its eight corners (ala marching cubes), which in turn implies node centering. Currently, there is a hack work-around. The values of the nrrdDef* and nrrdState* globals can be set by environment variables. Upon start-up, unu calls nrrdDefGetenv() and nrrdStateGetenv(), which does this (again, see teem/src/nrrd/defaultsNrrd.c). Here the environment variables you can currently set. The values should be consistent with the string you'd normally put a nrrd header. NRRD_DEF_CENTER NRRD_DEF_WRITE_BARE_TEXT NRRD_STATE_KIND_NOOP NRRD_STATE_VERBOSE_IO NRRD_STATE_BLIND_8_BIT_RANGE NRRD_STATE_ALWAYS_SET_CONTENT NRRD_STATE_DISABLE_CONTENT NRRD_STATE_MEASURE_TYPE NRRD_STATE_MEASURE_MODE_BINS NRRD_STATE_MEASURE_HISTO_TYPE There is no documentation on what these do right now, other than grepping source for their use... So, right now, you can: setenv NRRD_DEF_CENTER cell and you should be happy. > I realize that this might not be doable because hest would need to > know how to handle default values of "unknown" (i.e. don't change it > if it's already set), but I thought I would check anyway. Ah, you indeed know something about the various weak-points in teem. Yes, this problem is in fact trace-able to a deficiency in hest, and right now hest is first in line for a complete re-write. Gordon |