当前位置: 首页>>代码示例>>Java>>正文


Java HistogramDataset.indexOf方法代码示例

本文整理汇总了Java中org.jfree.data.statistics.HistogramDataset.indexOf方法的典型用法代码示例。如果您正苦于以下问题:Java HistogramDataset.indexOf方法的具体用法?Java HistogramDataset.indexOf怎么用?Java HistogramDataset.indexOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.data.statistics.HistogramDataset的用法示例。


在下文中一共展示了HistogramDataset.indexOf方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createCellFluorescencesHistogramDataset

import org.jfree.data.statistics.HistogramDataset; //导入方法依赖的package包/类
/**
* Creates the {@link HistogramDataset} that backs this fluorescence
* intensity distribution chart.
* 
* Values are filter according to some rules (exclude 0.0 values and ignore
* nonexistent fluorescence intensities).
* 
* @param cells
*            a list of {@link Cell}s from which the fluorescence
*            intensities are obtained
* @param channel
*            the identifier of the fluorescence channel
* @return a {@link HistogramDataset} that can be used to create a
*         {@link JFreeChart}
*/
  private HistogramDataset createCellFluorescencesHistogramDataset(Collection<Cell> cells, String channel) {
  	logger.debug(String.format("Constructing fluorescence distribution for %s", channel));
  	final HistogramDataset dataset = new HistogramDataset();
          
  	Collection<Double> values = new LinkedList<Double>();
	for(Cell cell : cells) {
          Double fluorescenceValue = cell.getFluorescences().get(channel);
		
          if (fluorescenceValue == null) {
          	fluorescenceValue = Cell.noFluorescence;
          }
          
          values.add(fluorescenceValue);
      }
       
	double[] datasetValues = ArrayUtils.toPrimitive(values.toArray(new Double[values.size()]));
	
       // TODO remove hard coded zero filter (but non fluorescence data is zero at the moment)
       // filter zeros
       datasetValues = ComparableFilter.filter(datasetValues, 0.0);
       // filter no set fluorescences
       datasetValues = ComparableFilter.filter(datasetValues, Cell.noFluorescence);
       
       if(values.size() > 0) {
      	String seriesKey = "Whole Population";
      	int binNumber = (int) Math.floor(Math.sqrt(datasetValues.length)); // #bins = sqrt(N)
      	dataset.addSeries(seriesKey, datasetValues, binNumber);
       	
       	Comparable seriesIndex = dataset.indexOf(seriesKey); 
       	Collection<Double> datasetValuesList = new ArrayList<Double>(Arrays.asList(ArrayUtils.toObject(datasetValues)));        	
  	 	getData().put(seriesIndex, datasetValuesList);
       }
       
       return dataset;
  }
 
开发者ID:modsim,项目名称:vizardous,代码行数:51,代码来源:CellFluorescenceDistributionChart2D.java

示例2: createCellAreaHistogramDataset

import org.jfree.data.statistics.HistogramDataset; //导入方法依赖的package包/类
/**
* TODO Documentation
* 
* @param cells
* @return
*/
  private HistogramDataset createCellAreaHistogramDataset(Collection<Cell> cells) {
      final HistogramDataset dataset = new HistogramDataset();
      
      Collection<Double> values = new LinkedList<Double>();
	for(Cell cell : cells) {
          Double areaValue = cell.getArea();
		
          if (areaValue == null) {
          	areaValue = Cell.noArea;
          }
          
          values.add(areaValue);
      }
      
	double[] datasetValues = ArrayUtils.toPrimitive(values.toArray(new Double[values.size()]));
	
      // Filter values
	datasetValues = ComparableFilter.filter(datasetValues, Cell.noArea);
      
      if(values.size() > 0) {
      	String seriesKey = "Whole Population";
      	int binNumber = (int) Math.floor(Math.sqrt(datasetValues.length)); // #bins = sqrt(N)
      	dataset.addSeries(seriesKey, datasetValues, binNumber);
      	
      	Comparable seriesIndex = dataset.indexOf(seriesKey); 
      	Collection<Double> datasetValuesList = new ArrayList<Double>(Arrays.asList(ArrayUtils.toObject(datasetValues)));        	
     	 	getData().put(seriesIndex, datasetValuesList);
      }
      
      return dataset;
  }
 
开发者ID:modsim,项目名称:vizardous,代码行数:38,代码来源:CellAreaDistributionChart2D.java

示例3: createCellLengthHistogramDataset

import org.jfree.data.statistics.HistogramDataset; //导入方法依赖的package包/类
/**
  * TODO Documentation
  * 
  * @param cells
  * @return
  */
 private HistogramDataset createCellLengthHistogramDataset(Collection<Cell> cells) {
     final HistogramDataset dataset = new HistogramDataset();
     
     Collection<Double> values = new LinkedList<Double>();
for(Cell cell : cells) {
         Double lengthValue = cell.getLength();
	
         if (lengthValue == null) {
         	lengthValue = Cell.noLength;
         }
         
         values.add(lengthValue);
     }
     
double[] datasetValues = ArrayUtils.toPrimitive(values.toArray(new Double[values.size()]));

     // Filter data
datasetValues = ComparableFilter.filter(datasetValues, Cell.noLength);
     
     if(values.size() > 0) {
     	String seriesKey = "Whole Population";
     	int binNumber = (int) Math.floor(Math.sqrt(datasetValues.length)); // #bins = sqrt(N)
     	dataset.addSeries(seriesKey, datasetValues, binNumber);
     	
     	Comparable seriesIndex = dataset.indexOf(seriesKey); 
     	Collection<Double> datasetValuesList = new ArrayList<Double>(Arrays.asList(ArrayUtils.toObject(datasetValues)));        	
    	 	getData().put(seriesIndex, datasetValuesList);
     }
         
     return dataset;
 }
 
开发者ID:modsim,项目名称:vizardous,代码行数:38,代码来源:CellLengthDistributionChart2D.java


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