Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dcm2niix can't find pigz.exe in Windows #650

Closed
marcelzwiers opened this issue Nov 18, 2022 · 9 comments
Closed

dcm2niix can't find pigz.exe in Windows #650

marcelzwiers opened this issue Nov 18, 2022 · 9 comments

Comments

@marcelzwiers
Copy link

Describe the bug

Pigz.exe is on the windows path but dcm2niix can't find it

To reproduce

Steps to reproduce the behavior:

  1. Open a windows command shell
  2. Run:
C:\Users\Marcel>set "PATH=%PATH%;C:\Program Files\MRIcroGL\Resources"
C:\Users\Marcel>dcm2niix -v
  1. Output:
C:\Users\Marcel>dcm2niix -v
Compression will be faster with pigz.exe in the same folder as the executable
Chris Rorden's dcm2niiX version v1.0.20220720  (JP2:OpenJPEG) (JP-LS:CharLS) MSC1900  (64-bit Windows)
v1.0.20220720

The pigz executable, however, is present in the same folder:

C:\Users\Marcel>dir C:\"Program Files"\MRIcroGL\Resources\*.exe
Directory of C:\Program Files\MRIcroGL\Resources

18/11/2022  13:06         3,014,656 bet2.exe
18/11/2022  13:06           943,104 dcm2niix.exe
18/11/2022  13:06           328,704 pigz.exe
               3 File(s)      4,286,464 bytes

Expected behavior

I don't expect that pigz warning message

Version

v1.0.20220720 (see also above)

@neurolabusc
Copy link
Collaborator

Acknowledged. With the Windows operating system pigz.exe must be in the current working directory to be detected. This will be fixed in a future release.

neurolabusc added a commit that referenced this issue Nov 20, 2022
Find pigz.exe if not in current working directory for Windows [issue 650](#650)
@neurolabusc
Copy link
Collaborator

@marcelzwiers can you test that the latest development build (v1.0.20221120) fixes your issue? Compiling on Windows is a bit tricky, so you can download the pre-compiled executable by going to the AppVeyor web page and clicking on the Artifacts button.

@marcelzwiers
Copy link
Author

Still the same (I unzipped the AppVeypor files in the Resources folder) :-(

C:\Users\Marcel>set "PATH=%PATH%;C:\Program Files\MRIcroGL\Resources"

C:\Users\Marcel>dcm2niix -v
Compression will be faster with C:\Users\Marcel\pigz.exe in the same folder as the executable
Chris Rorden's dcm2niiX version v1.0.20221120  (JP2:OpenJPEG) (JP-LS:CharLS) MSC1900  (64-bit Windows)
v1.0.20221120

@neurolabusc
Copy link
Collaborator

Unable to replicate. It appears that the copy of dcm2niix in the path C:\Users\Marcel\dcm2niix is taking precedence over the copy in ';C:\Program Files\MRIcroGL\Resources\dcm2niix'. You could either explicitly run the latter or copy pigz to the folder C\Users\Marcel

@marcelzwiers
Copy link
Author

marcelzwiers commented Nov 21, 2022

Mhhh, I don't think it did?

C:\Users\Marcel>dcm2niix -v
'dcm2niix' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Marcel>set "PATH=%PATH%;C:\Program Files\MRIcroGL\Resources"

C:\Users\Marcel>dcm2niix -v
Compression will be faster with C:\Users\Marcel\pigz.exe in the same folder as the executable
Chris Rorden's dcm2niiX version v1.0.20221120  (JP2:OpenJPEG) (JP-LS:CharLS) MSC1900  (64-bit Windows)
v1.0.20221120

C:\Users\Marcel>where dcm2niix
C:\Program Files\MRIcroGL\Resources\dcm2niix.exe

C:\Users\Marcel>where pigz
C:\Program Files\MRIcroGL\Resources\pigz.exe

@neurolabusc
Copy link
Collaborator

Did you try providing the working directory with your call?

"C:\Program Files\MRIcroGL\Resources\dcm2niix.exe"

@marcelzwiers
Copy link
Author

That works!

C:\Users\Marcel>C:\"Program Files"\MRIcroGL\Resources\dcm2niix -v
Chris Rorden's dcm2niiX version v1.0.20221120  (JP2:OpenJPEG) (JP-LS:CharLS) MSC1900  (64-bit Windows)
v1.0.20221120

neurolabusc added a commit that referenced this issue Nov 21, 2022
@neurolabusc
Copy link
Collaborator

Why don't you try the latest commit (v1.0.20221122). I try to use the GetModuleFileName function if pigz is not in the current working directory and the location of dcm2niix can not be determined from the first argument. I did not test for MinGW compilation, so we might need to wrap the new code in a #ifdef _MSC_VER conditional.

@marcelzwiers
Copy link
Author

Yes, it all works now :-)

C:\Users\Marcel>C:\"Program Files"\MRIcroGL\Resources\dcm2niix -v
Chris Rorden's dcm2niiX version v1.0.20221121  (JP2:OpenJPEG) (JP-LS:CharLS) MSC1900  (64-bit Windows)
v1.0.20221121

C:\Users\Marcel>set "PATH=%PATH%;C:\Program Files\MRIcroGL\Resources"

C:\Users\Marcel>dcm2niix -v
Chris Rorden's dcm2niiX version v1.0.20221121  (JP2:OpenJPEG) (JP-LS:CharLS) MSC1900  (64-bit Windows)
v1.0.20221121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants