Example #1
0
  public Region getTranslatedRegion(Vector3f trans) {
    RectangularBox newBox =
        new RectangularBox(
            this.getLowestXValue() + trans.x,
            this.getLowestYValue() + trans.y,
            this.getLowestZValue() + trans.z,
            Math.abs(this.parameterList[3].value),
            Math.abs(this.parameterList[4].value),
            Math.abs(this.parameterList[5].value));

    return newBox;
  }
Example #2
0
 public float getHighestZValue() {
   // just in case the length is negative...
   return Math.max(parameterList[2].value, parameterList[2].value + parameterList[5].value);
 };
Example #3
0
 public float getLowestYValue() {
   // just in case the length is negative...
   return Math.min(parameterList[1].value, parameterList[1].value + parameterList[4].value);
 };
Example #4
0
  private void createSections() {
    float axonRadius = .5f;

    Point3f posnEndPoint = new Point3f(0, -15, 0);

    Segment rootAxon =
        addAxonalSegment(axonRadius, "root", posnEndPoint, somaSection, 1, "axonRootSec");

    Vector<Segment> layer = new Vector<Segment>();

    layer.add(addRelativeAxon(rootAxon, new Point3f(-30, -20, -30), axonRadius));
    layer.add(addRelativeAxon(rootAxon, new Point3f(-30, -20, 30), axonRadius));
    layer.add(addRelativeAxon(rootAxon, new Point3f(30, -20, 30), axonRadius));
    layer.add(addRelativeAxon(rootAxon, new Point3f(30, -20, -30), axonRadius));

    for (int i = 0; i < layer.size(); i++) {
      Segment axon = (Segment) layer.elementAt(i);
      Segment a1 = addRelativeAxon(axon, new Point3f(-6, -4, -6), axonRadius);
      Segment a2 = addRelativeAxon(axon, new Point3f(6, -4, -6), axonRadius);
      Segment a3 = addRelativeAxon(axon, new Point3f(-6, -4, 6), axonRadius);
      Segment a4 = addRelativeAxon(axon, new Point3f(6, -4, 6), axonRadius);

      a1.getSection().addToGroup(axonSynGroup);
      a2.getSection().addToGroup(axonSynGroup);
      a3.getSection().addToGroup(axonSynGroup);
      a4.getSection().addToGroup(axonSynGroup);
    }

    float dendriteDiam = 2;

    int numDendrites = 6;

    for (int i = 0; i < numDendrites; i++) {
      double theta = ((2 * Math.PI) / numDendrites) * i;

      float xFact = (float) Math.sin(theta);
      float zFact = (float) Math.cos(theta);

      posnEndPoint = new Point3f(60 * xFact, 60, 60 * zFact);
      Segment radialDend =
          addDendriticSegment(
              dendriteDiam,
              "radialDend_" + i,
              posnEndPoint,
              somaSection,
              0,
              "radialDend_" + i + "_Sec",
              false);

      Point3f posnNew = new Point3f(30 * xFact, 40, 30 * zFact);
      Segment radialDend2 = addRelativeDendrite(radialDend, posnNew);
      radialDend2.getSection().addToGroup(dendSynGroup);
      Point3f posnNew2 = new Point3f(0, 30, 0);
      Segment radialDend3 = addRelativeDendrite(radialDend2, posnNew2);

      radialDend3.getSection().addToGroup(dendSynGroup);

      Point3f posnNew3 = new Point3f(-10 * xFact, 30, -10 * zFact);
      Segment radialDend4 = addRelativeDendrite(radialDend, posnNew3);

      radialDend4.getSection().addToGroup(dendSynGroup);
      Point3f posnNew4 = new Point3f(0, 25, 0);
      Segment radialDend5 = addRelativeDendrite(radialDend4, posnNew4);

      radialDend5.getSection().addToGroup(dendSynGroup);
    }
  }