Hi,
I have been running mri_reface on my local machine and the error its throwing is as follows (also in attachment):
(base) userName:~/refacing/mri_reface_docker$ sudo
./run_mri_reface_docker.sh
/home/userName/refacing/raw/mri/anat/BRS2023000P3_T1W_3D_TFE_SENSE2_20230711112735_301.nii.gz
/home/userName/refacing/processed/
-------------------------------------------------------
Running mri_reface, version 0.3.5
By: Christopher G. Schwarz schwarz.christopher@mayo.edu
Temp directory: /tmp/tp82fcd62e_e76b_4fb1_ab77_23e4f348bd51
Error using load_nii_hdr
Cannot find file
"/tmp/tmp.dtbCzt1Zzu/inputs/BRS2023000P3_T1W_3D_TFE_SENSE2_20230711112735_301.gz.nii".
Error in load_nii_noxform (line 13)
Error in ADIR_ReFace (line 322)
cp: cannot stat '/tmp/tmp.dtbCzt1Zzu/outputs/*': No such file or directory
- I did chmod 777 on all directories being accessed by the program including my /tmp/ directory to help facilitate it.
- The problem seems to be in the docker run line of code. I
placed "echo" statements throughout the code to catch this. (as
seen in attachment)
- docker run --rm -ti --mount type=bind,src=$tmpdir,target=$tmpdir mri_reface run_mri_reface.>
- I do not understand why its trying to access my /tmp/ directory instead of just accessing the nifti from the path specified, espcially because /tmp/ and the path where I am running mri_reface is in a different place.
Any help would be welcomed,
Sun
Sun,
I think the issue is the .gz inputs. Try running gunzip on the file first, and I think that will solve your issue. We didn't set it up to support .gz inputs, but this would be a good enhancement for us to add in the future. Unrelatedly, you shouldn't need to run this as root; you could remove the sudo. The /tmp directories are because you're getting print messages from inside the Docker instance. It's not /tmp on your filesystem but inside the Docker.
Let me know if that helps.
Best regards,
Chris Schwarz
I was having the same problem, but gunzip didn't resolve things. I'm using Ubuntu 24.04.2 LTS.
~/nifti $ ./run_mri_reface_docker.sh
PGBM-020-1.3.6.1.4.1.14519.5.2.1.4429.7055.247305732462907069875129639452.nii
./mri-reface-output -imType T2
cp: cannot stat
'PGBM-020-1.3.6.1.4.1.14519.5.2.1.4429.7055.247305732462907069875129639452.nii':
No such file or directory
Error using ADIR_ReFace
File not found:
/tmp/tmp.GS09StOInV/inputs/PGBM-020-1.3.6.1.4.1.14519.5.2.1.4429.7055.247305732462907069875129639452.nii
cp: cannot stat '/tmp/tmp.GS09StOInV/outputs/*': No such file or
directory
Justin,
This doesn't look like a complete output from the console. If
you're seeing the "ADIR_ReFace" name, then the code has gotten from
the wrapping shell script into the compiled-Matlab function, but
what you've given me is missing the banner and the stacktrace that
would come from an error in that part of the code. Can you please
try to give me a more complete console log? Naively guessing with
only what I have, I would try renaming the nifti to something more
simplistic. All those periods may be messing up the filename vs.
extension parsing.
Best regards,
Chris Schwarz
Thanks Chris, re-naming the files to use dashes instead of periods fixed the issue!
Originally posted by Justin Kirby:
Thanks Chris, re-naming the files to use dashes instead of periods fixed the issue!
Thanks for reporting back! I'm glad it was an easy workaround. Please don't hesitate to reach out if you have more issues or feedback. If there's anything I can do to make mri_reface more usable for TCIA and similar projects, I would do my best to make that happen.
Chris
Originally posted by Christopher Schwarz:
Originally posted by Justin Kirby:
Thanks Chris, re-naming the files to use dashes instead of periods fixed the issue!
Thanks for reporting back! I'm glad it was an easy workaround. Please don't hesitate to reach out if you have more issues or feedback. If there's anything I can do to make mri_reface more usable for TCIA and similar projects, I would do my best to make that happen.
Chris
Hello. I think I'm experiencing the same issue here:
[panda_user@dom14044 mri_reface_docker]$ time ./run_mri_reface_docker.sh test/t1_2.nii test_t1/ -imType T1
Warning: ADIR_cp: the following warnings were produced:
> In ADIR_cp (line 171)
In ADIR_ReFace (line 271)
cp: cannot open '/tmp/tmp.kufO28OHyS/inputs/t1_2.nii' for reading: Permission denied]
-------------------------------------------------------
Running mri_reface, version 0.3.5
By: Christopher G. Schwarz schwarz.christopher@mayo.edu
Temp directory: /tmp/tp74854768_777b_4317_bf48_f1b4b816c1a1
Error using load_nii_hdr
Cannot open file /tmp/tmp.kufO28OHyS/inputs/t1_2.nii.
Error in load_nii_noxform (line 13)
Error in ADIR_ReFace (line 322)
cp: cannot stat '/tmp/tmp.kufO28OHyS/outputs/*': No such file or directory
real 0m8.825s
user 0m0.017s
sys 0m0.033s
In my case, I can get pretty
stripped down with the naming, but I'm still getting this
ADIR_ReFace error. Oddly, this works on a
T2 from the same session.
Any help would be much appreciated!
Thanks,
Bill
Bill,
I'm runing your exact command with your exact filenames, and it's not reproducing your error (below). My best guess is something you-specific, like maybe you mistyped your input filename or your user doesn't have access to open that file. It doesn't seem to be an issue with your filenames, in your case.
Best,
Chris
$ time ./run_mri_reface_docker.sh test/t1_2.nii test_t1/ -imType
T1
-------------------------------------------------------
Running mri_reface, version 0.3.5
By: Christopher G. Schwarz schwarz.christopher@mayo.edu
Temp directory: /tmp/tpaef8765c_ef9c_4d65_9334_d52aeb7ffcb8
Target file: /tmp/tmp.5YJ1Kh57kU/inputs/t1_2.nii
Output directory: /tmp/tmp.5YJ1Kh57kU/outputs
Target image type: T1
Template:
/home/reface-user/.mcrCache9.12/mri_re0/mri_reface/images/MCALT_FaceTemplate_T1.nii
Face atlas:
/home/reface-user/.mcrCache9.12/mri_re0/mri_reface/images/MCALT_FaceMask.nii
Calculating affine parameters to template. This will take some
time.
[...]
Originally posted by wbbevis:
Originally posted by Christopher Schwarz:
Originally posted by Justin Kirby:
Thanks Chris, re-naming the files to use dashes instead of periods fixed the issue!
Thanks for reporting back! I'm glad it was an easy workaround. Please don't hesitate to reach out if you have more issues or feedback. If there's anything I can do to make mri_reface more usable for TCIA and similar projects, I would do my best to make that happen.
Chris
Hello. I think I'm experiencing the same issue here:
[panda_user@dom14044 mri_reface_docker]$ time ./run_mri_reface_docker.sh test/t1_2.nii test_t1/ -imType T1
Warning: ADIR_cp: the following warnings were produced:
> In ADIR_cp (line 171)
In ADIR_ReFace (line 271)
cp: cannot open '/tmp/tmp.kufO28OHyS/inputs/t1_2.nii' for reading: Permission denied]
-------------------------------------------------------
Running mri_reface, version 0.3.5
By: Christopher G. Schwarz schwarz.christopher@mayo.edu
Temp directory: /tmp/tp74854768_777b_4317_bf48_f1b4b816c1a1
Error using load_nii_hdr
Cannot open file /tmp/tmp.kufO28OHyS/inputs/t1_2.nii.
Error in load_nii_noxform (line 13)
Error in ADIR_ReFace (line 322)
cp: cannot stat '/tmp/tmp.kufO28OHyS/outputs/*': No such file or directory
real 0m8.825s
user 0m0.017s
sys 0m0.033s
In my case, I can get pretty stripped down with the naming, but I'm still getting this ADIR_ReFace error. Oddly, this works on a T2 from the same session.
Any help would be much appreciated!
Thanks,
Bill
Oop, yep, it was a permissions issue. Thanks, Chris!
Bill