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


Java FloatProcessor.setPixels方法代码示例

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


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

示例1: applyToolToImage

import ij.process.FloatProcessor; //导入方法依赖的package包/类
@Override
public Grid2D applyToolToImage(Grid2D imageProcessor) throws Exception {
	FloatProcessor imp = new FloatProcessor(imageProcessor.getWidth(),imageProcessor.getHeight());
	imp.setPixels(imageProcessor.getBuffer());
	
	ImageProcessor imp1 = imp.duplicate();	// original
	SimpleMatrix mat = config.getGeometry().getProjectionMatrix(imageIndex).computeP();
			
	double [][] KinectDots3D = {{10, 10, 10}, {50, 50, 50}, {-20, -20, -20}}; // [beadNo][x,y,z]		
	double [] uv = new double[1];

	for (int i=0; i< KinectDots3D.length; i++){
		
		if (KinectDots3D[i][0] != 0 || KinectDots3D[i][1] != 0 || KinectDots3D[i][2] != 0){ 
			
			uv = compute2DCoordinates(KinectDots3D[i], mat);
			
			if (isDisplay) {
				imp1.setValue(2);
				imp1.drawLine((int) Math.round(uv[0]-10), (int) Math.round(uv[1]-10), (int) Math.round(uv[0]+10), (int) Math.round(uv[1]+10));
				imp1.drawLine((int) Math.round(uv[0]-10), (int) Math.round(uv[1]+10), (int) Math.round(uv[0]+10), (int) Math.round(uv[1]-10));
			}
			
		}			
	}

	if (isDisplay) {
		for (int x=0; x< config.getGeometry().getDetectorWidth(); x+=100)
			imp1.drawLine(x, 0, x, config.getGeometry().getDetectorHeight());
		for (int y=0; y< config.getGeometry().getDetectorHeight(); y+=100)
			imp1.drawLine(0, y, config.getGeometry().getDetectorWidth(), y);
	}
			
	Grid2D result = new Grid2D((float[]) imp1.getPixels(), imp1.getWidth(), imp1.getHeight());

	return result;
}
 
开发者ID:akmaier,项目名称:CONRAD,代码行数:38,代码来源:KinectBasedDetectorSaturationCorrectionTool.java

示例2: applyToolToImage

import ij.process.FloatProcessor; //导入方法依赖的package包/类
@Override
public Grid2D applyToolToImage(Grid2D imageProcessor) {
	FloatProcessor in = new FloatProcessor(imageProcessor.getWidth(), imageProcessor.getHeight());
	in.setPixels(imageProcessor.getBuffer());
	FloatProcessor left = (FloatProcessor) in.rotateLeft();
	Grid2D out = new Grid2D((float[])left.getPixels(), left.getWidth(), left.getHeight());
	return out;
}
 
开发者ID:akmaier,项目名称:CONRAD,代码行数:9,代码来源:Rotate90DegreeLeftTool.java

示例3: applyToolToImage

import ij.process.FloatProcessor; //导入方法依赖的package包/类
@Override
public Grid2D applyToolToImage(Grid2D image)
throws Exception {
	FloatProcessor imageProcessor = new FloatProcessor(image.getWidth(), image.getHeight());
	imageProcessor.setPixels(image.getBuffer());
	ImageProcessor currentOperand = null;
	if(operand == null){
		open();
	}
	if (operand.getStackSize() > 1) {
		currentOperand =  operand.getStack().getProcessor(imageIndex + 1);
	} else {
		currentOperand = operand.getChannelProcessor();
	}
	ImageProcessor revan = null;
	if (operation.equals(MULTIPLY)) {
		revan = ImageUtil.multiplyImages(imageProcessor, currentOperand);
	}
	if (operation.equals(DIVIDE)) {
		revan = ImageUtil.divideImages(imageProcessor, currentOperand);
	}
	if (operation.equals(SUBTRACT)) {
		currentOperand = currentOperand.duplicate();
		currentOperand.multiply(-1);
		ImageUtil.addProcessors(currentOperand, imageProcessor);
		revan = currentOperand;
	}
	if (operation.equals(ADD)) {
		currentOperand = currentOperand.duplicate();
		ImageUtil.addProcessors(currentOperand, imageProcessor);
		revan = currentOperand;
	}
	Grid2D result = new Grid2D((float[])revan.getPixels(), image.getWidth(), image.getHeight());
	return result;
}
 
开发者ID:akmaier,项目名称:CONRAD,代码行数:36,代码来源:ImageMathFilter.java

示例4: applyToolToImage

import ij.process.FloatProcessor; //导入方法依赖的package包/类
@Override
public Grid2D applyToolToImage(Grid2D imageProcessor) {
	FloatProcessor fl = new FloatProcessor(imageProcessor.getWidth(), imageProcessor.getHeight());
	fl.setPixels(imageProcessor.getBuffer());
	fl.snapshot();
	sharpenFloat(fl, sigma, (float) weight);
	return imageProcessor;
}
 
开发者ID:akmaier,项目名称:CONRAD,代码行数:9,代码来源:DynamicDensityOptimizationScatterCorrectionTool.java

示例5: applyToolToImage

import ij.process.FloatProcessor; //导入方法依赖的package包/类
@Override
public Grid2D applyToolToImage(Grid2D imageProcessor)
throws Exception {
	FloatProcessor revan = new FloatProcessor(imageProcessor.getWidth(), imageProcessor.getHeight());
	revan.setPixels(imageProcessor.getBuffer());
	if (operation.equals(MULTIPLY)) {
		revan.multiply(operand);
	}
	if (operation.equals(DIVIDE)) {
		revan.multiply(1.0 / operand);
	}
	if (operation.equals(SUBTRACT)) {
		revan.add(-operand);
	}
	if (operation.equals(ADD)) {
		revan.add(operand);
	}
	if (operation.equals(LOGARITHM)) {
		revan.log();
	}
	if (operation.equals(SQUARE)) {
		revan.sqr();
	}
	if (operation.equals(SQUAREROOT)) {
		revan.sqrt();
	}
	return imageProcessor;
}
 
开发者ID:akmaier,项目名称:CONRAD,代码行数:29,代码来源:ImageConstantMathFilter.java

示例6: applyToolToImage

import ij.process.FloatProcessor; //导入方法依赖的package包/类
@Override
public Grid2D applyToolToImage(Grid2D imageProcessor) {
	FloatProcessor revan = new FloatProcessor(imageProcessor.getWidth(), imageProcessor.getHeight());
	revan.setPixels(imageProcessor.getBuffer());
	if (!twoD){
		float [] kernel = designKernel(nTimes);
		if (horizontal)
			revan.convolve(kernel, kernel.length, 1);
		else 
			revan.convolve(kernel, 1, kernel.length);
		revan.multiply(0.5/Configuration.getGlobalConfiguration().getGeometry().getPixelDimensionX());
	} else {
		FloatProcessor xDerivative = (FloatProcessor) revan.duplicate();
		xDerivative.convolve(designKernelX(), nTimes, nTimes);
		xDerivative.multiply(0.5/Configuration.getGlobalConfiguration().getGeometry().getPixelDimensionX());
		xDerivative.sqr();
		FloatProcessor yDerivative = (FloatProcessor) revan.duplicate();
		yDerivative.convolve(designKernelY(), nTimes, nTimes);
		yDerivative.sqr();
		yDerivative.multiply(0.5/Configuration.getGlobalConfiguration().getGeometry().getPixelDimensionY());
		ImageUtil.addProcessors(xDerivative, yDerivative);
		xDerivative.sqrt();
		revan = xDerivative;
	}
	Grid2D result = new Grid2D((float[]) revan.getPixels(), revan.getWidth(), revan.getHeight());
	return result;
}
 
开发者ID:akmaier,项目名称:CONRAD,代码行数:28,代码来源:NumericalDerivativeComputationTool.java


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