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


Python ImagePlus.getHeight方法代码示例

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


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

示例1: openImp

# 需要导入模块: from ij import ImagePlus [as 别名]
# 或者: from ij.ImagePlus import getHeight [as 别名]
 def openImp(self, path):
    imp = ImagePlus(path)  # open associated tif file
    imp.show()
    imp.getWindow().setLocationAndSize(280, 120, imp.getWidth()*4, imp.getHeight()*4) # int x, int y, int width, int height
    return imp
开发者ID:schiklen,项目名称:BatchMeasurement,代码行数:7,代码来源:04-QualityControl_v8j.py

示例2: NonBlockingGenericDialog

# 需要导入模块: from ij import ImagePlus [as 别名]
# 或者: from ij.ImagePlus import getHeight [as 别名]
			accept_waiter = NonBlockingGenericDialog("Thresholding...")
			accept_waiter.addNumericField("Threshold:",t_line,0)
			accept_waiter.setCancelLabel("Apply new threshold")
			accept_waiter.setOKLabel("Accept threshold")
			accept_waiter.showDialog()
			if (accept_waiter.wasCanceled()):
				newip.reset()
				newip.snapshot()
				t_line = accept_waiter.getNextNumber()
#				if (t_line > 10):
#					t_line = t_line - 5
#				else:
#					t_line = 5
				newip.setThreshold(0,t_line,ImageProcessor.BLACK_AND_WHITE_LUT)
				newImage.updateAndDraw()
			else:
				doSameSlice = False
				for i in range(newImage.getWidth()):
					for j in range(newImage.getHeight()):
						if (newip.getPixel(i,j) > newip.getMaxThreshold()):
							newip.putPixel(i,j,254)
						else:
							newip.putPixel(i,j,0)
				newnewip = newip.duplicate()
				newStack.addSlice(newnewip)
				newImage.close()

	castImage = ImagePlus("cast",newStack)
	castImage.show()
			
开发者ID:stalepig,项目名称:deep-mucosal-imaging,代码行数:31,代码来源:Set_cast_by_threshold.py

示例3: StackCells

# 需要导入模块: from ij import ImagePlus [as 别名]
# 或者: from ij.ImagePlus import getHeight [as 别名]

#.........这里部分代码省略.........
		
		if roi == None : 
			IJ.showMessage("", "No selection")
			return

		if roi.getType() in [6,7] : 		
			nslice = self.__impD.getCurrentSlice()
			self.__impF.setSlice(nslice)
			self.__impF.setRoi(roi)
		elif roi.getType() in [2,4] :
			nslice = self.__impD.getCurrentSlice()
			self.__impF.setSlice(nslice)
			m=Morph(self.__impF, roi)
			m.setMidParams(10, 2)
			roi=m.MidAxis
			if roi == None :
				self.__display.text = "roi fail"
				if not self.__skip : IJ.showMessage("", "failed roi, please draw it as polyline")
				return				

		#if roi.getType() != 6 : self.__impF.setRoi(roi)
		else : 
			IJ.showMessage("", "This selection is not yet allowed")
			return

		self.__impF.setRoi(roi)
		
		straightener = Straightener()
		new_ip = straightener.straighten(self.__impF, roi, int(self.__widthl))
		
		self.__iplist.append(new_ip)
		self.__labels.append(self.__isF.getShortSliceLabel(nslice))
		
		self.__display.text = self.__name + " cell " + str(len(self.__iplist)) +" width="+str(new_ip.getWidth())+ " height="+ str(new_ip.getHeight())
		roi.setPosition(self.__impD.getCurrentSlice())	

		self.__rm = RoiManager.getInstance()
		if (self.__rm==None): self.__rm = RoiManager()
		
		self.__rm.add(self.__impD, roi, len(self.__iplist))
		self.__cellsrois.append((roi, self.__impD.getCurrentSlice()))
		#self.__rm.runCommand("Show All")

		IJ.selectWindow(self.__impD.getTitle()) 
		
		
	def __end(self, event): 
		if len(self.__iplist)==0 : 
			IJ.showMessage("", "Stack is empty")
			return
		self.__ipw=[ ip.getWidth() for ip in self.__iplist ]
		self.__iph=[ ip.getHeight() for ip in self.__iplist ]
		maxw=max(self.__ipw)
		maxh=max(self.__iph)
		if self.__enlarge : 
			resizelist = [ ip.resize(maxw, maxh, True) for ip in self.__iplist ]
			
		else : 
			resizelist = []
			for ip in self.__iplist :
				tempip = ShortProcessor(maxw, maxh)
				tempip.copyBits(ip, 0, 0, Blitter.COPY)
				resizelist.append(tempip)
				
		ims = ImageStack(maxw, maxh) 	
		
开发者ID:leec13,项目名称:MorphoBactDev,代码行数:69,代码来源:Stack_Cells.py

示例4: ImageStack

# 需要导入模块: from ij import ImagePlus [as 别名]
# 或者: from ij.ImagePlus import getHeight [as 别名]
    if doXYScale:
        stack = ImageStack(int(round(imgSource.getWidth()*xyScale)), int(round(imgSource.getHeight()*xyScale)))
        for z in xrange(stackSource.getSize()):
            stack.addSlice(Filter.createDownsampled(
                stackSource.getProcessor(z+1),
    	        xyScale,
    	        0.5,
                0.5))
                
             
        img = ImagePlus("", stack)
    else:
        img = imgSource

    width  = img.getWidth()
    height =  img.getHeight()

    # img.show()
    print img.getWidth(), img.getHeight(), img.getStack().getSize()
    for c in correlationRanges:    
        correlationRange = c
        homeScale = root.rstrip('/') + '/xyScale=%f' % xyScale
        home = homeScale.rstrip('/') + '/range=%d_%s'.rstrip('/')
        home = home % ( correlationRange, str(datetime.datetime.now() ) )
        make_sure_path_exists( home.rstrip('/') + '/' )

        options.comparisonRange = c

        serializationString = '%s/correlations_range=%d.sr' % ( homeScale.rstrip(), correlationRange )

        gitCommitInfoFile = '%s/commitHash' % home.rstrip('/')
开发者ID:hanslovsky,项目名称:em-thickness-estimation,代码行数:33,代码来源:jython_estimate_thickness_locally.py


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