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;
|