发布于2020-10-30 21:44 阅读(79) 评论(0) 点赞(27) 收藏(5)
I am new to python or more specifically ipython. I have been running through the steps to run what should be a very simple Dicom Conversion in a statistical package called SPM for an MRI image file as described by NiPype. I can't get it to run and was wondering what I was doing wrong. I am not getting an error message, instead, there is no file change or output. It just hangs. Does anyone have any idea what I might be doing wrong? It's likely that I am missing something very simple here (sorry :(
import os from pylab import * from glob import glob from nipype.interfaces.matlab import MatlabCommand as mlab mlab.set_default_paths('/home/orkney_01/s1252042/matlab/spm8') from nipype.interfaces.spm.utils import DicomImport as di os.chdir('/sdata/images/projects/ASD_MM/1/datafiles/restingstate_files') filename = "reststate_directories.txt" restingstate_files_list = [line.strip() for line in open(filename)] for x in restingstate_files_list: os.chdir( x ) y = glob('*.dcm') conversion = di(in_files = y)) print(res.outputs)
You are creating a
DicomImport interface, but you are not actually running it. You should have
res = di.run().
Also, you are best to tell the interface where to run using
di.base_dir = '/some/path' before running.
Finally, you may also want to print the contents of
restingstate_files_list to check you are finding the DICOM directories correctly.
任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任
Copyright © 2018-2019 python黑洞网 All Rights Reserved 版权所有，并保留所有权利。 京ICP备18063182号-1