• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ZIntPoint类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ZIntPoint的典型用法代码示例。如果您正苦于以下问题:C++ ZIntPoint类的具体用法?C++ ZIntPoint怎么用?C++ ZIntPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ZIntPoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: getLocation

/**********************ZDvidBlockGrid::Location**********************/
ZBlockGrid::Location ZBlockGrid::getLocation(int x, int y, int z) const
{
  ZBlockGrid::Location location;

  x -= m_minPoint.getX();
  y -= m_minPoint.getY();
  z -= m_minPoint.getZ();

  ZIntPoint blockIndex;
  if (x >= 0) {
    blockIndex.setX(x / m_blockSize.getX());
  } else {
    blockIndex.setX(x / m_blockSize.getX() - 1);
  }

  if (y >= 0) {
    blockIndex.setY(y / m_blockSize.getY());
  } else {
    blockIndex.setY(y / m_blockSize.getY() - 1);
  }

  if (z >= 0) {
    blockIndex.setZ(z / m_blockSize.getZ());
  } else {
    blockIndex.setZ(z / m_blockSize.getZ() - 1);
  }

  location.setBlockIndex(blockIndex);

  location.setLocalPosition(x - blockIndex.getX() * m_blockSize.getX(),
                            y - blockIndex.getY() * m_blockSize.getY(),
                            z - blockIndex.getZ() * m_blockSize.getZ());

  return location;
}
开发者ID:,项目名称:,代码行数:36,代码来源:


示例2: ZIntPoint

ZIntPoint operator / (const ZIntPoint &pt1, int scale)
{
  if (scale == 0) {
    return ZIntPoint(0, 0, 0);
  }

  return ZIntPoint(pt1.getX() / scale, pt1.getY() / scale,
                   pt1.getZ() / scale);
}
开发者ID:,项目名称:,代码行数:9,代码来源:


示例3: createSwc

ZSwcTree* ZSwcGenerator::createSwc(const ZIntCuboidFace &face, double radius)
{
  if (!face.isValid()) {
    return NULL;
  }

  ZPointArray ptArray;
  for (int i = 0; i < 4; ++i) {
    ZIntPoint pt = face.getCornerCoordinates(i);
    ptArray.append(ZPoint(pt.getX(), pt.getY(), pt.getZ()));
  }
  ptArray.append(ptArray[0]);

  return createSwc(ptArray, radius, true);
}
开发者ID:,项目名称:,代码行数:15,代码来源:


示例4: getCornerCoordinates

ZIntPoint ZIntCuboidFace::getCornerCoordinates(int index) const
{
  ZIntPoint pt;
  Corner corner = getCorner(index);
  switch (getAxis()) {
  case NeuTube::X_AXIS:
    pt.set(getPlanePosition(), corner.getX(), corner.getY());
    break;
  case NeuTube::Y_AXIS:
    pt.set(corner.getX(), getPlanePosition(), corner.getY());
    break;
  case NeuTube::Z_AXIS:
    pt.set(corner.getX(), corner.getY(), getPlanePosition());
    break;
  }

  return pt;
}
开发者ID:,项目名称:,代码行数:18,代码来源:


示例5: if

bool ZIntPoint::operator < (const ZIntPoint &pt) const
{
  if (getZ() < pt.getZ()) {
    return true;
  } else if (getZ() > pt.getZ()) {
    return false;
  } else {
    if (getY() < pt.getY()) {
      return true;
    } else if (getY() > pt.getY()) {
      return false;
    } else {
      if (getX() < pt.getX()) {
        return true;
      }
    }
  }

  return false;
}
开发者ID:,项目名称:,代码行数:20,代码来源:


示例6: isAdded

ZObject3dScan ZDvidInfo::getBlockIndex(const ZObject3dScan &obj) const
{
  ZIntPoint gridSize = m_endBlockIndex - m_startBlockIndex + 1;
  size_t area = ((size_t) gridSize.getX()) * gridSize.getY();
  size_t blockNumber = area * gridSize.getZ();
  std::vector<bool> isAdded(blockNumber, false);

  //std::set<ZIntPoint> blockSet;
  //ZIntPointArray blockArray;
  ZObject3dScan blockObj;

  for (size_t i = 0; i < obj.getStripeNumber(); ++i) {
#ifdef _DEBUG_2
    if (i % 10000 == 0) {
      std::cout << i << "/" << obj.getStripeNumber() << std::endl;
    }
#endif
    const ZObject3dStripe &stripe = obj.getStripe(i);
    int y = stripe.getY();
    int z = stripe.getZ();
    if (y > 0 && z > 0 && y < m_startCoordinates[1] + m_stackSize[1] &&
        z < m_startCoordinates[2] + m_stackSize[2]) {
      for (int j = 0; j < stripe.getSegmentNumber(); ++j) {
        int x0 = stripe.getSegmentStart(j);
        int x1 = stripe.getSegmentEnd(j);
        if (x0 < 0) {
          x0 = 0;
        } else if (x0 >= m_startCoordinates[0] + m_stackSize[0]) {
          x0 = m_startCoordinates[0] + m_stackSize[0] - 1;
        }

        if (x1 < 0) {
          x1 = 0;
        } else if (x1 >= m_startCoordinates[0] + m_stackSize[0]) {
          x1 = m_startCoordinates[0] + m_stackSize[0] - 1;
        }

        ZIntPoint block1 = getBlockIndex(x0, y, z);
        size_t blockIndex1 = area * block1.getZ() +
            gridSize.getY() * block1.getY() + block1.getX();
        ZIntPoint block2 = getBlockIndex(x1, y, z);
        size_t blockIndex2 = area * block2.getZ() +
            gridSize.getY() * block2.getY() + block2.getX();

        if (!isAdded[blockIndex1] || !isAdded[blockIndex2]) {
          blockObj.addSegment(
                block1.getZ(), block1.getY(), block1.getX(), block2.getX(), false);
          isAdded[blockIndex1] = true;
          isAdded[blockIndex2] = true;
        }
      }
    }
  }

  //blockArray.append(blockSet.begin(), blockSet.end());
  blockObj.canonize();

  return blockObj;
}
开发者ID:,项目名称:,代码行数:59,代码来源:


示例7: getSynapseMoveUrl

std::string ZDvidUrl::getSynapseMoveUrl(
    const ZIntPoint &from, const ZIntPoint &to) const
{
  std::ostringstream stream;

  stream << m_annotationMoveCommand << "/"
         << from.getX() << "_" << from.getY() << "_" << from.getZ() << "/"
         << to.getX() << "_" << to.getY() << "_" << to.getZ();



  return GetFullUrl(getSynapseUrl(), stream.str());
}
开发者ID:janelia-flyem,项目名称:NeuTu,代码行数:13,代码来源:zdvidurl.cpp


示例8: IS_IN_OPEN_RANGE

int ZBlockGrid::getHashIndex(const ZIntPoint &blockIndex) const
{
  int index = -1;

  if (IS_IN_OPEN_RANGE(blockIndex.getX(), -1, m_size.getX()) &&
      IS_IN_OPEN_RANGE(blockIndex.getY(), -1, m_size.getY()) &&
      IS_IN_OPEN_RANGE(blockIndex.getZ(), -1, m_size.getZ())) {
    //ZIntPoint adjustedBlockIndex = blockIndex - m_grid.getFirstCorner();
    int area = m_size.getX() * m_size.getY();
    int width = m_size.getX();
    index = area * blockIndex.getZ() + width * blockIndex.getY() +
        blockIndex.getX();
  }

  return index;
}
开发者ID:,项目名称:,代码行数:16,代码来源:


示例9: Stack_Find_Object_N

Geo3d_Scalar_Field* ZNeuronTracer::extractLineSeed(
    const Stack *mask, const Stack *dist, int minObjSize)
{
  Object_3d_List *objList = Stack_Find_Object_N(
        const_cast<Stack*>(mask), NULL, 1, minObjSize, 26);
  ZObject3dArray objArray;
  objArray.append(objList);

  Geo3d_Scalar_Field *field = Make_Geo3d_Scalar_Field(objArray.size());
  for (size_t i = 0; i < objArray.size(); ++i) {
    ZObject3d *obj = objArray[i];
    ZIntPoint pt = obj->getCentralVoxel();
    field->points[i][0] = pt.getX();
    field->points[i][1] = pt.getY();
    field->points[i][2] = pt.getZ();
    field->values[i] = sqrt(
          C_Stack::value(dist, pt.getX(), pt.getY(), pt.getZ()));
  }

  return field;
}
开发者ID:,项目名称:,代码行数:21,代码来源:


示例10: getSynapseUrl

std::string ZDvidUrl::getSynapseUrl(const ZIntPoint &pos) const
{
  return getSynapseUrl(pos.getX(), pos.getY(), pos.getZ());
}
开发者ID:janelia-flyem,项目名称:NeuTu,代码行数:4,代码来源:zdvidurl.cpp


示例11: getBookmarkUrl

std::string ZDvidUrl::getBookmarkUrl(
    const ZIntPoint &pt, int width, int height, int depth) const
{
  return getBookmarkUrl(pt.getX(), pt.getY(), pt.getZ(), width, height, depth);
}
开发者ID:janelia-flyem,项目名称:NeuTu,代码行数:5,代码来源:zdvidurl.cpp


示例12: getBookmarkKeyUrl

std::string ZDvidUrl::getBookmarkKeyUrl(const ZIntPoint &pt) const
{
  return getBookmarkKeyUrl(pt.getX(), pt.getY(), pt.getZ());
}
开发者ID:janelia-flyem,项目名称:NeuTu,代码行数:4,代码来源:zdvidurl.cpp


示例13: setBlockSize

void ZBlockGrid::setBlockSize(const ZIntPoint &s)
{
  setBlockSize(s.getX(), s.getY(), s.getZ());
}
开发者ID:,项目名称:,代码行数:4,代码来源:


示例14: set

void ZCircle::set(const ZIntPoint &center, double r)
{
  set(center.getX(), center.getY(), center.getZ(), r);
}
开发者ID:,项目名称:,代码行数:4,代码来源:


示例15: setTraceScoreThreshold

Swc_Tree* ZNeuronTracer::trace(double x1, double y1, double z1, double r1,
                               double x2, double y2, double z2, double r2)
{
  setTraceScoreThreshold(TRACING_INTERACTIVE);

  ZIntPoint stackOffset = getStack()->getOffset();

  ZPoint targetPos(x2, y2, z2);

  x1 = iround(x1);
  y1 = iround(y1);
  z1 = iround(z1);
  x2 = iround(x2);
  y2 = iround(y2);
  z2 = iround(z2);

  x1 -= stackOffset.getX();
  y1 -= stackOffset.getY();
  z1 -= stackOffset.getZ();

  x2 -= stackOffset.getX();
  y2 -= stackOffset.getY();
  z2 -= stackOffset.getZ();

  if (x1 < 0 || y1 < 0 || z1 < 0 || x1 >= getStack()->width() ||
      y1 >= getStack()->height() || z1 >= getStack()->depth()) {
    return NULL;
  }

  ZStackGraph stackGraph;
  if (m_resolution[2] / m_resolution[0] > 3.0) {
    stackGraph.setZMargin(2);
  }
  stackGraph.updateRange(
        x1, y1, z1, x2, y2, z2,
        getStack()->width(), getStack()->height(), getStack()->depth());
  if (stackGraph.getRoiVolume() > MAX_P2P_TRACE_VOLUME) {
    return NULL;
  }

  stackGraph.setResolution(m_resolution);

  if (m_vertexOption == ZStackGraph::VO_SURFACE) {
    stackGraph.setWeightFunction(Stack_Voxel_Weight_I);
  } else {
    if (m_usingEdgePath) {
      stackGraph.setWeightFunction(Stack_Voxel_Weight_S);
    } else {
      if (m_backgroundType == NeuTube::IMAGE_BACKGROUND_BRIGHT) {
        stackGraph.setWeightFunction(Stack_Voxel_Weight_Sr);
      } else {
        stackGraph.setWeightFunction(Stack_Voxel_Weight_S);
      }
    }
  }

  ZIntCuboid box = stackGraph.getRange();
//  if (m_usingEdgePath) {
//    box.setFirstCorner(imin2(x1, x2), imin2(y1, y2), imin2(z1, z2));
//    box.setLastCorner(imax2(x1, x2), imax2(y1, y2), imax2(z1, z2));
//  }

  Stack *partial = C_Stack::crop(
        getIntensityData(), box.getFirstCorner().getX(), box.getFirstCorner().getY(),
        box.getFirstCorner().getZ(), box.getWidth(), box.getHeight(),
        box.getDepth(), NULL);

  /*
  if (m_bcAdjust) {
    Stack_Scale(partial, 0, m_greyFactor, m_greyOffset);
  }
  */

  if (m_usingEdgePath) {
    Stack *partialEdge = C_Stack::computeGradient(partial);
    C_Stack::kill(partial);
    partial = partialEdge;

#ifdef _DEBUG_2
    C_Stack::write(GET_TEST_DATA_DIR + "/test.tif", partial);
#endif
  }

  stackGraph.inferWeightParameter(partial);

  ZVoxelArray voxelArray;
  std::vector<int> path;

  if (m_usingEdgePath) {
    int x0 = box.getFirstCorner().getX();
    int y0 = box.getFirstCorner().getY();
    int z0 = box.getFirstCorner().getZ();

    int startIndex = C_Stack::indexFromCoord(
          x1 - x0, y1 - y0 , z1 - z0, C_Stack::width(partial),
          C_Stack::height(partial),
          C_Stack::depth(partial));
    int endIndex = C_Stack::indexFromCoord(
          x2 - x0, y2 - y0, z2 - z0, C_Stack::width(partial),
          C_Stack::height(partial),
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


示例16: getX

bool ZIntPoint::operator ==(const ZIntPoint &pt) const
{
  return getX() == pt.getX() && getY() == pt.getY() && getZ() == pt.getZ();
}
开发者ID:,项目名称:,代码行数:4,代码来源:


示例17: contains

bool ZIntCuboid::contains(const ZIntPoint &pt) const
{
  return contains(pt.getX(), pt.getY(), pt.getZ());
}
开发者ID:,项目名称:,代码行数:4,代码来源:


示例18: setMinPoint

void ZBlockGrid::setMinPoint(const ZIntPoint &pt)
{
  setMinPoint(pt.getX(), pt.getY(), pt.getZ());
}
开发者ID:,项目名称:,代码行数:4,代码来源:


示例19: getBlockBox

ZIntCuboid ZDvidInfo::getBlockBox(const ZIntPoint &blockIndex) const
{
  return getBlockBox(blockIndex.getX(), blockIndex.getY(), blockIndex.getZ());
}
开发者ID:,项目名称:,代码行数:4,代码来源:


示例20: equals

bool ZIntPoint::equals(const ZIntPoint &pt) const
{
  return (getX() == pt.getX()) && (getY() == pt.getY()) &&
      (getZ() == pt.getZ());
}
开发者ID:,项目名称:,代码行数:5,代码来源:



注:本文中的ZIntPoint类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ZIterator类代码示例发布时间:2022-05-31
下一篇:
C++ ZIDLResource类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap