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


Python ImagePlus.changes方法代码示例

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


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

示例1: print

# 需要导入模块: from ij import ImagePlus [as 别名]
# 或者: from ij.ImagePlus import changes [as 别名]
    ecdOut.append(ecd)
    con = 1.0-(lMode[j]/iZero)
    conOut.append(con)   
    cirOut.append(lCirc[j])
    arOut.append(lAspRat[j])
    rndOut.append(lRound[j])
    solOut.append(lSolid[j])
    
    
  orig.show()
  outPth = sRptImgPath + strName + ".png"
  # burn a scale bar and save the image
  IJ.run(orig, "RGB Color", "")
  IJ.run(orig, "Add Scale Bar", strBar)
  IJ.saveAs(orig, "PNG", outPth)
  orig.changes = False
  orig.close()

  print("%d particles detected in image %s" % (nMeas, strNum))

# prepare the output file
f=open(sRptCsvPath, 'w')
strLine = 'img, part, ecd.nm, contrast, circ, a.r, round, solidity\n'
f.write(strLine)
for k in range(len(ecdOut)):
  strLine = "%d, %d, %.2f, %.4f, %.4f, %.4f, %.4f, %.4f\n" % (imgOut[k], parOut[k], ecdOut[k],  conOut[k], cirOut[k], arOut[k], rndOut[k], solOut[k] )
  f.write(strLine)

f.close()

toc = time.time()
开发者ID:jrminter,项目名称:OSImageAnalysis,代码行数:33,代码来源:anaClumpedAgX.py

示例2: get_red_spots

# 需要导入模块: from ij import ImagePlus [as 别名]
# 或者: from ij.ImagePlus import changes [as 别名]
	
	#image = IJ.getImage()
	#image.close()
	
	[red_spots, red_spots_dapi] = get_red_spots(rest, z_slices, image_dapi)
	
	[green_spots, green_spots_dapi] = get_green_spots(rest, z_slices, image_dapi)
	
	[colocalised, colocalised_dapi] = get_colocalised(rest, z_slices, image_dapi)
	for i in range(z_slices):
		colocalised[i] = float(colocalised[i] /2)
	for i in range(z_slices):
		colocalised_dapi[i] = float(colocalised_dapi[i] /2)
	print("dapi red: ",red_spots_dapi,"dapi green: ", green_spots_dapi, "dapi coloc: ", colocalised_dapi)
	image.close()
	image_green.changes = False
	image_green.close()
	fp = open(directory+"/"+filename+"_summary.csv", "w")
	fp.write("slice, red spots, green spots, colocalised, percentage of red spots colocalising, percentage of green spots colocalising, red spots on DAPI, green spots on DAPI, colocalised on DAPI, percentage of red spots colocalising on DAPI, percentage of green spots colocalising on DAPI\n")
	for i in range(z_slices):
		fp.write(str(i)+","+str(red_spots[i])+","+str(green_spots[i])+","+str(colocalised[i])+","+str(safe_div(colocalised[i],red_spots[i]))+","+str(safe_div(colocalised[i],green_spots[i])))
		fp.write(","+str(red_spots_dapi[i])+","+str(green_spots_dapi[i])+","+str(colocalised_dapi[i])+","+str(safe_div(colocalised_dapi[i],red_spots_dapi[i]))+","+str(safe_div(colocalised_dapi[i],green_spots_dapi[i]))+"\n")
	fp.write("\n\n\n")
	fp.write("total red spots, "+str(sum(red_spots))+"\n")
	fp.write("total green spots, "+str(sum(green_spots))+"\n")
	fp.write("total colocalised, "+str(sum(colocalised))+"\n")
	fp.write("percentage of red spots colocalising, "+str(safe_div(sum(colocalised),sum(red_spots)))+"\n")
	fp.write("percentage of green spots colocalising, "+str(safe_div(sum(colocalised),sum(green_spots)))+"\n\n\n")

	fp.write("total red spots on DAPI, "+str(sum(red_spots_dapi))+"\n")
	fp.write("total green spots on DAPI, "+str(sum(green_spots_dapi))+"\n")
开发者ID:erickmartins,项目名称:ImageJ_Macros,代码行数:33,代码来源:coloc.py


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