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


Java FloatProcessor.fill方法代码示例

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


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

示例1: imposeMinima

import ij.process.FloatProcessor; //导入方法依赖的package包/类
public static void imposeMinima(final FloatProcessor fp, final Roi roi) {
		final ImageProcessor fpOrig = fp.duplicate();

//		ImageStatistics stats = fp.getStatistics();
		
		fp.setValue(Float.NEGATIVE_INFINITY);
		fp.fill(roi);
		ROILabeling.fillOutside(fp, roi, Float.POSITIVE_INFINITY);

		fpOrig.copyBits(fp, 0, 0, Blitter.MIN);

		fpOrig.multiply(-1);
		fp.multiply(-1);
		morphologicalReconstruction(fp, fpOrig);
		fp.multiply(-1);
	}
 
开发者ID:qupath,项目名称:qupath,代码行数:17,代码来源:MorphologicalReconstruction.java

示例2: imposeMaxima

import ij.process.FloatProcessor; //导入方法依赖的package包/类
public static void imposeMaxima(FloatProcessor fp, Roi roi) {
	final ImageProcessor fpOrig = fp.duplicate();
	final ImageStatistics stats = fp.getStatistics();
	
	fp.setValue(Float.POSITIVE_INFINITY);
	fp.fill(roi);
	ROILabeling.fillOutside(fp, roi, Float.NEGATIVE_INFINITY);

	fpOrig.copyBits(fp, 0, 0, Blitter.MAX);

	morphologicalReconstruction(fp, fpOrig);
	
	fp.setValue(stats.max);
	fp.fill(roi);
}
 
开发者ID:qupath,项目名称:qupath,代码行数:16,代码来源:MorphologicalReconstruction.java

示例3: workOnSlice

import ij.process.FloatProcessor; //导入方法依赖的package包/类
@Override
public void workOnSlice(int sliceNumber) {
	Trajectory geom = Configuration.getGlobalConfiguration().getGeometry();
	double originIndexX = geom.getOriginInPixelsX();
	double originIndexY = geom.getOriginInPixelsY();
	double originIndexZ = geom.getOriginInPixelsZ();
	double voxelSizeX = geom.getVoxelSpacingX();
	double voxelSizeY = geom.getVoxelSpacingY();
	double voxelSizeZ = geom.getVoxelSpacingZ();
	FloatProcessor slice = new FloatProcessor(geom.getReconDimensionX(), geom.getReconDimensionY());
	if (renderSolid){
		if (renderAttenuation && xrayEnergy > 0)
			slice.setValue(scene.getBackgroundMaterial().getAttenuation(xrayEnergy,attType));
		else
			slice.setValue(scene.getBackgroundMaterial().getDensity());
		slice.fill();
	}

	AbstractRayTracer tracer = new Priority1DRayTracer();
	tracer.setScene(scene);

	if (showVertices) {
		Iterator<VectorPoint3D> iterator = voxelList.get(sliceNumber);
		while(iterator.hasNext()){
			VectorPoint3D voxel = iterator.next();
			slice.putPixelValue((int)voxel.getX(), (int)voxel.getY(), voxel.getVector().getElement(0));
		}
	}

	double z  = (sliceNumber - originIndexZ) * voxelSizeZ;
	double xFirst = (-originIndexX) * voxelSizeX;
	double xLast = (slice.getWidth()-originIndexX) * voxelSizeX;
	if (renderSolid) {
		//long basetimeSlice = System.currentTimeMillis();
		for (int i = 0; i < slice.getHeight(); i ++){
			double y  = (i - originIndexY) * voxelSizeY;
			PointND pointLeft = new PointND(xFirst, y, z);
			PointND pointRight = new PointND(xLast, y, z);
			//long basetime = System.currentTimeMillis();
			StraightLine line = new StraightLine(pointLeft, pointRight);
			line.normalize();
			//System.out.println(line.getDirection());
			ArrayList<PhysicalObject> segments = tracer.castRay(line);
			//long castTime = System.currentTimeMillis() - basetime;
			//basetime = System.currentTimeMillis();
			if (segments != null) {
				for (PhysicalObject o: segments){
					Edge lineSegment = (Edge) o.getShape(); 
					PointND p1 = lineSegment.getPoint();
					PointND p2 = lineSegment.getEnd();
					int ix1 = (int) Math.round((p1.get(0) / voxelSizeX) + originIndexX);
					int ix2 = (int) Math.round((p2.get(0) / voxelSizeX) + originIndexX);
					int iy = (int) Math.round((y / voxelSizeY) + originIndexY);
					if (renderAttenuation && xrayEnergy > 0)
						slice.setValue(o.getMaterial().getAttenuation(xrayEnergy, attType)*o.getMaterial().getDensity());
					else
						slice.setValue(o.getMaterial().getDensity());
					slice.drawLine(ix1, iy, ix2, iy);
				}
				//long renderTime = System.currentTimeMillis() - basetime;
				//if (sliceNumber == 50) System.out.println("Cast time " + castTime + " render time " + renderTime + " " + segments.size());
			}

		}
		//long slicetime = System.currentTimeMillis() - basetimeSlice;
		//if (sliceNumber == 123) System.out.println("Slice time: " + slicetime);

	}
	if (showRaster) {
		for (double splineNum = 0; splineNum < list.size(); splineNum++) {
			for  (PointND p: hullPoints){
				if (Math.round(((p.get(2) / voxelSizeZ) + originIndexZ)) == sliceNumber){
					slice.putPixelValue((int)((p.get(0) / voxelSizeX) + originIndexX), (int)((p.get(1) / voxelSizeY) + originIndexY), splineNum+1);
				}
			}
		}
	}
	Grid2D grid = new Grid2D((float[]) slice.getPixels(), slice.getWidth(), slice.getHeight());
	imageBuffer.add(grid, sliceNumber);
}
 
开发者ID:akmaier,项目名称:CONRAD,代码行数:81,代码来源:SurfaceBSplineVolumePhantom.java


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