Пример #1
0
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;
      }
    }
  }
}
Пример #2
0
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;
}