outDir = homDir + relOut
outPth = outDir + "/" + outNamFull

if bTestPaths == True:
  # print the directories and try loading the ROI image
  print(inDir)
  strImg = inDir + "/ROI.png"
  imp = IJ.openImage(strImg)
  if imp == None:
    print("Error loading ROI.png")
  else:
    if bHeadless != True:
      imp.show()
  print(outPth)
else:
  jmg.ensureDir(outDir)
  impMontFull = jmg.makeMontage(lName, nCol, nRow, inDir, lCal=lCal, sca=1.0, lCr=None, bDebug=False, bHeadless=bHeadless)
  if bScale:
    newW = round(scaFac * impMontFull.getWidth())
    newH = round(scaFac * impMontFull.getHeight())
    newN = sampID + "-" + mapID
    # strSca = "x=%g y=%g width=%d height=%d interpolation=Bicubic average create title=%s" % (scaFac, scaFac, newW, newH, newN)
    impOut = jmg.scaleImg(impMontFull, scaFac)

    #  IJ.run(impMontFull, "Scale...", strSca )
    impMontFull.changes=False
    impMontFull.close()
    # impOut = IJ.getImage()
  else:
    impOut = impMontFull
  inImg = impOut 
コード例 #2
0
sampID  = "qm-03965-KJL-027"
nmPerPx = 1.213
minCirc = 0.5
minSize = 1.0e1
maxSize = 1.0e6

barW    =    100  # bar width, nm
barH    =      6  # bar height, pts
barF    =     28  # bar font, pts
barC    = "Black" # bar color

strBar = "width=%g height=%g font=%g color=%s location=[Lower Right] bold" % (barW, barH, barF, barC)

sImgPath = imgDir + relImg + "/" + sampID + "/dm3/"
sRptPath = rptDir + "/" + sampID + "/"
jmg.ensureDir(sRptPath)
sRptCsvPath = sRptPath + sampID + ".csv"
sRptImgPath = sRptPath + "png/"
jmg.ensureDir(sRptImgPath)

# create empty output vectors for results
imgOut = []
parOut = []
ecdOut = []
conOut = []
cirOut = []
rndOut = []
solOut = []
arOut  = []

query = sImgPath + "*.dm3"
コード例 #3
0
import jmFijiGen as jmg

tic = time.time()

sFac = 0.0
barW = 5						# bar width, microns
barH = 6						# bar height, pts
barF = 24						# bar font, pts
barC = "White"			# bar color
barL= "Lower Right"	# bar location

dc = DirectoryChooser("Choose directory")
basePath = dc.getDirectory()

sPngPath = basePath + os.sep + "png" + os.sep
jmg.ensureDir(sPngPath)


names = []

for file in os.listdir(basePath):
	if file.endswith(".tif"):
		name = os.path.splitext(file)[0]
		names.append(name)

names.sort()

sSat = "saturated=%.2f" % sFac
strBar = "width=%g height=%g font=%g color=%s location=[%s] bold" % (barW, barH, barF, barC, barL)

for name in names:
コード例 #4
0
from ij import IJ
from ij import ImagePlus
import jmFijiGen as jmg

tic = time.time()

imgRt  = os.environ['IMG_ROOT']
relPrj = "/Kateeva-15-01"
labId  = "qm-04309"
smpId  = "R31"



sDm3Path = imgRt + relPrj + "/" + labId + "-" + smpId + "/dm3/"
sTifPath = imgRt + relPrj + "/" + labId + "-" + smpId + "/tif/"
jmg.ensureDir(sTifPath)

query = sDm3Path + "*.dm3"
print(query)
lFiles = glob.glob(query)
i = 0
for fi in lFiles:
  i += 1
  orig = ImagePlus(fi)
  strName = os.path.basename(fi)
  strName = strName.split('.')[0]
  lStr =  strName.split('-')
  l = len(lStr)
  strNum = lStr[l-1]
  iNum = int(strNum)
  orig.setTitle(strNum)
コード例 #5
0
Prefs.set("Last.Image.Dir", basePath)

names = []
for file in os.listdir(basePath):
	if file.endswith(".tif"):
		name = os.path.splitext(file)[0]
		names.append(name)

names.sort()

# basePath = '/Users/jrminter/dat/images/test/qm-04570-1421DJD-04-C03/'
iniPath = basePath + os.sep + 'ImageMetadata.ini'
os.chdir(basePath)
mu = IJ.micronSymbol
calibDir = basePath + "calib" + os.sep
jmg.ensureDir(calibDir)
config = ConfigParser.RawConfigParser()
config.read(iniPath)

for name in names:
	path = basePath + os.sep + name + ".tif"
	print(name, path)
	fMag     = config.getfloat(name, "Mag")
	fScaleX  = config.getfloat(name, "ScaleX")
	fScaleY  = config.getfloat(name, "ScaleY")
	sUnits   = config.get(name, "Units")
	if (bConvertNmToUm == True):
		if(sUnits == "nm"):
			fScaleX /= 1000.
			fScaleY /= 1000.
			sUnits =  mu + "m"