bool HDFRegionsWriter::Write(const RegionAnnotation &annotation)
{
    try {
        regionsArray_.WriteRow(annotation.row, HDFRegionsWriter::NCOLS);
    } catch (H5::Exception &e) {
        std::ostringstream sout;
        sout << "Failed to write region annotation " << annotation.GetHoleNumber();
        AddErrorMessage(sout.str());
        return false;
    }
    ++curRow_;
    return true;
}
Ejemplo n.º 2
0
void HDFRegionTableReader::GetMinMaxHoleNumber(UInt &minHole,
                                               UInt &maxHole) {
    // Hole numbers may not be sorted ascendingly, so do not
    // return the first and last hole numbers as the min and max.
    UInt saveCurRow = curRow;
    curRow = 0;
    bool init = false;
    RegionAnnotation annotation;
    while (GetNext(annotation) == 1) {
        UInt curHole = annotation.GetHoleNumber();
        if (not init) {
            minHole = maxHole = curHole;
            init = true;
        } else {
            minHole = (minHole > curHole)?(curHole):(minHole);
            maxHole = (maxHole < curHole)?(curHole):(maxHole);
        }
    }
    curRow = saveCurRow;
}