예제 #1
0
  public static void main(String[] args) {
    // 1) Prepare the environment :
    // 		get a reference to the extracelular matrix (ECM)
    ECM ecm = ECM.getInstance();
    // 		add additional PhysicalNodes (for diffusion)
    int nbOfAdditionalNodes = 100;
    for (int i = 0; i < nbOfAdditionalNodes; i++) {
      double[] coord = randomNoise(500, 3);
      ecm.getPhysicalNodeInstance(coord);
    }

    // 2) Create some artificial chemical gradients
    // 		horizontal gaussian (peak concentration, peak coordinate, variance)
    ecm.addArtificialGaussianConcentrationZ(new Substance("A", Color.red), 1, 300, 100);
    ecm.addArtificialGaussianConcentrationZ(new Substance("B", Color.blue), 1, 00, 100);
    ecm.addArtificialGaussianConcentrationZ(new Substance("C", Color.green), 1, -300, 100);
    //		horizontal linerar gradient
    ecm.addArtificialLinearConcentrationZ(new Substance("D", Color.cyan), 1, 300, -300);
    //		vertical gaussian
    ecm.addArtificialGaussianConcentrationX(new Substance("E", Color.red), 1, 0, 100);
    ecm.addArtificialGaussianConcentrationX(new Substance("F", Color.green), 1, 300, 100);

    // 3) Create a 4-uple Cell-SomaElement-PhysicalSphere-SpaceNode at the desired location
    double[] cellLocation = new double[] {0, 0, 0};
    Cell cell = CellFactory.getCellInstance(cellLocation);
    cell.setColorForAllPhysicalObjects(Param.RED);

    // 4) Extend an axon from the cell
    NeuriteElement neurite = cell.getSomaElement().extendNewNeurite(new double[] {0, 0, 1});
    neurite.getPhysical().setDiameter(1.0);
    neurite.getPhysicalCylinder().setDiameter(3);
    // 5) Put a movementReceptor
    X_Movement_Module r = new X_Movement_Module();
    r.linearDiameterDecrease = 0.01;
    r.addAttractant("A");

    neurite.addLocalBiologyModule(r);

    // 6) Simulate
    Scheduler.simulate();
  }
예제 #2
0
 public X_Movement_Module getCopy() {
   X_Movement_Module r = new X_Movement_Module();
   r.attractants = (Vector<String>) this.attractants.clone();
   r.repellents = (Vector<String>) this.repellents.clone();
   r.randomness = this.randomness;
   r.movementDirection = this.movementDirection.clone();
   r.directionWeight = this.directionWeight;
   r.copiedWhenNeuriteBranches = this.copiedWhenNeuriteBranches;
   r.minimalBranchDiameter = this.minimalBranchDiameter;
   r.cantLeave = this.cantLeave;
   r.maxConcentration = this.maxConcentration;
   r.linearDiameterDecrease = this.linearDiameterDecrease;
   return r;
 }
예제 #3
0
파일: Figure_9.java 프로젝트: wrmsr/cx3d
  public static void main(String[] args) {
    Param.NEURITE_MAX_LENGTH = 20;
    double pi = Math.PI;
    // get a 2.5D ECM
    ECM ecm = ECM.getInstance();
    ECM.setRandomSeed(5L);
    ecm.setArtificialWallsForCylinders(true);
    ecm.setArtificialWallsForSpheres(true);
    ecm.setBoundaries(-10000, 10000, -10000, 10000, -5, 5);

    // eighteen extra PhysicalNodes :
    for (int i = 0; i < 12; i++) {
      double[] loc = concat(randomNoise(600, 2), randomNoise(100, 1));
      ecm.getPhysicalNodeInstance(loc);
    }

    // set the inter object force
    X_Adhesive_Force nogo = new X_Adhesive_Force();
    nogo.setAttractionRange(3);
    nogo.setAttractionStrength(5);

    PhysicalObject.setInterObjectForce(nogo);

    // generate cells
    int nbOfCells = 20;
    int minNbOfNeurites = 4;
    int maxNbOfNeurites = 8;

    for (int i = 0; i < nbOfCells; i++) {

      Color c = Param.X_SOLID_GRAY;

      double[] cellLocation =
          new double[] {
            -200 + ECM.getRandomDouble() * 400,
            -200 + ECM.getRandomDouble() * 400,
            -5 + ECM.getRandomDouble() * 10
          };

      if (i == 0) {
        c = Param.X_SOLID_RED;
        cellLocation = new double[] {0, 0, 0};
      }

      Cell cell = CellFactory.getCellInstance(cellLocation);
      SomaElement soma = cell.getSomaElement();
      PhysicalSphere sphere = soma.getPhysicalSphere();
      if (i == 0) {
        cell.setNeuroMLType(Cell.InhibitoryCell);
      } else {
        cell.setNeuroMLType(Cell.ExcitatoryCell);
      }
      sphere.setColor(c);
      sphere.setAdherence(100);

      int nbOfNeurites =
          minNbOfNeurites + ((int) ((maxNbOfNeurites - minNbOfNeurites) * ECM.getRandomDouble()));

      for (int j = 0; j < nbOfNeurites; j++) {
        double angleOfAxon = pi * 2 * ECM.getRandomDouble();
        double growthSpeed = 75;
        double probaToBranch = 0.003;
        double linearDiameterDecrease = 0.001;
        NeuriteElement ne;
        if (j == 0) {
          ne = cell.getSomaElement().extendNewNeurite(3.0, Math.PI * 0.5, angleOfAxon);
          ne.setIsAnAxon(true);
          growthSpeed = 150;
          probaToBranch = 0.009;
          linearDiameterDecrease = 0;
          ne.getPhysicalCylinder().setDiameter(1.5);
        } else if (j == 1) {
          ne =
              cell.getSomaElement()
                  .extendNewNeurite(
                      3.0, Math.PI * 0.5, angleOfAxon + Math.PI - 0.5 + ECM.getRandomDouble());
          ne.setIsAnAxon(false);
        } else {
          ne =
              cell.getSomaElement()
                  .extendNewNeurite(3.0, Math.PI * 0.5, Math.PI * 2 * ECM.getRandomDouble());
          ne.setIsAnAxon(false);
        }

        X_Bifurcation_Module br = new X_Bifurcation_Module();
        br.shift = probaToBranch;
        ne.addLocalBiologyModule(br);
        X_Movement_Module mr = new X_Movement_Module();
        mr.setRandomness(0.7);
        mr.setSpeed(growthSpeed);
        mr.setLinearDiameterDecrease(linearDiameterDecrease);
        ne.addLocalBiologyModule(mr);
      }
    }

    for (int i = 0; i < 350; i++) { // 350
      Scheduler.simulateOneStep();
    }

    TestSynapses.extendExcressencesAndSynapseOnEveryNeuriteElement(0.4);
    Exporter.saveExport();
  }