示例#1
0
  /**
   * TODO
   *
   * @param r The segmentation image.
   * @param op0 Source intensity image.
   * @param op1 Start position.
   */
  @Override
  public final RandomAccessibleInterval<T> compute(
      final RandomAccessibleInterval<T> op0,
      final Localizable op1,
      final RandomAccessibleInterval<T> r) {
    final long[] op1pos = new long[op1.numDimensions()];
    op1.localize(op1pos);
    compute(op0, op1pos, r);

    return r;
  }
示例#2
0
  public static String printCoordinates(final Localizable localizable) {
    String out = "(Localizable empty)";

    if (localizable == null || localizable.numDimensions() == 0) return out;
    else out = "(" + localizable.getFloatPosition(0);

    for (int i = 1; i < localizable.numDimensions(); i++)
      out += ", " + localizable.getFloatPosition(i);

    out += ")";

    return out;
  }
 @Override
 public String toString() {
   String s = "{" + value.toString() + " : ";
   boolean first = true;
   for (Localizable l : pixelList) {
     if (first) {
       first = false;
     } else {
       s += ", ";
     }
     s += l.toString();
   }
   return s + "}";
 }
示例#4
0
 /**
  * update the minimum and maximum extents with the given coordinates.
  *
  * @param position
  */
 public void update(final Localizable position) {
   for (int d = 0; d < min.length; d++) {
     final long p = position.getLongPosition(d);
     if (p < min[d]) min[d] = p;
     if (p > max[d]) max[d] = p;
   }
 }
 @Override
 public void move(final Localizable localizable) {
   for (int d = 0; d < n; ++d) {
     final long distance = localizable.getLongPosition(d);
     currentPos[d] += distance;
   }
 }
 @Override
 public void setPosition(final Localizable localizable) {
   for (int d = 0; d < n; ++d) {
     final long position = localizable.getLongPosition(d);
     currentPos[d] = position;
   }
 }
示例#7
0
 @Override
 public void setPosition(final Localizable localizable) {
   localizable.localize(position);
   int index = 0;
   for (int d = 0; d < n; ++d) index += position[d] * img.steps[d];
   type.updateIndex(index);
 }
示例#8
0
 @Override
 public void move(final Localizable localizable) {
   int index = 0;
   for (int d = 0; d < n; ++d) {
     final int distance = localizable.getIntPosition(d);
     position[d] += distance;
     index += distance * img.steps[d];
   }
   type.incIndex(index);
 }
 @Override
 public void move(final Localizable localizable) {
   for (int d = 0; d < n; ++d) currentPos[d] += localizable.getLongPosition(d);
 }
示例#10
0
 /**
  * Sets the values of the {@link Position} for all dimensions. Throws an exception if any given
  * value is outside the bounds of the parent {@link Extents}. The position is encoded as an
  * absolute Localizable vector.
  */
 @Override
 public void setPosition(final Localizable localizable) {
   for (int i = 0; i < position.length; i++) setPosition(localizable.getLongPosition(i), i);
 }
  public void updateCenter(final Localizable center) {
    for (int d = 0; d < numDimensions; ++d) this.center[d] = center.getLongPosition(d);

    reset();
  }