Examples of DoubleArray


Examples of image.processing.patterns.cluster.DoubleArray

        }
        // add the value to the current vector
        vector[i] = value;
      }
      // add the vector to the list of vectors
      vectors.add(new DoubleArray(vector, vectorCount));
                        vectorCount++;
    }
    // close the file
    reader.close();
               
    // Create a list of clusters
    clusters = new ArrayList<Cluster>();
   
    // Get the size of vectors
    int vectorsSize = vectors.get(0).data.length;
               
    // SPECIAL CASE: If only one vector
    if (vectors.size() == 1) {
      // Create a single cluster and return it
      DoubleArray vector = vectors.get(0);
      Cluster cluster = new Cluster(vectorsSize);
      cluster.addVector(vector);
      clusters.add(cluster);
      return clusters;
    }
   
    // (1) Randomly generate k empty clusters with a random mean (cluster
    // center)
    for(int i=0; i< k; i++){
      DoubleArray meanVector = generateRandomVector(minValue, maxValue, vectorsSize);
      Cluster cluster = new Cluster(vectorsSize);
      cluster.setMean(meanVector);
      clusters.add(cluster);
    }
View Full Code Here

Examples of image.processing.patterns.cluster.DoubleArray

    // for each position generate a random number
    for(int i=0; i < vectorsSize; i++){
      vector[i] = (random.nextDouble() * (maxValue - minValue)) + minValue;
    }
    // return the vector
    return new DoubleArray(vector, 0);
  }
View Full Code Here

Examples of image.processing.patterns.cluster.DoubleArray

//        System.out.println("val");
      }
      // create a DoubleArray object with the vector
                        System.out.println("Image Number: " + vectorCount);
                        System.out.println(line);
      DoubleArray theVector = new DoubleArray(vector, vectorCount);
                        vectorCount++;
     
      // Initiallly we create a cluster for each vector
      Cluster cluster = new Cluster(vector.length);
      cluster.addVector(theVector);
      cluster.setMean(theVector.clone());
      clusters.add(cluster);
    }
    reader.close(); // close the input file

    // (2) Loop to combine the two closest clusters into a bigger cluster
View Full Code Here

Examples of image.processing.patterns.cluster.DoubleArray

        }
        // add the value to the current vector
        vector[i] = value;
      }
      // add the vector to the list of vectors
      vectors.add(new DoubleArray(vector, vectorCount));
                        vectorCount++;
    }
    // close the file
    reader.close();
               
    // Create a list of clusters
    clusters = new ArrayList<Cluster>();
   
    // Get the size of vectors
    int vectorsSize = vectors.get(0).data.length;
    System.out.println("Vector size: " + vectors.size());
    // SPECIAL CASE: If only one vector
    if (vectors.size() == 1) {
      // Create a single cluster and return it
      DoubleArray vector = vectors.get(0);
      Cluster cluster = new Cluster(vectorsSize);
      cluster.addVector(vector);
      clusters.add(cluster);
      return clusters;
    }
   
    // (1) Randomly generate k empty clusters with a random mean (cluster
    // center)
    for(int i=0; i< k; i++){
                        int rand = 0 + (int)(Math.random() * vectors.size()-1);
      DoubleArray meanVector = vectors.get(rand);
      Cluster cluster = new Cluster(vectorsSize);
      cluster.setMean(meanVector);
      clusters.add(cluster);
    }

View Full Code Here

Examples of image.processing.patterns.cluster.DoubleArray

    // for each position generate a random number
    for(int i=0; i < vectorsSize; i++){
      vector[i] = (random.nextDouble() * (maxValue - minValue)) + minValue;
    }
    // return the vector
    return new DoubleArray(vector, 0);
  }
View Full Code Here

Examples of net.imglib2.img.basictypeaccess.array.DoubleArray

      return ( ArrayImgAWTScreenImage ) container;
    }

    if ( DoubleType.class.isAssignableFrom( type.getClass() ) )
    {
      final DoubleArray array = new DoubleArray( numElements( dims ) );
      final ArrayImgAWTScreenImage< DoubleType, DoubleArray > container = new DoubleAWTScreenImage( new DoubleType( array ), array, dims );
      container.setLinkedType( new DoubleType( container ) );
      return ( ArrayImgAWTScreenImage ) container;
    }
View Full Code Here

Examples of net.imglib2.img.basictypeaccess.array.DoubleArray

  }

  @Override
  public CellImg< T, DoubleArray, DefaultCell< DoubleArray > > createDoubleInstance( final long[] dimensions, final Fraction entitiesPerPixel )
  {
    return createInstance( new DoubleArray( 1 ), dimensions, entitiesPerPixel );
  }
View Full Code Here

Examples of net.imglib2.img.basictypeaccess.array.DoubleArray

  }

  @Override
  public NativeImg< T, DoubleArray > createDoubleInstance( final long[] dimensions, final Fraction entitiesPerPixel )
  {
    return new PlanarImg< T, DoubleArray >( new DoubleArray( 1 ), dimensions, entitiesPerPixel );
  }
View Full Code Here

Examples of net.imglib2.img.basictypeaccess.array.DoubleArray

  // this is the constructor if you want it to be a variable
  public ComplexDoubleType( final double r, final double i )
  {
    img = null;
    dataAccess = new DoubleArray( 2 );
    set( r, i );
  }
View Full Code Here

Examples of net.imglib2.img.basictypeaccess.array.DoubleArray

  // this is the constructor if you want it to be a variable
  public DoubleType( final double value )
  {
    img = null;
    dataAccess = new DoubleArray( 1 );
    set( value );
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.