• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ZProjector类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中ij.plugin.ZProjector的典型用法代码示例。如果您正苦于以下问题:Java ZProjector类的具体用法?Java ZProjector怎么用?Java ZProjector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: showConvolvedImages

import ij.plugin.ZProjector; //导入依赖的package包/类
/**
 * Debugging method to show the results of convolution
 * 
 * @param convolved
 */
@SuppressWarnings("unused")
private void showConvolvedImages(HashMap<Integer, FloatProcessor> convolved)
{
	ImageProcessor ip = convolved.get(0);
	ImageStack stack = new ImageStack(ip.getWidth(), ip.getHeight());
	for (int rotation : rotationAngles)
		stack.addSlice("Rotation " + rotation, convolved.get(rotation));

	ImagePlus imp = new ImagePlus("Membrane filter", stack);
	imp.show();

	// Output different projections of the results
	ZProjector projector = new ZProjector(imp);
	for (int projectionMethod = 0; projectionMethod < ZProjector.METHODS.length; projectionMethod++)
	{
		IJ.showStatus("Projecting " + ZProjector.METHODS[projectionMethod]);
		projector.setMethod(projectionMethod);
		projector.doProjection();
		ImagePlus projImp = projector.getProjection();
		projImp.show();
	}
}
 
开发者ID:aherbert,项目名称:GDSC,代码行数:28,代码来源:Cell_Outliner.java


示例2: extractHeights

import ij.plugin.ZProjector; //导入依赖的package包/类
private TimeValuedPoint[] extractHeights(ImagePlus imp, Coordinate[] actualPoints, int channel, int frame)
{
	// Use maximum intensity projection
	ImageProcessor ip = Utils.extractTile(imp, frame, channel, ZProjector.MAX_METHOD);
	//new ImagePlus("height", ip).show(); 

	// Store ID as the time
	TimeValuedPoint[] newPoints = new TimeValuedPoint[actualPoints.length];
	for (int i = 0; i < newPoints.length; i++)
	{
		int x = (int) Math.round(actualPoints[i].getX() / scaleX);
		int y = (int) Math.round(actualPoints[i].getY() / scaleY);
		int value = ip.get(x, y);
		newPoints[i] = new TimeValuedPoint(actualPoints[i].getX(), actualPoints[i].getY(), actualPoints[i].getZ(),
				i + 1, value);
	}

	return newPoints;
}
 
开发者ID:aherbert,项目名称:GDSC,代码行数:20,代码来源:MatchPlugin.java


示例3: getBackgroundLevel

import ij.plugin.ZProjector; //导入依赖的package包/类
private float getBackgroundLevel(AssignedPoint[] points)
{
	// Get a maximum intensity project of the image
	ZProjector projector = new ZProjector(imp);
	projector.setMethod(ZProjector.MAX_METHOD);
	projector.doProjection();

	ImageProcessor ip = projector.getProjection().getProcessor();

	// Set background using the lowest currently picked point
	float background = Float.POSITIVE_INFINITY;
	for (AssignedPoint point : points)
	{
		final float v = ip.getf(point.getXint(), point.getYint());
		if (background > v)
			background = v;
	}

	// Subtract the image Std.Dev. to get a buffer for error.
	ImageStatistics stats = ip.getStatistics();
	background -= stats.stdDev;

	return background;
}
 
开发者ID:aherbert,项目名称:GDSC,代码行数:25,代码来源:PointAlignerPlugin.java


示例4: average2Dcorr

import ij.plugin.ZProjector; //导入依赖的package包/类
/**
 *  Wrapper calculating average 2D spatial correlation with specified delay in frames 
 */
ImageProcessor average2Dcorr(int nDelay, int nStackSize)
{
	ImageProcessor finalip, ip1,ip2;
	ImageStack crosscorrstack;
	int i,j;
	
	i=1; j=i+nDelay;
	crosscorrstack = new ImageStack(nCorrW,nCorrW);
	
	while(j<=nStackSize)
    {
		imp.setSliceWithoutUpdate(i);
    	ip1 = getFloatversion(imp);
    	imp.setSliceWithoutUpdate(j);
    	ip2 = getFloatversion(imp);

		//subtract average intensity value
    	//in general, something else can be here, like background value
		ip1.subtract(ImageStatistics.getStatistics(ip1,Measurements.MEAN,null).mean);
		ip2.subtract(ImageStatistics.getStatistics(ip2,Measurements.MEAN,null).mean);
				 
			
		if(nCalcMethod==0)
			{finalip = x2D.calcDirectCorrelationImage(ip1,ip2);}
		else
			{finalip = x2D.calcFFTCorrelationImage(ip1, ip2);}
				
		crosscorrstack.addSlice(null, finalip);
		i++; j++;
    }
	//do average projection
	Zproj.setImage(new ImagePlus("", crosscorrstack));
	Zproj.setMethod(ZProjector.AVG_METHOD);
	Zproj.doProjection();
	finalip=Zproj.getProjection().getProcessor();
	
	return finalip;
	
}
 
开发者ID:ekatrukha,项目名称:Correlescence,代码行数:43,代码来源:Corr2DSTICS.java


示例5: getSkeletonizedProjection

import ij.plugin.ZProjector; //导入依赖的package包/类
/**
 * Retrieves a MIP of skeletonized paths.
 *
 * @throws RuntimeException
 *             if called before successfully loading a file
 * @return a MIP projection of an untagged skeleton (8-bit binary image)
 */
public ImageProcessor getSkeletonizedProjection() {
	final ImagePlus imp = renderPathsAsSkeleton(false);
	final ZProjector zp = new ZProjector(imp);
	zp.setMethod(ZProjector.MAX_METHOD);
	zp.setStartSlice(1);
	zp.setStopSlice(imp.getNSlices());
	zp.doProjection();
	return zp.getProjection().getProcessor();
}
 
开发者ID:tferr,项目名称:hIPNAT,代码行数:17,代码来源:ImportTracings.java


示例6: runProjection

import ij.plugin.ZProjector; //导入依赖的package包/类
public void runProjection(int methodProj){
    IJ.showProgress((progressbar));
    ZProjector zproject = new ZProjector();
    zproject.setImage(rawImage.duplicate());
    zproject.setMethod(methodProj);
    zproject.doProjection();
    projImage = zproject.getProjection();
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:9,代码来源:SME_Plugin_Get_Manifold.java


示例7: getProjection

import ij.plugin.ZProjector; //导入依赖的package包/类
private ImageProcessor getProjection()
{
	// Get median intensity projection
	ZProjector p = new ZProjector(imp);
	p.setMethod(ZProjector.MEDIAN_METHOD);
	p.doProjection();
	ImageProcessor median = p.getProjection().getProcessor();
	return median;
}
 
开发者ID:aherbert,项目名称:GDSC-SMLM,代码行数:10,代码来源:ImageBackground.java


示例8: runDetection

import ij.plugin.ZProjector; //导入依赖的package包/类
@Override
		public Collection<PathObject> runDetection(final ImageData<BufferedImage> imageData, ParameterList params, ROI pathROI) {
					
			double fullCoreDiameterPx;
			ImageServer<BufferedImage> server = imageData.getServer();
			if (server.hasPixelSizeMicrons())
				fullCoreDiameterPx = params.getDoubleParameterValue("coreDiameterMM") / server.getAveragedPixelSizeMicrons() * 1000;
			else
				fullCoreDiameterPx = params.getDoubleParameterValue("coreDiameterPixels");

			String horizontalLabels = params.getStringParameterValue("labelsHorizontal").trim();
			String verticalLabels = params.getStringParameterValue("labelsVertical").trim();
			
			boolean horizontalLabelFirst = params.getChoiceParameterValue("labelOrder").toString().startsWith("Column");
			// TODO: Consider fluorescence mode in TMA dearraying
			boolean isFluorescence = imageData.isFluorescence();
		
			double densityThreshold = params.getIntParameterValue("densityThreshold") * 0.01;
			double roiScaleFactor = params.getIntParameterValue("boundsScale") * 0.01;
			logger.trace("ROI scale: " + roiScaleFactor);
		

			double maxDimLength = Math.max(server.getWidth(), server.getHeight());
			double dimRequested = 1200;
			double downsample = Math.pow(2, Math.round(Math.log(maxDimLength / dimRequested)/Math.log(2)));
			
//			// Compute alternative downsample factor based on requested pixel size
//			// This is likely to be a bit more reproducible - so use it instead
//			if (server.hasPixelSizeMicrons()) {
//				double preferredCoreDiameterPixels = 60;
//				double downsample2 = Math.round(fullCoreDiameterPx / preferredCoreDiameterPixels);
//				if (downsample2 > 1 && (maxDimLength / downsample2 < dimRequested*2)) {
//					downsample = downsample2;
//				}
//			}

			// Compute alternative downsample factor based on requested pixel size
			// This is likely to be a bit more reproducible - so use it instead
			if (server.hasPixelSizeMicrons()) {
				double preferredPixelSizeMicrons = 25;
				double downsample2 = Math.round(preferredPixelSizeMicrons / server.getAveragedPixelSizeMicrons());
				if (downsample2 > 1 && (maxDimLength / downsample2 < dimRequested*2))
					downsample = downsample2;
			}

			// Read the image
			PathImage<ImagePlus> pathImage = PathImagePlus.createPathImage(server, downsample);
			ImagePlus imp = pathImage.getImage();

			if (imp.getType() == ImagePlus.COLOR_RGB || imp.getNChannels() == 1)
				ip = imp.getProcessor();
			else {
				ZProjector zProjector = new ZProjector(imp);
				zProjector.setMethod(ZProjector.AVG_METHOD);
				zProjector.doProjection();
				ip = zProjector.getProjection().getProcessor();
			}
			bp = null;
				
			String[] hLabelsSplit = PathObjectTools.parseTMALabelString(horizontalLabels);
			String[] vLabelsSplit = PathObjectTools.parseTMALabelString(verticalLabels);

			updateGrid(tmaGrid, downsample);
			tmaGrid = doDearraying(fullCoreDiameterPx, downsample, densityThreshold, roiScaleFactor, isFluorescence, hLabelsSplit, vLabelsSplit, horizontalLabelFirst);
			
			return tmaGrid == null ? null : new ArrayList<>(tmaGrid.getTMACoreList());
		}
 
开发者ID:qupath,项目名称:qupath,代码行数:68,代码来源:TMADearrayerPluginIJ.java


示例9: showDialog

import ij.plugin.ZProjector; //导入依赖的package包/类
private boolean showDialog(String[] imageList, boolean selfAlignMode)
{
	GenericDialog gd = new GenericDialog(TITLE);

	if (selfAlignMode)
	{
		if (WindowManager.getCurrentImage() != null)
			reference = WindowManager.getCurrentImage().getTitle();
		selfAlign = true;
		//projectionMethod = ZProjector.MAX_METHOD;
		//myWindowFunction = 3; // Tukey
		//restrictTranslation = true; // Translation is restricted to image half-max anyway
		//minXShift = minYShift = -20;
		//maxXShift = maxYShift = 20;
		interpolationMethod = ImageProcessor.NONE;
		clipOutput = false;
	}

	String msg = (selfAlignMode) ? "Align all frames to the current frame."
			: "Align all open stacks with the same XYC dimensions as the reference.";
	msg += "\nZ stacks per time frame are projected and multiple channels\nare tiled to a single image used to define the offset for\nthe frame.\n";
	if (!selfAlignMode)
		msg += "Optionally align a single stack to the currect frame";
	gd.addMessage(msg);

	gd.addChoice("Reference_image", imageList, reference);
	if (!selfAlignMode)
		gd.addCheckbox("Self-align", selfAlign);
	gd.addChoice("Projection", ZProjector.METHODS, ZProjector.METHODS[projectionMethod]);
	gd.addChoice("Window_function", Align_Images_FFT.windowFunctions,
			Align_Images_FFT.windowFunctions[myWindowFunction]);
	gd.addCheckbox("Restrict_translation", restrictTranslation);
	gd.addNumericField("Min_X_translation", minXShift, 0);
	gd.addNumericField("Max_X_translation", maxXShift, 0);
	gd.addNumericField("Min_Y_translation", minYShift, 0);
	gd.addNumericField("Max_Y_translation", maxYShift, 0);
	gd.addChoice("Sub-pixel_method", subPixelMethods, subPixelMethods[subPixelMethod]);
	gd.addChoice("Interpolation", methods, methods[interpolationMethod]);
	gd.addCheckbox("Clip_output", clipOutput);
	gd.addHelp(gdsc.help.URL.UTILITY);

	gd.showDialog();

	if (!gd.wasOKed())
		return false;

	reference = gd.getNextChoice();
	if (!selfAlignMode)
		selfAlign = gd.getNextBoolean();
	projectionMethod = gd.getNextChoiceIndex();
	myWindowFunction = gd.getNextChoiceIndex();
	restrictTranslation = gd.getNextBoolean();
	minXShift = (int) gd.getNextNumber();
	maxXShift = (int) gd.getNextNumber();
	minYShift = (int) gd.getNextNumber();
	maxYShift = (int) gd.getNextNumber();
	subPixelMethod = gd.getNextChoiceIndex();
	interpolationMethod = gd.getNextChoiceIndex();
	clipOutput = gd.getNextBoolean();

	return true;
}
 
开发者ID:aherbert,项目名称:GDSC,代码行数:63,代码来源:Align_Stacks.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SchemaRequest类代码示例发布时间:2022-05-23
下一篇:
Java KettleSecurityException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap