def main(): workDir = sys.argv[1] with open(workDir + 'Input_Args.txt', 'r') as inputFile: lines = inputFile.readlines() if len(lines) == 4: fileName1 = lines[0].strip('\n') fileName2 = lines[1].strip('\n') myROI = eval(lines[2]) upsamplingFactor = eval(lines[3]) rawStack1, rawStack2, sumImg1, sumImg2, diffImg, sx, sy = calc_DIFF_images( fileName1, fileName2, myROI, upsamplingFactor) elif len(lines) == 5: fileName1 = lines[0].strip('\n') fileName2 = lines[1].strip('\n') fileNameNorm = lines[2].strip('\n') myROI = eval(lines[3]) upsamplingFactor = eval(lines[4]) rawStack1, rawStack2, sumImg1, sumImg2, diffImg, sx, sy = calc_DIFF_images( fileName1, fileName2, fileNameNorm, myROI, upsamplingFactor) fileNameRoot1 = fileName1[fileName1.rfind('/'):].strip('/') fileNameRoot2 = fileName2[fileName2.rfind('/'):].strip('/') skimage.io.imsave(workDir + fileNameRoot1 + '_RAW_stack1.tif', rawStack1) skimage.io.imsave(workDir + fileNameRoot2 + '_RAW_stack2.tif', rawStack2) skimage.io.imsave(workDir + fileNameRoot1 + '_CORR1.tif', np.array(sumImg1)) skimage.io.imsave(workDir + fileNameRoot2 + '_CORR2.tif', np.array(sumImg2)) skimage.io.imsave(workDir + fileNameRoot1 + '_DIFF.tif', np.array(diffImg)) xpeemreg.saveShifts(workDir, fileName1, sx, sy)
def main(): workDir = sys.argv[1] with open(workDir + "Input_Args.txt", "r") as inputFile: lines = inputFile.readlines() if len(lines) == 4: fileName1 = lines[0].strip("\n") fileName2 = lines[1].strip("\n") myROI = eval(lines[2]) upsamplingFactor = eval(lines[3]) rawStack1, rawStack2, sumImg1, sumImg2, diffImg, sx, sy = calc_DIFF_images( fileName1, fileName2, myROI, upsamplingFactor ) elif len(lines) == 5: fileName1 = lines[0].strip("\n") fileName2 = lines[1].strip("\n") fileNameNorm = lines[2].strip("\n") myROI = eval(lines[3]) upsamplingFactor = eval(lines[4]) rawStack1, rawStack2, sumImg1, sumImg2, diffImg, sx, sy = calc_DIFF_images( fileName1, fileName2, fileNameNorm, myROI, upsamplingFactor ) fileNameRoot1 = fileName1[fileName1.rfind("/") :].strip("/") fileNameRoot2 = fileName2[fileName2.rfind("/") :].strip("/") skimage.io.imsave(workDir + fileNameRoot1 + "_RAW_stack1.tif", rawStack1) skimage.io.imsave(workDir + fileNameRoot2 + "_RAW_stack2.tif", rawStack2) skimage.io.imsave(workDir + fileNameRoot1 + "_CORR1.tif", np.array(sumImg1)) skimage.io.imsave(workDir + fileNameRoot2 + "_CORR2.tif", np.array(sumImg2)) skimage.io.imsave(workDir + fileNameRoot1 + "_DIFF.tif", np.array(diffImg)) xpeemreg.saveShifts(workDir, fileName1, sx, sy)
def main(): workDir = sys.argv[1] with open(workDir+'Input_Args.txt','r') as inputFile: lines = inputFile.readlines() if len(lines) == 4: fileName1 = lines[0].strip('\n') fileName2 = lines[1].strip('\n') myROI = eval(lines[2]) upsamplingFactor = eval(lines[3]) rawStack1,rawStack2,corrStack1,corrStack2,diffStack,sx,sy = calc_DIFF_spectra(fileName1,fileName2,myROI,upsamplingFactor) elif len(lines) == 5: fileName1 = lines[0].strip('\n') fileName2 = lines[1].strip('\n') fileNameNorm = lines[2].strip('\n') myROI = eval(lines[3]) upsamplingFactor = eval(lines[4]) rawStack1,rawStack2,corrStack1,corrStack2,diffStack,sx,sy = calc_DIFF_spectra(fileName1,fileName2,fileNameNorm,myROI,upsamplingFactor) fileNameRoot1 = fileName1[fileName1.rfind('/'):].strip('/') fileNameRoot2 = fileName2[fileName2.rfind('/'):].strip('/') skimage.io.imsave(workDir+fileNameRoot1+'_RAW_stack1.tif',rawStack1) skimage.io.imsave(workDir+fileNameRoot2+'_RAW_stack2.tif',rawStack2) skimage.io.imsave(workDir+fileNameRoot1+'_CORR1.tif',np.array(corrStack1)) skimage.io.imsave(workDir+fileNameRoot2+'_CORR2.tif',np.array(corrStack2)) skimage.io.imsave(workDir+fileNameRoot1+'_DIFF.tif',np.array(diffStack)) xpeemreg.saveShifts(workDir,fileName1,sx,sy)
def main(): workDir = sys.argv[1] with open(workDir + 'Input_Args.txt', 'r') as inputFile: lines = inputFile.readlines() if len(lines) == 6: fileName1 = lines[0].strip('\n') fileName2 = lines[1].strip('\n') fileName3 = lines[2].strip('\n') fileName4 = lines[3].strip('\n') myROI = eval(lines[4]) upsamplingFactor = eval(lines[5]) rawStack1, rawStack2, rawStack3, rawStack4, sumImg1, sumImg2, sumImg3, sumImg4, diffImg, sx, sy = calc_ABS_NORM_DIFF_images( fileName1, fileName2, fileName3, fileName4, myROI, upsamplingFactor) elif len(lines) == 7: fileName1 = lines[0].strip('\n') fileName2 = lines[1].strip('\n') fileName3 = lines[2].strip('\n') fileName4 = lines[3].strip('\n') fileNameNorm = lines[4].strip('\n') myROI = eval(lines[5]) upsamplingFactor = eval(lines[6]) rawStack1, rawStack2, rawStack3, rawStack4, sumImg1, sumImg2, sumImg3, sumImg4, diffImg, sx, sy = calc_ABS_NORM_DIFF_images( fileName1, fileName2, fileName3, fileName4, fileNameNorm, myROI, upsamplingFactor) fileNameRoot1 = fileName1[fileName1.rfind('/'):].strip('/') fileNameRoot2 = fileName2[fileName2.rfind('/'):].strip('/') fileNameRoot3 = fileName3[fileName3.rfind('/'):].strip('/') fileNameRoot4 = fileName4[fileName4.rfind('/'):].strip('/') skimage.io.imsave(workDir + fileNameRoot1 + '_RAW_stack1.tif', rawStack1) skimage.io.imsave(workDir + fileNameRoot2 + '_RAW_stack2.tif', rawStack2) skimage.io.imsave(workDir + fileNameRoot3 + '_RAW_stack3.tif', rawStack3) skimage.io.imsave(workDir + fileNameRoot4 + '_RAW_stack4.tif', rawStack4) skimage.io.imsave(workDir + fileNameRoot1 + '_CORR1.tif', np.array(sumImg1)) skimage.io.imsave(workDir + fileNameRoot2 + '_CORR2.tif', np.array(sumImg2)) skimage.io.imsave(workDir + fileNameRoot3 + '_CORR3.tif', np.array(sumImg3)) skimage.io.imsave(workDir + fileNameRoot4 + '_CORR4.tif', np.array(sumImg4)) skimage.io.imsave(workDir + fileNameRoot1 + '_DIFF.tif', np.array(diffImg)) xpeemreg.saveShifts(workDir, fileName1, sx, sy)
def main(): workDir = sys.argv[1] with open(workDir+'Input_Args.txt','r') as inputFile: lines = inputFile.readlines() if len(lines) == 3: fileName = lines[0].strip('\n') myROI = eval(lines[1]) upsamplingFactor = eval(lines[2]) rawStack,corrStack,sx,sy = calc_single_spectrum(fileName,myROI,upsamplingFactor) elif len(lines) == 4: fileName = lines[0].strip('\n') fileNameNorm = lines[1].strip('\n') myROI = eval(lines[2]) upsamplingFactor = eval(lines[3]) rawStack,corrStack,sx,sy = calc_single_spectrum(fileName,fileNameNorm,myROI,upsamplingFactor) fileNameRoot = fileName[fileName.rfind('/'):].strip('/') #xpeemreg.apply_Mask(rawStack) #xpeemreg.apply_Mask(corrStack) skimage.io.imsave(workDir+fileNameRoot+'_RAW.tif',rawStack) skimage.io.imsave(workDir+fileNameRoot+'_CORR1.tif',np.array(corrStack)) xpeemreg.saveShifts(workDir,fileName,sx,sy)
def main(): workDir = sys.argv[1] with open(workDir+'Input_Args.txt','r') as inputFile: lines = inputFile.readlines() if len(lines) == 6: fileName1 = lines[0].strip('\n') fileName2 = lines[1].strip('\n') fileName3 = lines[2].strip('\n') fileName4 = lines[3].strip('\n') myROI = eval(lines[4]) upsamplingFactor = eval(lines[5]) rawStack1,rawStack2,rawStack3,rawStack4,sumImg1,sumImg2,sumImg3,sumImg4,diffImg,sx,sy = calc_ABS_NORM_DIFF_images(fileName1,fileName2,fileName3,fileName4,myROI,upsamplingFactor) elif len(lines) == 7: fileName1 = lines[0].strip('\n') fileName2 = lines[1].strip('\n') fileName3 = lines[2].strip('\n') fileName4 = lines[3].strip('\n') fileNameNorm = lines[4].strip('\n') myROI = eval(lines[5]) upsamplingFactor = eval(lines[6]) rawStack1,rawStack2,rawStack3,rawStack4,sumImg1,sumImg2,sumImg3,sumImg4,diffImg,sx,sy = calc_ABS_NORM_DIFF_images(fileName1,fileName2,fileName3,fileName4,fileNameNorm,myROI,upsamplingFactor) fileNameRoot1 = fileName1[fileName1.rfind('/'):].strip('/') fileNameRoot2 = fileName2[fileName2.rfind('/'):].strip('/') fileNameRoot3 = fileName3[fileName3.rfind('/'):].strip('/') fileNameRoot4 = fileName4[fileName4.rfind('/'):].strip('/') skimage.io.imsave(workDir+fileNameRoot1+'_RAW_stack1.tif',rawStack1) skimage.io.imsave(workDir+fileNameRoot2+'_RAW_stack2.tif',rawStack2) skimage.io.imsave(workDir+fileNameRoot3+'_RAW_stack3.tif',rawStack3) skimage.io.imsave(workDir+fileNameRoot4+'_RAW_stack4.tif',rawStack4) skimage.io.imsave(workDir+fileNameRoot1+'_CORR1.tif',np.array(sumImg1)) skimage.io.imsave(workDir+fileNameRoot2+'_CORR2.tif',np.array(sumImg2)) skimage.io.imsave(workDir+fileNameRoot3+'_CORR3.tif',np.array(sumImg3)) skimage.io.imsave(workDir+fileNameRoot4+'_CORR4.tif',np.array(sumImg4)) skimage.io.imsave(workDir+fileNameRoot1+'_DIFF.tif',np.array(diffImg)) xpeemreg.saveShifts(workDir,fileName1,sx,sy)