questions > Running dcm2nii from command line
Showing 1-5 of 5 posts
Display:
Results per page:
May 26, 2017  03:05 PM | Federico Moro - Istituto di ricerche farmacologiche Mario Negri
Running dcm2nii from command line
Hi all,

I have downloaded mricron for mac and I am able to use dcm2nii gui but if I try to run it from the command line it always returns me "invalid option".
Can someone help me to solve this please?
May 26, 2017  05:05 PM | Anderson Napolitano - The University of New Mexico
RE: Running dcm2nii from command line
Hi Dr. Moro,

What is the command that you are running to get this output? Try running dcm2niix with a -h flag (i.e. path/to/dcm2niix -h). If that does not work, check for permissions. If you don't have execute permission on dcm2niix, try running chmod +x /path/to/dcm2niix.

Hopefully that helps.

-Anderson
May 26, 2017  07:05 PM | Chris Rorden
RE: Running dcm2nii from command line
Can you provide the exact error you are getting. If the error is "-bash: dcm2nii: command not found" then you want to make sure that you put the executable is in your path. Alternatively, you provide the path to the executable in the command line, e.g. 
  /Users/rorden/exe/dcm2nii /Users/rorden/DICOM
In general if you run my software without any parameters it will provide examples of how to use the software.

I would suggest you heed the warning generated by dcm2nii and dcm2niigui "upgrade to dcm2niix suggested". dcm2nii is no loger in active development. Whie I hope it is mature and stable, the manufacturers are continually developing their interpretation of the DICOM standard. Unless you are converting data that is >17 years old, I think dcm2niix should be your tool of choice. You can get dcm2niix by downloading MRIcroGL. MRIcroGL includes a graphical interface (Import/ConvertDICOMtoNIfTI). A nice feature of that interface is that it displays an example command line with example output filenames, allowing you to design your command line with the graphical interface.
May 29, 2017  11:05 AM | Federico Moro - Istituto di ricerche farmacologiche Mario Negri
RE: Running dcm2nii from command line
I have installed MRIcroGL but I still have the same problem.
From the gui interface I get this:
"/Users/Federico/MRIcroGL/MRIcro.app/Contents/Resources/dcm2niix" -b n -z n -f "M" "MyDicomFOlder"

When I try to call it from the terminal I get 
-bash: dcm2niix: command not found.

I try to access the MRIcronGL directory but I get 
-bash: cd: /Users/Federico/MRIcroGL/: No such file or directory
May 29, 2017  12:05 PM | Chris Rorden
RE: Running dcm2nii from command line
It sounds like your problem is not with my software, but with your operating system. I would suggest you search the internet for "Gatekeeper Path Randomization" and "App Translocation". I do not have this feature on my Macs, so I can not trouble shoot this for you. I suspect you should be able to search for "dcm2niix" with the finder  - that should provide you the full path to dcm2niix which you can either run from the command line or copy the executable to your path. Feel free to share your solution with the forum.