Exemplo n.º 1
0
int
_nrrdContentSet_nva(Nrrd *nout, const char *func,
                    char *content, const char *format, va_list arg) {
  char me[]="_nrrdContentSet_nva", err[BIFF_STRLEN], *buff;

  buff = (char *)malloc(128*AIR_STRLEN_HUGE);
  if (!buff) {
    sprintf(err, "%s: couln't alloc buffer!", me);
    biffAdd(NRRD, err); return 1;
  }
  nout->content = (char *)airFree(nout->content);

  /* we are currently praying that this won't overflow the "buff" array */
  /* HEY: replace with vsnprintf or whatever when its available */
  vsprintf(buff, format, arg);

  nout->content = (char *)calloc(strlen("(,)")
                                 + airStrlen(func)
                                 + 1                      /* '(' */
                                 + airStrlen(content)
                                 + 1                      /* ',' */
                                 + airStrlen(buff)
                                 + 1                      /* ')' */
                                 + 1, sizeof(char));      /* '\0' */
  if (!nout->content) {
    sprintf(err, "%s: couln't alloc output content!", me);
    biffAdd(NRRD, err); airFree(buff); return 1;
  }
  sprintf(nout->content, "%s(%s%s%s)", func, content,
          airStrlen(buff) ? "," : "", buff);
  airFree(buff);  /* no NULL assignment, else compile warnings */
  return 0;
}
Exemplo n.º 2
0
Arquivo: gzio.c Projeto: BRAINSia/teem
/*
** _nrrdGzDestroy()
**
** Cleans up then free the given _NrrdGzStream. Returns a zlib error code.
** Try freeing in the reverse order of allocations.  FILE* s->file is not
** closed.  Because we didn't allocate it, we shouldn't delete it.
*/
static int
_nrrdGzDestroy(_NrrdGzStream *s) {
  static const char me[]="_nrrdGzDestroy";
  int error = Z_OK;

  if (s == NULL) {
    biffAddf(NRRD, "%s: invalid stream", me);
    return 1;
  }
  s->msg = (char *)airFree(s->msg);
  if (s->stream.state != NULL) {
    if (s->mode == 'w') {
      error = deflateEnd(&(s->stream));
    } else if (s->mode == 'r') {
      error = inflateEnd(&(s->stream));
    }
  }
  if (error != Z_OK) {
    biffAddf(NRRD, "%s: %s", me, _NRRD_GZ_ERR_MSG(error));
  }
  if (s->z_err < 0) error = s->z_err;
  if (error != Z_OK) {
    biffAddf(NRRD, "%s: %s", me, _NRRD_GZ_ERR_MSG(error));
  }
  s->inbuf = (Byte *)airFree(s->inbuf);
  s->outbuf = (Byte *)airFree(s->outbuf);
  airFree(s);   /* avoiding unused value warnings, no NULL set */
  return error != Z_OK;
}
Exemplo n.º 3
0
/*
******** nrrdContentSet
**
** Kind of like sprintf, but for the content string of the nrrd.
**
** Whether or not we write a new content for an old nrrd ("nin") with
** NULL content is decided here, according to
** nrrdStateAlwaysSetContent.
**
** Does the string allocation and some attempts at error detection.
** Does allow nout==nin, which requires some care.
*/
int
nrrdContentSet_va(Nrrd *nout, const char *func,
                  const Nrrd *nin, const char *format, ...) {
  static const char me[]="nrrdContentSet_va";
  va_list ap;
  char *content;

  if (!(nout && func && nin && format)) {
    biffAddf(NRRD, "%s: got NULL pointer", me);
    return 1;
  }
  if (nrrdStateDisableContent) {
    /* we kill content always */
    nout->content = (char *)airFree(nout->content);
    return 0;
  }
  if (!nin->content && !nrrdStateAlwaysSetContent) {
    /* there's no input content, and we're not supposed to invent any
       content, so after freeing nout's content we're done */
    nout->content = (char *)airFree(nout->content);
    return 0;
  }
  /* we copy the input nrrd content first, before blowing away the
     output content, in case nout == nin */
  content = _nrrdContentGet(nin);
  va_start(ap, format);
  if (_nrrdContentSet_nva(nout, func, content, format, ap)) {
    biffAddf(NRRD, "%s:", me);
    va_end(ap); free(content); return 1;
  }
  va_end(ap);
  free(content);

  return 0;
}
Exemplo n.º 4
0
/*
******** nrrdNix()
**
** does nothing with the array data inside, just does whatever is needed
** to free the nrrd itself
**
** returns NULL
**
** this does NOT use biff
*/
Nrrd *
nrrdNix(Nrrd *nrrd)
{
  int ii;

  if (nrrd)
  {
    for (ii=0; ii<NRRD_DIM_MAX; ii++)
    {
      _nrrdAxisInfoInit(&(nrrd->axis[ii]));
    }
    for (ii=0; ii<NRRD_SPACE_DIM_MAX; ii++)
    {
      nrrd->spaceUnits[ii] = (char *)airFree(nrrd->spaceUnits[ii]);
    }
    nrrd->content = (char *)airFree(nrrd->content);
    nrrd->sampleUnits = (char *)airFree(nrrd->sampleUnits);
    nrrdCommentClear(nrrd);
    nrrd->cmtArr = airArrayNix(nrrd->cmtArr);
    nrrdKeyValueClear(nrrd);
    nrrd->kvpArr = airArrayNix(nrrd->kvpArr);
    airFree(nrrd);
  }
  return NULL;
}
Exemplo n.º 5
0
/*
******** meetPullVolNix
**
** this frees stuff allocated meetPullVolParse and meetPullVolLoadMulti
*/
meetPullVol *
meetPullVolNix(meetPullVol *mpv) {

  if (mpv) {
    if (!mpv->leeching && mpv->nin) {
      nrrdNuke(mpv->nin);
    }
    if (mpv->numSS) {
      unsigned int ssi;
      if (mpv->ninSS) {
        /* need this check because the mpv may not have benefitted
           from meetPullVolLoadMulti, so it might be incomplete */
        for (ssi=0; ssi<mpv->numSS; ssi++) {
          if (!mpv->leeching) {
            nrrdNuke(mpv->ninSS[ssi]);
          }
        }
        airFree(mpv->ninSS);
      }
      airFree(mpv->posSS);
    }
    airFree(mpv->fileName);
    airFree(mpv->volName);
    airFree(mpv);
  }
  return NULL;
}
Exemplo n.º 6
0
/*
** _ell_inv
**
** Invert NNxNN matrix based on LU-decomposition
**
** The given matrix is copied, turned into its LU-decomposition, and
** then repeated backsubstitution is used to get successive columns of
** the inverse.
*/
int
_ell_inv(double *inv, double *_mat, size_t NN) {
  static const char me[]="_ell_inv";
  size_t ii, jj, *indx=NULL;
  double *col=NULL, *mat=NULL;
  int ret=0;

  if (!( (col = (double*)calloc(NN, sizeof(double))) &&
         (mat = (double*)calloc(NN*NN, sizeof(double))) &&
         (indx = (size_t*)calloc(NN, sizeof(size_t))) )) {
    biffAddf(ELL, "%s: couldn't allocate all buffers", me);
    ret = 1; goto seeya;
  }

  memcpy(mat, _mat, NN*NN*sizeof(double));

  if (_ell_LU_decomp(mat, indx, NN)) {
    biffAddf(ELL, "%s: trouble", me);
    ret = 1; goto seeya;
  }

  for (jj=0; jj<NN; jj++) {
    memset(col, 0, NN*sizeof(double));
    col[jj] = 1.0;
    _ell_LU_back_sub(mat, indx, col, NN);
    /* set column jj of inv to result of backsub */
    for (ii=0; ii<NN; ii++) {
      inv[ii*NN + jj] = col[ii];
    }
  }
 seeya:
  airFree(col); airFree(mat); airFree(indx);
  return ret;
}
Exemplo n.º 7
0
baneClip *
baneClipNix(baneClip *clip) {

  if (clip) {
    airFree(clip->name);
    airFree(clip);
  }
  return NULL;
}
Exemplo n.º 8
0
tkwbSlide *
tkwbSlideNix(tkwbSlide *slide) {

    slide->title = (char *)airFree(slide->title);
    slide->image = (char *)airFree(slide->image);
    slide->text = (char *)airFree(slide->text);
    slide = (tkwbSlide *)airFree(slide);
    return NULL;
}
Exemplo n.º 9
0
pullInfoSpec *
pullInfoSpecNix(pullInfoSpec *ispec) {

    if (ispec) {
        airFree(ispec->volName);
        airFree(ispec);
    }
    return NULL;
}
Exemplo n.º 10
0
miteThread *
miteThreadNix(miteThread *mtt) {

  mtt->ansMiteVal = (double *)airFree(mtt->ansMiteVal);
  mtt->directAnsMiteVal = (double **)airFree(mtt->directAnsMiteVal);
  airMopOkay(mtt->rmop);

  airFree(mtt);
  return NULL;
}
Exemplo n.º 11
0
biffMsg *
biffMsgNix(biffMsg *msg) {

  if (msg && msg != biffMsgNoop) {
    airFree(msg->key);
    airArrayLenSet(msg->errArr, 0); /* frees all msg->err[i] */
    airArrayNuke(msg->errArr);
    airFree(msg);
  }
  return NULL;
}
Exemplo n.º 12
0
tenExperSpec*
tenExperSpecNix(tenExperSpec *espec) {

    if (espec) {
        airFree(espec->bval);
        airFree(espec->grad);
        /* espec->wght = airFree(espec->wght); */
        airFree(espec);
    }
    return NULL;
}
Exemplo n.º 13
0
coilTask *
_coilTaskNix(coilTask *task) {

  if (task) {
    task->thread = airThreadNix(task->thread);
    task->_iv3 = (coil_t *)airFree(task->_iv3);
    task->iv3 = (coil_t **)airFree(task->iv3);
    free(task);
  }
  return NULL;
}
Exemplo n.º 14
0
int
limnPolyDataAlloc(limnPolyData *pld,
                  unsigned int infoBitFlag,
                  unsigned int vertNum,
                  unsigned int indxNum,
                  unsigned int primNum) {
  char me[]="limnPolyDataAlloc", err[BIFF_STRLEN];
  
  if (!pld) {
    sprintf(err, "%s: got NULL pointer", me);
    biffAdd(LIMN, err); return 1;
  }
  if (vertNum != pld->xyzwNum) {
    pld->xyzw = (float *)airFree(pld->xyzw);
    if (vertNum) {
      pld->xyzw = (float *)calloc(vertNum, 4*sizeof(float));
      if (!pld->xyzw) {
        sprintf(err, "%s: couldn't allocate %u xyzw", me, vertNum);
        biffAdd(LIMN, err); return 1;
      }
    }
    pld->xyzwNum = vertNum;
  }
  if (_limnPolyDataInfoAlloc(pld, infoBitFlag, vertNum)) {
    sprintf(err, "%s: couldn't allocate info", me);
    biffAdd(LIMN, err); return 1;
  }
  if (indxNum != pld->indxNum) {
    pld->indx = (unsigned int *)airFree(pld->indx);
    if (indxNum) {
      pld->indx = (unsigned int *)calloc(indxNum, sizeof(unsigned int));
      if (!pld->indx) {
        sprintf(err, "%s: couldn't allocate %u indices", me, indxNum);
        biffAdd(LIMN, err); return 1;
      }
    }
    pld->indxNum = indxNum;
  }
  if (primNum != pld->primNum) {
    pld->type = (unsigned char *)airFree(pld->type);
    pld->icnt = (unsigned int *)airFree(pld->icnt);
    if (primNum) {
      pld->type = (unsigned char *)calloc(primNum, sizeof(unsigned char));
      pld->icnt = (unsigned int *)calloc(primNum, sizeof(unsigned int));
      if (!(pld->type && pld->icnt)) {
        sprintf(err, "%s: couldn't allocate %u primitives", me, primNum);
        biffAdd(LIMN, err); return 1;
      }
    }
    pld->primNum = primNum;
  }
  return 0;
}
Exemplo n.º 15
0
NrrdIoState *
nrrdIoStateNix(NrrdIoState *nio) {
  
  nio->path = (char *)airFree(nio->path);
  nio->base = (char *)airFree(nio->base);
  nio->line = (char *)airFree(nio->line);
  nio->dataFNFormat = (char *)airFree(nio->dataFNFormat);
  nio->dataFNArr = airArrayNuke(nio->dataFNArr);
  /* the NrrdIoState never owned nio->oldData; we don't free it */
  airFree(nio);  /* no NULL assignment, else compile warnings */
  return NULL;
}
Exemplo n.º 16
0
pullVolume *
pullVolumeNix(pullVolume *vol) {

  if (vol) {
    vol->name = airFree(vol->name);
    vol->ksp00 = nrrdKernelSpecNix(vol->ksp00);
    vol->ksp11 = nrrdKernelSpecNix(vol->ksp11);
    vol->ksp22 = nrrdKernelSpecNix(vol->ksp22);
    vol->kspSS = nrrdKernelSpecNix(vol->kspSS);
    vol->gctx = gageContextNix(vol->gctx);
    airFree(vol);
  }
  return NULL;
}
Exemplo n.º 17
0
void
mossSamplerEmpty (mossSampler *smplr) {

  if (smplr) {
    smplr->ivc = (float *)airFree(smplr->ivc);
    smplr->xFslw = (double *)airFree(smplr->xFslw);
    smplr->yFslw = (double *)airFree(smplr->yFslw);
    smplr->xIdx = (int *)airFree(smplr->xIdx);
    smplr->yIdx = (int *)airFree(smplr->yIdx);
    smplr->fdiam = 0;
    smplr->ncol = 0;
  }
  return;
}
Exemplo n.º 18
0
airThreadMutex *
airThreadMutexNix(airThreadMutex *mutex) {

  CloseHandle(mutex->handle);
  mutex = airFree(mutex);
  return mutex;
}
Exemplo n.º 19
0
int
coilFinish(coilContext *cctx) {
  char me[]="coilFinish", err[BIFF_STRLEN];
  unsigned int tidx;

  if (!cctx) {
    sprintf(err, "%s: got NULL pointer", me);
    biffAdd(COIL, err); return 1;
  }

  if (cctx->verbose > 1) {
    fprintf(stderr, "%s: finishing workers\n", me);
  }
  cctx->finished = AIR_TRUE;
  if (cctx->numThreads > 1) {
    airThreadBarrierWait(cctx->filterBarrier);
    for (tidx=1; tidx<cctx->numThreads; tidx++) {
      airThreadJoin(cctx->task[tidx]->thread, &(cctx->task[tidx]->returnPtr));
      cctx->task[tidx]->thread = airThreadNix(cctx->task[tidx]->thread);
      cctx->task[tidx] = _coilTaskNix(cctx->task[tidx]);
    }
  }
  cctx->task[0]->thread = airThreadNix(cctx->task[0]->thread);
  cctx->task[0] = _coilTaskNix(cctx->task[0]);
  cctx->task = (coilTask **)airFree(cctx->task);

  if (cctx->numThreads > 1) {
    cctx->nextSliceMutex = airThreadMutexNix(cctx->nextSliceMutex);
    cctx->filterBarrier = airThreadBarrierNix(cctx->filterBarrier);
    cctx->updateBarrier = airThreadBarrierNix(cctx->updateBarrier);
  }

  return 0;
}
Exemplo n.º 20
0
gageKind *
_meetGageKindParse(const char *_str, int constOnly) {
  char *str;
  gageKind *ret;
  
  if (!_str) {
    return NULL;
  }
  str = airToLower(airStrdup(_str));
  if (!str) {
    return NULL;
  }
  if (!strcmp(gageKindScl->name, str)) {
    ret = gageKindScl;
  } else if (!strcmp(gageKindVec->name, str)) {
    ret = gageKindVec;
  } else if (!strcmp(tenGageKind->name, str)) {
    ret = tenGageKind;
  } else if (!constOnly && !strcmp(TEN_DWI_GAGE_KIND_NAME, str)) {
    ret = tenDwiGageKindNew();
  } else {
    ret = NULL;
  }
  airFree(str);
  return ret;
}
Exemplo n.º 21
0
/*
******** nrrdKeyValueAdd
**
** This will COPY the given strings, and so does not depend on
** them existing past the return of this function
**
** NOTE: Despite what might be most logical, there is no effort made
** here to cleanup key or value, including any escaping or filtering
** that might be warranted for white space other than \n
**
** does NOT use BIFF
*/
int
nrrdKeyValueAdd(Nrrd *nrrd, const char *key, const char *value) {
  unsigned int ki;
  int found;

  if (!( nrrd && key && value )) {
    /* got NULL pointer */
    return 1;
  }
  if (!strlen(key)) {
    /* reject empty keys */
    return 1;
  }
  ki = _kvpIdxFind(nrrd, key, &found);
  if (found) {
    /* over-writing value for an existing key, so have to free old value */
    airFree(nrrd->kvp[1 + 2*ki]);
    nrrd->kvp[1 + 2*ki] = airStrdup(value);
  } else {
    /* adding value for a new key */
    ki = airArrayLenIncr(nrrd->kvpArr, 1);
    nrrd->kvp[0 + 2*ki] = airStrdup(key);
    nrrd->kvp[1 + 2*ki] = airStrdup(value);
  }
  return 0;
}
Exemplo n.º 22
0
miteRender *
_miteRenderNew(void) {
  miteRender *mrr;

  mrr = (miteRender *)calloc(1, sizeof(miteRender));
  if (mrr) {
    mrr->rmop = airMopNew();
    if (!mrr->rmop) {
      airFree(mrr);
      return NULL;
    }
    mrr->ntxf = NULL;
    mrr->ntxfNum = 0;
    mrr->sclPvlIdx = -1;
    mrr->vecPvlIdx = -1;
    mrr->tenPvlIdx = -1;
    mrr->normalSpec = gageItemSpecNew();
    airMopAdd(mrr->rmop, mrr->normalSpec,
              (airMopper)gageItemSpecNix, airMopAlways);
    mrr->shadeSpec = miteShadeSpecNew();
    airMopAdd(mrr->rmop, mrr->shadeSpec,
              (airMopper)miteShadeSpecNix, airMopAlways);
    mrr->time0 = AIR_NAN;
    GAGE_QUERY_RESET(mrr->queryMite);
    mrr->queryMiteNonzero = AIR_FALSE;
  }
  return mrr;
}
int
dyeColorParse(dyeColor *col, char *_str) {
  char me[]="dyeColorParse", err[128], *str;
  char *colon, *valS;
  float v0, v1, v2;
  int spc;
  
  if (!(col && _str)) {
    sprintf(err, "%s: got NULL pointer", me); biffAdd(DYE, err); return 1;
  }
  if (!(str = airStrdup(_str))) {
    sprintf(err, "%s: couldn't strdup!", me);
    biffAdd(DYE, err); return 1;
  }
  if (!(colon = strchr(str, ':'))) {
    sprintf(err, "%s: given string \"%s\" didn't contain colon", me, str);
    biffAdd(DYE, err); return 1;
  }
  *colon = '\0';
  valS = colon+1;
  if (3 != sscanf(valS, "%g,%g,%g", &v0, &v1, &v2)) {
    sprintf(err, "%s: couldn't parse three floats from \"%s\"", me, valS);
    biffAdd(DYE, err); return 1;
  }
  spc = dyeStrToSpace(str);
  if (dyeSpaceUnknown == spc) {
    sprintf(err, "%s: couldn't parse colorspace from \"%s\"", me, str);
    biffAdd(DYE, err); return 1;
  }
  str = (char *)airFree(str);

  dyeColorSet(col, spc, v0, v1, v2);
  return 0;
}
Exemplo n.º 24
0
/*
******** nrrdSpaceSet
**
** What to use to set space, when a value from nrrdSpace enum is known,
** or, to nullify all space-related information when passed nrrdSpaceUnknown
*/
int
nrrdSpaceSet(Nrrd *nrrd, int space) {
  static const char me[]="nrrdSpaceSet";
  unsigned axi, saxi;

  if (!nrrd) {
    biffAddf(NRRD, "%s: got NULL pointer", me);
    return 1;
  }
  if (nrrdSpaceUnknown == space) {
    nrrd->space = nrrdSpaceUnknown;
    nrrd->spaceDim = 0;
    for (axi=0; axi<NRRD_DIM_MAX; axi++) {
      nrrdSpaceVecSetNaN(nrrd->axis[axi].spaceDirection);
    }
    for (saxi=0; saxi<NRRD_SPACE_DIM_MAX; saxi++) {
      airFree(nrrd->spaceUnits[saxi]);
      nrrd->spaceUnits[saxi] = NULL;
    }
    nrrdSpaceVecSetNaN(nrrd->spaceOrigin);
  } else {
    if (airEnumValCheck(nrrdSpace, space)) {
      biffAddf(NRRD, "%s: given space (%d) not valid", me, space);
      return 1;
    }
    nrrd->space = space;
    nrrd->spaceDim = nrrdSpaceDimension(space);
  }
  return 0;
}
Exemplo n.º 25
0
echoGlobalState *
echoGlobalStateNix(echoGlobalState *state) {

  airFree(state);
  /* mutex freed at end of echoRTRender() */
  return NULL;
}
Exemplo n.º 26
0
void
nrrdIoStateInit(NrrdIoState *nio)
{

  if (nio)
  {
    nio->path = (char *)airFree(nio->path);
    nio->base = (char *)airFree(nio->base);
    nio->line = (char *)airFree(nio->line);
    nio->dataFNFormat = (char *)airFree(nio->dataFNFormat);
    /* the way IO to/from strings works, I don't think this should be freed */
    nio->headerStringRead = NULL;
    nio->headerStringWrite = NULL;
    airArrayLenSet(nio->dataFNArr, 0);
    /* closing this is always someone else's responsibility */
    nio->headerFile = NULL;
    nio->dataFile = NULL;
    nio->dataFileDim = 0;
    nio->dataFNMin = 0;
    nio->dataFNMax = 0;
    nio->dataFNStep = 0;
    nio->dataFNIndex = -1;
    nio->lineLen = 0;
    nio->pos = 0;
    nio->endian = airEndianUnknown;
    nio->lineSkip = 0;
    nio->headerStrlen = 0;
    nio->headerStrpos = 0;
    nio->byteSkip = 0;
    memset(nio->seen, 0, (NRRD_FIELD_MAX+1)*sizeof(int));
    nio->detachedHeader = AIR_FALSE;
    nio->bareText = nrrdDefaultWriteBareText;
    nio->charsPerLine = nrrdDefaultWriteCharsPerLine;
    nio->valsPerLine = nrrdDefaultWriteValsPerLine;
    nio->skipData = AIR_FALSE;
    nio->keepNrrdDataFileOpen = AIR_FALSE;
    nio->zlibLevel = -1;
    nio->zlibStrategy = nrrdZlibStrategyDefault;
    nio->bzip2BlockSize = -1;
    nio->learningHeaderStrlen = AIR_FALSE;
    nio->oldData = NULL;
    nio->oldDataSize = 0;
    nio->format = nrrdFormatUnknown;
    nio->encoding = nrrdEncodingUnknown;
  }
  return;
}
Exemplo n.º 27
0
/*
** doesn't set pld->xyzwNum, only the per-attribute xxxNum variables
*/
int
_limnPolyDataInfoAlloc(limnPolyData *pld, unsigned int infoBitFlag,
                       unsigned int vertNum) {
  char me[]="_limnPolyDataInfoAlloc", err[BIFF_STRLEN];
  
  if (vertNum != pld->rgbaNum
      && ((1 << limnPolyDataInfoRGBA) & infoBitFlag)) {
    pld->rgba = (unsigned char *)airFree(pld->rgba);
    if (vertNum) {
      pld->rgba = (unsigned char *)calloc(vertNum, 4*sizeof(unsigned char));
      if (!pld->rgba) {
        sprintf(err, "%s: couldn't allocate %u rgba", me, vertNum);
        biffAdd(LIMN, err); return 1;
      }
    }
    pld->rgbaNum = vertNum;
  }

  if (vertNum != pld->normNum
      && ((1 << limnPolyDataInfoNorm) & infoBitFlag)) {
    pld->norm = (float *)airFree(pld->norm);
    if (vertNum) {
      pld->norm = (float *)calloc(vertNum, 4*sizeof(float));
      if (!pld->norm) {
        sprintf(err, "%s: couldn't allocate %u norm", me, vertNum);
        biffAdd(LIMN, err); return 1;
      }
    }
    pld->normNum = vertNum;
  }

  if (vertNum != pld->tex2Num
      && ((1 << limnPolyDataInfoTex2) & infoBitFlag)) {
    pld->tex2 = (float *)airFree(pld->tex2);
    if (vertNum) {
      pld->tex2 = (float *)calloc(vertNum, 4*sizeof(float));
      if (!pld->tex2) {
        sprintf(err, "%s: couldn't allocate %u tex2", me, vertNum);
        biffAdd(LIMN, err); return 1;
      }
    }
    pld->tex2Num = vertNum;
  }

  return 0;
}
Exemplo n.º 28
0
void
_nrrdAxisInfoInit(NrrdAxisInfo *axis) {
  int dd;
  
  if (axis) {
    axis->size = 0;
    axis->spacing = axis->thickness = AIR_NAN;
    axis->min = axis->max = AIR_NAN;
    for (dd=0; dd<NRRD_SPACE_DIM_MAX; dd++) {
      axis->spaceDirection[dd] = AIR_NAN;
    }
    axis->center = nrrdCenterUnknown;
    axis->kind = nrrdKindUnknown;
    axis->label = (char *)airFree(axis->label);
    axis->units = (char *)airFree(axis->units);
  }
}
Exemplo n.º 29
0
airThreadBarrier *
airThreadBarrierNix(airThreadBarrier *barrier) {
  
  barrier->doneMutex = airThreadMutexNix(barrier->doneMutex);
  barrier->doneCond = airThreadCondNix(barrier->doneCond);
  airFree(barrier);
  return NULL;
}
Exemplo n.º 30
0
baneRange *
baneRangeNix(baneRange *range) {

  if (range) {
    airFree(range);
  }
  return NULL;
}