本文整理汇总了Python中ij.ImagePlus.getStack方法的典型用法代码示例。如果您正苦于以下问题:Python ImagePlus.getStack方法的具体用法?Python ImagePlus.getStack怎么用?Python ImagePlus.getStack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.ImagePlus
的用法示例。
在下文中一共展示了ImagePlus.getStack方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: readCSV
# 需要导入模块: from ij import ImagePlus [as 别名]
# 或者: from ij.ImagePlus import getStack [as 别名]
newfilename = os.path.join(os.path.splitext(filename)[0], '_plotStack.tif')
out.setTitle(os.path.basename(filename)+'_OutStack.tif')
PLOT_ONLY_IN_FRAME1 = False
data = readCSV(filepath)
calib = imp.getCalibration()
xscale = calib.pixelWidth
yscale = calib.pixelHeight
zscale = calib.pixelDepth
cred = Color(255, 0, 0)
cblue = Color(0, 0, 255)
xoffset = imp.getWidth()
yoffset = imp.getHeight()
for d in data:
frame = int(d[1])
if frame < out.getStack().getSize():
x1 = int(round(float(d[2]) / xscale))
y1 = int(round(float(d[3]) / yscale))
z1 = int(round(float(d[4]) / zscale))
x2 = int(round(float(d[5]) / xscale))
y2 = int(round(float(d[6]) / yscale))
z2 = int(round(float(d[7]) / zscale))
direction = float(d[8])
if PLOT_ONLY_IN_FRAME1:
ip = out.getStack().getProcessor(1)
else:
ip = out.getStack().getProcessor(frame+1)
if direction <= 0:
ip.setColor(Color(255, 100, 100))
else:
ip.setColor(Color(100, 100, 255))
示例2: range
# 需要导入模块: from ij import ImagePlus [as 别名]
# 或者: from ij.ImagePlus import getStack [as 别名]
yoffset = imp.getHeight()
#ip = out.getStack().getProcessor(1)
for i in range(len(data)-1):
if i < 1:
continue
# if i > 20:
# break
frame = float(data.get(i)[2])
nextframe = float(data.get(i+1)[2])
if nextframe - frame < 1:
print str(i), 'trackend'
else:
frame = int(frame)
print str(frame+1), '...plotting'
ip = out.getStack().getProcessor(frame + 1)
x1 = int(round(float(data.get(i)[6]) / xscale))
y1 = int(round(float(data.get(i)[7]) / xscale))
z1 = int(round(float(data.get(i)[8]) / xscale))
x2 = int(round(float(data.get(i+1)[6]) / xscale))
y2 = int(round(float(data.get(i+1)[7]) / xscale))
z2 = int(round(float(data.get(i+1)[8]) / xscale))
ip.setLineWidth(1)
ip.setColor(Color(255, 100, 100))
ip.drawLine(x1, y1, x2, y2)
ip.drawLine(x1, yoffset+ z1, x2, yoffset+z2)
ip.drawLine(xoffset+z1, y1, xoffset+z2, y2)
#for d in data:
# frame = int(d[1])
示例3: readCSV
# 需要导入模块: from ij import ImagePlus [as 别名]
# 或者: from ij.ImagePlus import getStack [as 别名]
# load data from file
filename = os.path.basename(filepath)
newfilepath = os.path.splitext(filepath)[0] + '_plot.tif'
PLOT_ONLY_IN_FRAME1 = False
data = readCSV(filepath)
calib = imp.getCalibration()
xscale = calib.pixelWidth
yscale = calib.pixelHeight
zscale = calib.pixelDepth
cred = Color(255, 0, 0)
cblue = Color(0, 0, 255)
xoffset = imp.getWidth()
yoffset = imp.getHeight()
ip = out.getStack().getProcessor(1)
for d in data:
frame = int(d[1])
x1 = int(round(float(d[2]) / xscale))
y1 = int(round(float(d[3]) / yscale))
z1 = int(round(float(d[4]) / xscale**2 * zscale))
x2 = int(round(float(d[5]) / xscale))
y2 = int(round(float(d[6]) / yscale))
z2 = int(round(float(d[7]) / xscale**2 * zscale))
direction = float(d[8])
if direction <= 0:
ip.setColor(Color(255, 100, 100))
else:
ip.setColor(Color(100, 100, 255))
ip.setLineWidth(1)
ip.drawLine(x1, y1, x2, y2)
示例4: StackCells
# 需要导入模块: from ij import ImagePlus [as 别名]
# 或者: from ij.ImagePlus import getStack [as 别名]
#.........这里部分代码省略.........
def __boxaction5(self, event):
self.__fire = event.getSource().isSelected()
#self.__setDisplay(str(event.getSource().text)+" is "+str(event.getSource().isSelected()))
def __boxaction6(self, event):
self.__align = event.getSource().isSelected()
#self.__setDisplay(str(event.getSource().text)+" is "+str(event.getSource().isSelected()))
def __boxaction7(self, event):
self.__enlarge = event.getSource().isSelected()
#self.__setDisplay(str(event.getSource().text)+" is "+str(event.getSource().isSelected()))
def __boxaction8(self, event):
self.__measures = event.getSource().isSelected()
#self.__setDisplay(str(event.getSource().text)+" is "+str(event.getSource().isSelected()))
def __boxaction9(self, event):
self.__alignC = event.getSource().isSelected()
#self.__setDisplay(str(event.getSource().text)+" is "+str(event.getSource().isSelected()))
def __boxaction10(self, event):
self.__conEllipses = event.getSource().isSelected()
def __favg(self) :
zp = ZProjector(self.__impRes)
zp.setMethod(ZProjector.AVG_METHOD)
zp.doProjection()
imp = zp.getProjection()
imp.show()
if self.__fire : IJ.run(imp, "Fire", "")
def __fmosa(self) :
mm = MontageMaker()
imp = mm.makeMontage2(self.__impRes, 1, self.__impRes.getStackSize(), 1, 1, self.__impRes.getStackSize(), 1, 0, False)
imp.setTitle("MONTAGE"+self.__name)
imp.show()
if self.__fire : IJ.run(imp, "Fire", "")
def __fmaxfinder(self) :
#stack = self.__impRes.getStack()
self.__impD.killRoi()
self.__impF.killRoi()
stack = self.__impF.getStack()
n_slices = stack.getSize()
#newstack=ImageStack(self.__impRes.getWidth(), self.__impRes.getHeight())
newstack=ImageStack(self.__impF.getWidth(), self.__impF.getHeight())
noise = self.__display3.text
for index in range(1,n_slices+1):
IJ.selectWindow(self.__impF.getTitle())
self.__impF.setSlice(index)
ip = self.__impF.getProcessor()
mf=MaximumFinder()
ipmax = mf.findMaxima(ip, int(noise), 0, 0, False, False)
newstack.addSlice("", ipmax)
newimage=ImagePlus("max points"+self.__name, newstack)
newimage.show()
newimage.updateAndDraw()
listip = []
maxh=self.__impRes.getHeight()
for roi in self.__cellsrois :
straightener = Straightener()
newimage.setSlice(roi[1])
示例5: StackStatistics
# 需要导入模块: from ij import ImagePlus [as 别名]
# 或者: from ij.ImagePlus import getStack [as 别名]
IJ.run(InputImg, "Multiply...", "value=2 stack");
# End of Anscombe transform
elapsed_time = time.time() - start_time
print "Elapsed time:", elapsed_time
Stats = StackStatistics(medianFilteredImage)
print "mean:", Stats.mean, "minimum:", Stats.min, "maximum:", Stats.max
medianFilteredStack = medianFilteredImage.getStack()
InputStack = InputImg.getStack()
# Get the Input and filtered Images as 1D arrays
medfiltArray = array.array('f')
InputImgArray = array.array('f')
for i in xrange(1 , z + 1):
ip = medianFilteredStack.getProcessor(i).convertToFloat()
ip2 = InputStack.getProcessor(i).convertToFloat()
pixels = ip.getPixels()
pixels2 = ip2.getPixels()
medfiltArray.extend(pixels)
InputImgArray.extend(pixels2)
示例6: ImagePlus
# 需要导入模块: from ij import ImagePlus [as 别名]
# 或者: from ij.ImagePlus import getStack [as 别名]
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('/')
with open( gitCommitInfoFile, 'w' ) as f:
f.write( '%s\n' % utility.gitcommit.getCommit( thickness_estimation_repo_dir ) )