Esempio n. 1
0
void
nrrdDefaultGetenv(void) {
  
  /* these two pre-date Def --> Default rename */
  if (-1 == nrrdGetenvBool(/**/ &nrrdDefaultWriteBareText, NULL,
                           nrrdEnvVarDefaultWriteBareTextOld)) {
    nrrdGetenvBool(/**/ &nrrdDefaultWriteBareText, NULL,
                   nrrdEnvVarDefaultWriteBareText);
  }
  if (-1 == nrrdGetenvEnum(/**/ &nrrdDefaultCenter, NULL, nrrdCenter,
                           nrrdEnvVarDefaultCenterOld)) {
    nrrdGetenvEnum(/**/ &nrrdDefaultCenter, NULL, nrrdCenter,
                   nrrdEnvVarDefaultCenter);
  }
  /* these post-date the Def --> Default rename */

  nrrdGetenvEnum(/**/ &nrrdDefaultWriteEncodingType, NULL, nrrdEncodingType,
                 nrrdEnvVarDefaultWriteEncodingType);
  nrrdGetenvUInt(/**/ &nrrdDefaultWriteCharsPerLine, NULL,
                 nrrdEnvVarDefaultWriteCharsPerLine);
  nrrdGetenvUInt(/**/ &nrrdDefaultWriteValsPerLine, NULL,
                 nrrdEnvVarDefaultWriteValsPerLine);
  nrrdGetenvDouble(/**/ &nrrdDefaultKernelParm0, NULL,
                   nrrdEnvVarDefaultKernelParm0);
  nrrdGetenvDouble(/**/ &nrrdDefaultSpacing, NULL,
                   nrrdEnvVarDefaultSpacing);

  return;
}
Esempio n. 2
0
void
nrrdStateGetenv(void) {

  nrrdGetenvBool(/**/ &nrrdStateKindNoop, NULL,
                 nrrdEnvVarStateKindNoop);
  nrrdGetenvInt(/**/ &nrrdStateVerboseIO, NULL,
                nrrdEnvVarStateVerboseIO);
  nrrdGetenvBool(/**/ &nrrdStateKeyValuePairsPropagate, NULL,
                 nrrdEnvVarStateKeyValuePairsPropagate);
  nrrdGetenvBool(/**/ &nrrdStateBlind8BitRange, NULL,
                 nrrdEnvVarStateBlind8BitRange);
  nrrdGetenvBool(/**/ &nrrdStateAlwaysSetContent, NULL,
                 nrrdEnvVarStateAlwaysSetContent);
  nrrdGetenvBool(/**/ &nrrdStateDisableContent, NULL,
                 nrrdEnvVarStateDisableContent);
  nrrdGetenvEnum(/**/ &nrrdStateMeasureType, NULL, nrrdType,
                 nrrdEnvVarStateMeasureType);
  nrrdGetenvInt(/**/ &nrrdStateMeasureModeBins, NULL,
                nrrdEnvVarStateMeasureModeBins);
  nrrdGetenvEnum(/**/ &nrrdStateMeasureHistoType, NULL, nrrdType,
                 nrrdEnvVarStateMeasureHistoType);
  nrrdGetenvBool(/**/ &nrrdStateGrayscaleImage3D, NULL,
                 nrrdEnvVarStateGrayscaleImage3D);

  return;
}
Esempio n. 3
0
void
_unrrdu_envEnum(FILE *file, const airEnum *enm, const char *envKey,
                int currVal, const char *varName,
                const char *desc, int columns) {
  int val, ret;
  char *envVal;

  /* !!! HEY: CUT + PASTE !!! */
  fprintf(file, "%s (%s enum): ", envKey, enm->name);
  ret = nrrdGetenvEnum(&val, &envVal, enm, envKey);
  switch(ret) {
  case -1:
    fprintf(file, "not set\n");
    break;
  case AIR_TRUE:
    fprintf(file, "set to \"%s\"\n", envVal);
    break;
  case AIR_FALSE:
    fprintf(file, "set to \"%s\"? (invalid) \n", envVal);
    break;
  }
  switch(ret) {
  case -1:
  case AIR_FALSE:
    fprintf(file, "  (%s == %s; unchanged)\n",
            varName, airEnumStr(enm, currVal));
    break;
  case AIR_TRUE:
    fprintf(file, "  ==> %s = %s   **********************\n",
            varName, airEnumStr(enm, currVal));
    break;
  }
  _hestPrintStr(file, 0, 0, columns, desc, AIR_FALSE);
  fprintf(file, "\n");
  /* !!! HEY: CUT + PASTE !!! */
}