本文整理汇总了Python中dax.XnatUtils.executable_exists方法的典型用法代码示例。如果您正苦于以下问题:Python XnatUtils.executable_exists方法的具体用法?Python XnatUtils.executable_exists怎么用?Python XnatUtils.executable_exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dax.XnatUtils
的用法示例。
在下文中一共展示了XnatUtils.executable_exists方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from dax import XnatUtils [as 别名]
# 或者: from dax.XnatUtils import executable_exists [as 别名]
def main():
""" Main function."""
if ENV_SOURCE is not None and ENV_SOURCE != 'None' \
and os.path.isfile(ENV_SOURCE):
os.system('sh {}'.format(ENV_SOURCE))
_working_dir = None
if WORKING_DIR != 'None':
_working_dir = os.path.join(WORKING_DIR, '${assessor_label}')
if not os.path.exists(_working_dir):
os.makedirs(_working_dir)
if os.path.exists(NIFTYPIPE_EXE) or \
XnatUtils.executable_exists(NIFTYPIPE_EXE):
if OPENMP_CORE is not None and OPENMP_CORE != 'None':
_omp = OMP.format(number_core=OPENMP_CORE)
if _working_dir is not None:
_wd = WDIR.format(working_dir=_working_dir)
cmd = EXE_CMD.format(exe=NIFTYPIPE_EXE,
input=IN_FILE,
output=JOB_DIR,
db_xml=DB_TEMPLATE,
omp=_omp, wdir=_wd)
os.system(cmd)
make_pdf()
else:
raise Exception("Error: %s not found" % (NIFTYPIPE_EXE))
示例2: main
# 需要导入模块: from dax import XnatUtils [as 别名]
# 或者: from dax.XnatUtils import executable_exists [as 别名]
def main():
""" Main function."""
assr_handler = XnatUtils.AssessorHandler(ASSESSOR)
session = assr_handler.get_session_label()
moda = 'T1 FLAIR'
if T2_FILE:
moda = 'T1 FLAIR T2'
_working_dir = None
if WORKING_DIR != 'None':
_working_dir = os.path.join(WORKING_DIR, ASSESSOR)
if not os.path.exists(_working_dir):
os.makedirs(_working_dir)
if XnatUtils.executable_exists(NIFTYPIPE_EXE):
_omp = ''
_wd = ''
_t2 = ''
if OPENMP_CORE is not None and OPENMP_CORE != 'None':
_omp = OMP.format(number_core=OPENMP_CORE)
if _working_dir is not None:
_wd = WDIR.format(working_dir=_working_dir)
if T2_FILE is not None and T2_FILE != 'None':
_t2 = T2.format(working_dir=T2_FILE)
cmd = EXE_CMD.format(
exe=NIFTYPIPE_EXE, modalities=moda, t2=_t2, omp=_omp, wdir=_wd)
os.system(cmd)
# PDF
make_pdf(session)
else:
raise Exception("Error: executable %s not found" % (NIFTYPIPE_EXE))
示例3: main
# 需要导入模块: from dax import XnatUtils [as 别名]
# 或者: from dax.XnatUtils import executable_exists [as 别名]
def main():
""" Main function."""
if ENV_SOURCE is not None and os.path.isfile(ENV_SOURCE):
os.system('sh {}'.format(ENV_SOURCE))
_working_dir = None
if WORKING_DIR != 'None':
_working_dir = os.path.join(WORKING_DIR, '${assessor_label}')
if not os.path.exists(_working_dir):
os.makedirs(_working_dir)
if XnatUtils.executable_exists(NIFTYPIPE_EXE):
_omp = ''
_wd = ''
if OPENMP_CORE is not None and OPENMP_CORE != 'None':
_omp = OMP.format(number_core=OPENMP_CORE)
if _working_dir is not None:
_wd = WDIR.format(working_dir=_working_dir)
cmd = EXE_CMD.format(
dwis=' '.join(DWIS.split(',')),
bvals=' '.join(BVALS.split(',')),
bvecs=' '.join(BVECS.split(',')),
omp=_omp, wdir=_wd)
os.system(cmd)
make_pdf()
else:
raise Exception("Error: executable %s not found" % (NIFTYPIPE_EXE))
示例4: main
# 需要导入模块: from dax import XnatUtils [as 别名]
# 或者: from dax.XnatUtils import executable_exists [as 别名]
def main():
""" Main function."""
_working_dir = None
if WORKING_DIR != 'None':
_working_dir = os.path.join(WORKING_DIR, '${assessor_label}')
if not os.path.exists(_working_dir):
os.makedirs(_working_dir)
if XnatUtils.executable_exists(NIFTYPIPE_EXE):
_omp = ''
_wd = ''
if OPENMP_CORE is not None and OPENMP_CORE != 'None':
_omp = OMP.format(number_core=OPENMP_CORE)
if _working_dir is not None:
_wd = WDIR.format(working_dir=_working_dir)
cmd = EXE_CMD.format(exe_path=NIFTYPIPE_EXE,
gad=GAD_FILE,
mprage=MPRAGE_FILE,
labels=LABELS_FILE,
brain=BRAIN_FILE,
output=JOB_DIR,
omp=_omp,
wdir=_wd)
os.system(cmd)
rename_outputs()
make_pdf()
else:
raise Exception("Error: executable %s not found" % (NIFTYPIPE_EXE))
示例5: main
# 需要导入模块: from dax import XnatUtils [as 别名]
# 或者: from dax.XnatUtils import executable_exists [as 别名]
def main():
""" Main function."""
_working_dir = None
if WORKING_DIR != 'None':
_working_dir = os.path.join(WORKING_DIR, '${assessor_label}')
if not os.path.exists(_working_dir):
os.makedirs(_working_dir)
if XnatUtils.executable_exists(NIFTYPIPE_EXE):
_omp = '' if OPENMP_CORE == 'None' \
else OMP.format(number_core=OPENMP_CORE)
_wd = '' if _working_dir is not None \
else '--working_dir {0}'.format(_working_dir)
_min = '' if MIN == 'None' else '--min {0}'.format(MIN)
_max = '' if MAX == 'None' else '--max {0}'.format(MAX)
cmd = EXE_CMD.format(exe_path=NIFTYPIPE_EXE,
vessels=" ".join(VESSELS_FILES.split(',')),
output=JOB_DIR,
omp=_omp,
wdir=_wd,
min=_min,
max=_max,
ct='--ct' if CT == '1' else '')
os.system(cmd)
make_pdf()
else:
raise Exception("Error: executable %s not found" % (NIFTYPIPE_EXE))