Guest User

Untitled

a guest
May 22nd, 2019
70
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from nipype.interfaces.dcm2nii import Dcm2niix
  2. from tempfile import mkdtemp
  3. import sys
  4.  
  5.  
  6. def main():
  7. dcmpath = sys.argv[-1]
  8. outdir = mkdtemp()
  9.  
  10. # interface
  11. x = Dcm2niix()
  12. x.inputs.source_dir = dcmpath
  13. x.inputs.bids_format = True
  14. x.inputs.output_dir = outdir
  15.  
  16. print(outdir)
  17. res = x.run()
  18.  
  19. import pdb; pdb.set_trace()
  20.  
  21. if __name__ == "__main__":
  22. if len(sys.argv) != 2:
  23. print("Provide DICOM directory path")
  24. sys.exit(1)
  25. main()
RAW Paste Data