Exemplo n.º 1
0
void Mask::LoadMaskAndAbortOnFailure(const char *maskFileName)
{
    int retval=SetMask (maskFileName);
    if (retval)
       exit (EXIT_FAILURE);
    validateMask();
}
Exemplo n.º 2
0
void Mask::UpdateBeadFindOutcomes( Region &wholeChip, char const *maskFileName, bool not_single_beadfind, int update_stats, char const *maskStatsName)
{
  // write the beadmask in maskPtr to file maskFileName
  if (!update_stats)
  {
    DumpStats (wholeChip, (char *)maskStatsName, not_single_beadfind);
  }
  WriteRaw (maskFileName);
  validateMask();
}
Exemplo n.º 3
0
vector getFileMask(WaveFile* waveFile, vector wave, int len, char marker = NULL)
{
    vector mask;

    ListChunk * listLablChunk = NULL;
    ListChunk * listLtxtChunk = NULL;

    qDebug() << "listCount " << waveFile->listCount << LOG_DATA;

    for (int i=0; i<waveFile->listCount; i++)
    {
        ListChunk * listChunk = &(waveFile->listChunks[i]);
        if (listChunk == NULL) continue;

        qDebug() << "listChunk->lablCount " << listChunk->lablCount << LOG_DATA;
        if (listChunk->lablChunks != NULL && listChunk->lablCount > 0)
        {
            listLablChunk = listChunk;
        }

        qDebug() << "listChunk->ltxtCount " << listChunk->ltxtCount << LOG_DATA;
        if (listChunk->ltxtChunks != NULL && listChunk->ltxtCount > 0)
        {
            listLtxtChunk = listChunk;
        }
    }

    bool tryFileData = (waveFile->cueChunk != NULL)
            && (littleEndianBytesToUInt16(waveFile->cueChunk->cuePointsCount) > 0)
            && (listLtxtChunk != NULL)
            && (listLtxtChunk->ltxtChunks != NULL)
            && (listLtxtChunk->ltxtCount > 0)
            && (listLablChunk != NULL)
            && (listLablChunk->lablChunks != NULL)
            && (listLablChunk->lablCount > 0);

    if (tryFileData)
    {
        qDebug() << "tryFileData" << LOG_DATA;
        vector mask_from_file = readMaskFromFile(waveFile, wave.x, marker);
        vector mask_norm = normalizev(mask_from_file, MASK_MIN, MASK_MAX);
        mask = vector_resize(mask_norm, len);
        freev(mask_norm);
        freev(mask_from_file);
        qDebug() << "vector_resize" << LOG_DATA;
    }

    if (!tryFileData || !validateMask(mask)) {
        qDebug() << "!tryFileData" << LOG_DATA;
        mask = onesv(len);
    }

    return mask;
}