bool ZDvidSynapse::isProtocolVerified(const ZDvidTarget &target) const { if (!isVerified()) { return false; } bool v = true; if (getKind() == EKind::KIND_PRE_SYN) { std::vector<ZIntPoint> psdArray = getPartners(); if (!psdArray.empty()) { ZDvidReader reader; if (reader.open(target)) { for (std::vector<ZIntPoint>::const_iterator iter = psdArray.begin(); iter != psdArray.end(); ++iter) { const ZIntPoint &pt = *iter; ZDvidSynapse synapse = reader.readSynapse(pt, flyem::EDvidAnnotationLoadMode::NO_PARTNER); if (!synapse.isVerified()) { v = false; break; } } } } } else { v = false; } return v; }
void ZDvidTile::setDvidTarget(const ZDvidTarget &target) { m_dvidTarget = target; if (!m_tilingInfo.isValid()) { ZDvidReader reader; if (reader.open(target)) { m_tilingInfo = reader.readTileInfo(target.getMultiscale2dName()); } } }
void ZDvidTile::update(int x, int y, int z, int width, int height) { bool updating = false; if (m_stack == NULL) { m_stack = ZStackFactory::makeZeroStack(GREY, width, height, 1); m_stack->setOffset(x, y, z); updating = true; } else if (m_stack->getOffset().getZ() != z || m_stack->getOffset().getX() != x || m_stack->getOffset().getZ() != z || m_stack->width() != width || m_stack->height() != height) { updating = true; } if (updating) { ZDvidReader reader; if (reader.open(m_dvidTarget)) { Stack *stack = reader.readTile(x, y, z, width, heigth, m_res.getLevel()); } } }
void DvidImageDialog::setSinglePlane() { if (m_singlePlaneDialog->exec()) { ZDvidReader reader; if (reader.open(m_dvidTarget)) { QString infoString = reader.readInfo("grayscale"); qDebug() << infoString; ZDvidInfo dvidInfo; dvidInfo.setFromJsonString(infoString.toStdString()); int z = m_singlePlaneDialog->getValue(); ui->xSpinBox->setValue(dvidInfo.getStartCoordinates().getX()); ui->ySpinBox->setValue(dvidInfo.getStartCoordinates().getY()); ui->zSpinBox->setValue(z); ui->widthSpinBox->setValue(dvidInfo.getStackSize()[0]); ui->heightSpinBox->setValue(dvidInfo.getStackSize()[1]); ui->depthSpinBox->setValue(1); } } }