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


Python FileSaver.saveAsJpeg方法代码示例

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


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

示例1: SaveToZip

# 需要导入模块: from ij.io import FileSaver [as 别名]
# 或者: from ij.io.FileSaver import saveAsJpeg [as 别名]
def SaveToZip(zf, ip, baseDir, counter):
	fs = FileSaver(ip)
	fs.setJpegQuality(75)
	fs.saveAsJpeg(baseDir + "/tmp.jpeg")
	zipName = str(counter) + ".jpeg"
	zf.write(baseDir + "/tmp.jpeg", arcname=zipName)
	os.remove(baseDir + "/tmp.jpeg")
开发者ID:bluk44,项目名称:schoolboard-image-manager,代码行数:9,代码来源:Prepare_Cover_Maker_Database.py

示例2: process

# 需要导入模块: from ij.io import FileSaver [as 别名]
# 或者: from ij.io.FileSaver import saveAsJpeg [as 别名]
def process(srcDir, dstDir, nameContains, currentDir, fileName, keepDirectories, anneBoleyn, overOut):
    print "Opening", fileName
    saveDir = currentDir.replace(srcDir, dstDir) if keepDirectories else dstDir
    head, tail = os.path.splitext(fileName)
    imps = BF.openImagePlus(os.path.join(currentDir, fileName))
    for imp in imps:
        if not anneBoleyn:
            print "Now showing image..."
            imp.show()
        IJ.run(imp, "Blue", "")
    fs = FileSaver(imp)
    if not os.path.exists(saveDir):
        os.makedirs(saveDir)
    if not overOut:
        if os.path.exists(saveDir + "\\" + head + ".jpg"):
            print "This JPG exists already and will not be overwritten. Moving on..."
    else:
        print "Saving to", os.path.join(saveDir, head + ".jpg")
        fs.saveAsJpeg(os.path.join(saveDir, head + ".jpg"))
    imp.close()
开发者ID:ratclifflab,项目名称:ND2-to-JPG,代码行数:22,代码来源:ND2+to+JPG.py

示例3: splitext

# 需要导入模块: from ij.io import FileSaver [as 别名]
# 或者: from ij.io.FileSaver import saveAsJpeg [as 别名]
  #filelist = os.listdir(filedir)
  for root, directories, filenames in os.walk(filedir):
    print directories
    for filename in filenames:	
      if filename.lower().endswith('.lif'):
        print filedir
        print "..." + filename
        filebase = splitext(filename)[0]
        imps = getImps(os.path.join(filedir, filename))
        printInfo(imps)	
        for (counter, item) in enumerate(imps):
          #outimp = zproj(item)
          outimp = makeComposite(item)
          #outimp.show()
          #outname = filedir + filebase + "/" + "s" + str(counter) + ".tif"
          subname = ijtool.split(item.getTitle(), " - ")[1]
          #outname = filedir + filebase + "/" + subname + "_ZP.tif"
          outdir = os.path.join(filedir, "processed")
          outname = os.path.join(outdir, filebase + "_" + subname + "_" + str(counter) + "_Composite")
          print outname
          if not os.path.isdir(outdir):
            os.mkdir(outdir)
          fs = FileSaver(outimp)
          fs.saveAsTiffStack(outname+".tif")
          fs.saveAsJpeg(outname+".jpg")
          

#outimp = zproject(filepath)
#outimp.show()

开发者ID:tischi,项目名称:scripts,代码行数:31,代码来源:2015-08-07--zproj_LIF_headless.py

示例4: range

# 需要导入模块: from ij.io import FileSaver [as 别名]
# 或者: from ij.io.FileSaver import saveAsJpeg [as 别名]
elif chosenData == 8:
	#sourceFolder = 'I:\\NewDatasets\\Zeiss\\20160426\\red\\partiallyNormalized\\cropped_spim_TL'
	sourceFolder = 'I:\\NewDatasets\\Zeiss\\20160426\\red\\test_cropped_spim_TL'
	outputFolder = 'I:\\SegmentationResults\\MIPsRawData\\20160426\\MIP_small_cropped_t'
	startT = 3
	endT = 23
	appendix = '_Angle1.tif'

for i in range(startT, endT+1):		
	if i < 10:
		digit = '00' + str(i)
	elif i < 100:
		digit = '0' + str(i)
	elif i < 1000:
		digit = str(i)

	imagePath = sourceFolder + digit + appendix
	outputPath = outputFolder + digit + '.jpg'

	# open image file
	print 'Opening image', imagePath
	imp = IJ.openImage( imagePath )

	zp = ZProjector(imp)
	zp.setMethod( ZProjector.MAX_METHOD )
	zp.doProjection()
	MIPimp = zp.getProjection()
	fs = FileSaver( MIPimp )
	fs.saveAsJpeg( outputPath )

print 'Done'
开发者ID:AlexisMaizel,项目名称:Virtual_Lateral_Roots,代码行数:33,代码来源:storeMIPs.py


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