void ZDvidSynapse::updatePartnerProperty(ZDvidReader &reader) { m_isPartnerVerified.resize(m_partnerHint.size(), false); m_partnerKind.resize(m_partnerHint.size(), EKind::KIND_UNKNOWN); m_partnerStatus.resize(m_partnerHint.size(), STATUS_NORMAL); if (reader.good()) { for (size_t i = 0; i < m_partnerHint.size(); ++i) { ZDvidSynapse synapse = reader.readSynapse(m_partnerHint[i], flyem::EDvidAnnotationLoadMode::PARTNER_LOCATION); if (synapse.isValid()) { if (synapse.hasPartner(getPosition())) { m_isPartnerVerified[i] = synapse.isVerified(); m_partnerKind[i] = synapse.getKind(); m_partnerStatus[i] = synapse.getStatus(); }/* else { LWARN() << "Inconsistent synapse link:" << getPosition().toString() << "->" << synapse.getPosition().toString(); }*/ } else { m_isPartnerVerified[i] = false; m_partnerKind[i] = ZDvidSynapse::EKind::KIND_INVALID; } } } }
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); } } }