xiangruili / dicm2nii

DICOM to NIfTI conversion, NIfTI tools
BSD 2-Clause "Simplified" License
91 stars 44 forks source link

symlinks on Linux OS #57

Closed lukasvo76 closed 1 year ago

lukasvo76 commented 1 year ago

Hi Xiangrui,

Many thanks for this function, which I use a lot to convert PARREC images to .nii.

Things work well, but contrary to a previous study, the function now fails to open a .REC file which has a symlink to an object in .git (we use git-annex implemented in datalad for version control purposes on our lab server running on Ubuntu 20.04).

In my previous study, it opened and corrected the .REC file correctly, even though it had a symlink too.

Any idea how this can be fixed?

Thanks very much in advance,

Lukas

xiangruili commented 1 year ago

@lukasvo76 I am not sure I understand the issue. Did you mean the .REC file associated with .PAR is a symlink file, rather than the real .REC file? If so, I don't think the convert works at all. The .REC file must have the same name as the PAR file except the extension.

lukasvo76 commented 1 year ago

@xiangruili Thanks for the prompt response! The .REC file is physically there and has the same name as the corresponding .PAR file, but is symlinked to an object in .git too. This worked fine in my previous study, but not anymore now. If you can think of a potential solution, that would be great, but worst case I will get the files temporarily out of git annex to do the conversion.

xiangruili commented 1 year ago

I don't think we did anything to deal with this kind of issue. So if it worked before but not now, it sounds like there is some change for the git annex mechanism. Do you know an easy way to create this scenario for me to test it?

lukasvo76 commented 1 year ago

@xiangruili Thanks! Not so easy to test this mechanism I guess, unless you are familiar with datalad on a Linux system? In that case it would be quite easy, otherwise not. For now, we used git unannex to temporarily get the files out of git annex before conversion using dicm2nii, after which we can annex them again!