Synb0-DISCO
Synb0-DISCO copied to clipboard
Docker Failed while distortion correction
sudo docker run --rm -v $(pwd)/inputs/:/INPUTS/ -v $(pwd)/OUTPUTS:/OUTPUTS/ -v /home/baris/freesurfer/license.txt:/extra/freesfsleurfer/license.txt --user $(id -u):$(id -g) hansencb/synb0
when i write this command i take this error.
Total elapsed time: 335.6
Apply linear transform to T1 antsApplyTransforms -d 3 -i /tmp/tmp.nICq1WsZJS/T1_norm.nii.gz -r /extra/atlases/mni_icbm152_t1_tal_nlin_asym_09c_2_5.nii.gz -n BSpline -t /tmp/tmp.nICq1WsZJS/ANTS0GenericAffine.mat -o /tmp/tmp.nICq1WsZJS/T1_norm_lin_atlas_2_5.nii.gz file /tmp/tmp.nICq1WsZJS/T1_norm.nii.gz does not exist . terminate called after throwing an instance of 'itk::ExceptionObject' what(): /home/local/VANDERBILT/blaberj/ANTS_13_FEB_2019/bin/ants/ITKv5/Modules/Core/Common/src/itkProcessObject.cxx:1412: itk::ERROR: ResampleImageFilter(0x37ed7c0): Input Primary is required but not set.
Apply linear transform to distorted b0 /extra/prepare_input.sh: line 76: 608 Aborted (core dumped) antsApplyTransforms -d 3 -i /tmp/tmp.nICq1WsZJS/T1_norm.nii.gz -r /extra/atlases/mni_icbm152_t1_tal_nlin_asym_09c_2_5.nii.gz -n BSpline -t /tmp/tmp.nICq1WsZJS/ANTS0GenericAffine.mat -o /tmp/tmp.nICq1WsZJS/T1_norm_lin_atlas_2_5.nii.gz antsApplyTransforms -d 3 -i /INPUTS/b0.nii.gz -r /extra/atlases/mni_icbm152_t1_tal_nlin_asym_09c_2_5.nii.gz -n BSpline -t /tmp/tmp.nICq1WsZJS/ANTS0GenericAffine.mat -t /tmp/tmp.nICq1WsZJS/epi_reg_d_ANTS.txt -o /tmp/tmp.nICq1WsZJS/b0_d_lin_atlas_2_5.nii.gz
Apply nonlinear transform to T1 antsApplyTransforms -d 3 -i /tmp/tmp.nICq1WsZJS/T1_norm.nii.gz -r /extra/atlases/mni_icbm152_t1_tal_nlin_asym_09c_2_5.nii.gz -n BSpline -t /tmp/tmp.nICq1WsZJS/ANTS1Warp.nii.gz -t /tmp/tmp.nICq1WsZJS/ANTS0GenericAffine.mat -o /tmp/tmp.nICq1WsZJS/T1_norm_nonlin_atlas_2_5.nii.gz file /tmp/tmp.nICq1WsZJS/T1_norm.nii.gz does not exist . terminate called after throwing an instance of 'itk::ExceptionObject' what(): /home/local/VANDERBILT/blaberj/ANTS_13_FEB_2019/bin/ants/ITKv5/Modules/Core/Common/src/itkProcessObject.cxx:1412: itk::ERROR: ResampleImageFilter(0x3e68cb0): Input Primary is required but not set.
Apply nonlinear transform to distorted b0 /extra/prepare_input.sh: line 92: 618 Aborted (core dumped) antsApplyTransforms -d 3 -i /tmp/tmp.nICq1WsZJS/T1_norm.nii.gz -r /extra/atlases/mni_icbm152_t1_tal_nlin_asym_09c_2_5.nii.gz -n BSpline -t /tmp/tmp.nICq1WsZJS/ANTS1Warp.nii.gz -t /tmp/tmp.nICq1WsZJS/ANTS0GenericAffine.mat -o /tmp/tmp.nICq1WsZJS/T1_norm_nonlin_atlas_2_5.nii.gz antsApplyTransforms -d 3 -i /INPUTS/b0.nii.gz -r /extra/atlases/mni_icbm152_t1_tal_nlin_asym_09c_2_5.nii.gz -n BSpline -t /tmp/tmp.nICq1WsZJS/ANTS1Warp.nii.gz -t /tmp/tmp.nICq1WsZJS/ANTS0GenericAffine.mat -t /tmp/tmp.nICq1WsZJS/epi_reg_d_ANTS.txt -o /tmp/tmp.nICq1WsZJS/b0_d_nonlin_atlas_2_5.nii.gz
Copying results to results path... cp: cannot stat '/tmp/tmp.nICq1WsZJS/T1_norm.nii.gz': No such file or directory cp: cannot stat '/tmp/tmp.nICq1WsZJS/T1_norm_lin_atlas_2_5.nii.gz': No such file or directory cp: cannot stat '/tmp/tmp.nICq1WsZJS/T1_norm_nonlin_atlas_2_5.nii.gz': No such file or directory
Removing job directory... Performing inference on FOLD: 1 T1 input path: /OUTPUTS/T1_norm_lin_atlas_2_5.nii.gz b0 input path: /OUTPUTS/b0_d_lin_atlas_2_5.nii.gz b0 output path: /OUTPUTS/b0_u_lin_atlas_2_5_FOLD_1.nii.gz Model path: /extra/dual_channel_unet/num_fold_1_total_folds_5_seed_1_num_epochs_100_lr_0.0001_betas_(0.9, 0.999)_weight_decay_1e-05_num_epoch_97.pth Traceback (most recent call last): File "/extra/pytorch/lib/python3.6/site-packages/nibabel/loadsave.py", line 40, in load stat_result = os.stat(filename) FileNotFoundError: [Errno 2] No such file or directory: '/OUTPUTS/T1_norm_lin_atlas_2_5.nii.gz'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/extra/inference.py", line 90, in
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/extra/inference.py", line 90, in
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/extra/inference.py", line 90, in
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/extra/inference.py", line 90, in
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/extra/inference.py", line 90, in
Part of FSL (ID: 6.0.1) topup
Usage:
topup --imain=<some 4D image> --datain=
Compulsory arguments (You MUST set one or more of): --imain name of 4D file with images --datain name of text file with PE directions/times
Optional arguments (You may optionally specify one or more of): --out base-name of output files (spline coefficients (Hz) and movement parameters) --fout name of image file with field (Hz) --iout name of 4D image file with unwarped images --logout Name of log-file --warpres (approximate) resolution (in mm) of warp basis for the different sub-sampling levels, default 10 --subsamp sub-sampling scheme, default 1 --fwhm FWHM (in mm) of gaussian smoothing kernel, default 8 --config Name of config file specifying command line arguments --miter Max # of non-linear iterations, default 5 --lambda Weight of regularisation, default depending on --ssqlambda and --regmod switches. See user documetation. --ssqlambda If set (=1), lambda is weighted by current ssq, default 1 --regmod Model for regularisation of warp-field [membrane_energy bending_energy], default bending_energy --estmov Estimate movements if set, default 1 (true) --minmet Minimisation method 0=Levenberg-Marquardt, 1=Scaled Conjugate Gradient, default 0 (LM) --splineorder Order of spline, 2->Qadratic spline, 3->Cubic spline. Default=3 --numprec Precision for representing Hessian, double or float. Default double --interp Image interpolation model, linear or spline. Default spline --scale If set (=1), the images are individually scaled to a common mean, default 0 (false) --regrid If set (=1), the calculations are done in a different grid, default 1 (true) -h,--help display help info -v,--verbose Print diagonostic information while running -h,--help display help info
Failed to read volume /OUTPUTS/b0_all.nii.gz Error : No image files match: /OUTPUTS/b0_all FINISHED!!!
Thanks for helping.
Are your input and output directories setup correctly? Going off of your command there should be a directory called inputs and a directory call OUTPUTS in your current working directory. In inputs there should be the files b0.nii.gz, T1.nii.gz, and acqparams.txt. If everything is correct, can you provide all of the output in a .txt file?
hi. i'm sorry for late answer. my directory setted up correctly. ANTS0GenericAffine.mat b0_d_lin_atlas_2_5.nii.gz epi_reg_d_ANTS.txt ANTS1InverseWarp.nii.gz b0_d_nonlin_atlas_2_5.nii.gz epi_reg_d.mat ANTS1Warp.nii.gz b0_d_smooth.nii.gz T1_mask.nii.gz All my output directory. But there is not b0_all and the other files.
Can you confirm that you have the files b0.nii.gz, T1.nii.gz, and acqparams.txt in your inputs directory?
my input directory is "acqparams.txt bvals.txt dti.nii.gz outputs b0.nii.gz bvecs.txt inputs T1.nii.gz"
Alright, can you provide the entire output log as a txt file?
Hi I am a neuroradiologist in France, I have the same problem. I don't understand what you mean about "provide the entier output log as a txt file". And when i have my output directory, I don't have epi_reg_d_ANTS.txt and epi_reg_d.mat. Thanks a lot !
Hi @hanscol
I'm having a similar issue as described above. My input directory contains the following files: "acqparams.txt" "b0.nii.gz" "T1.nii.gz" My output directory contains the following files before terminating "ANTS0GenericAffine.mat" "ANTS1InverseWarp.nii.gz" "ANTS1Warp.nii.gz" "b0_d_smooth.nii.gz" "T1_mask.nii.gz" "T1_norm_lin_atlas_2_5.nii.gz" "T1_norm_nonlin_atlas_2_5.nii.gz" "T1_norm.nii.gz"
Please find attached the entire output log as a txt file Synb0_Output.txt
Hello from US. I have the same issue
Hi @hanscol
I'm having a similar issue as described above. My input directory contains the following files: "acqparams.txt" "b0.nii.gz" "T1.nii.gz" My output directory contains the following files before terminating "ANTS0GenericAffine.mat" "ANTS1InverseWarp.nii.gz" "ANTS1Warp.nii.gz" "b0_d_smooth.nii.gz" "T1_mask.nii.gz" "T1_norm_lin_atlas_2_5.nii.gz" "T1_norm_nonlin_atlas_2_5.nii.gz" "T1_norm.nii.gz"
Please find attached the entire output log as a txt file Synb0_Output.txt
This is likely failing because the b0.nii.gz is 4 dimensional. The code expects a 3D b0.nii.gz volume. See line 329 of your output file for the first error message during the registration call.
Hello from US. I have the same issue
Can you please copy the log messages printed in your terminal to help us debug? The most common failures are memory issue (we suggest >12Gb RAM) or the b0.nii.gz is a 4D instead of 3D image.
Hi I am a neuroradiologist in France, I have the same problem. I don't understand what you mean about "provide the entier output log as a txt file". And when i have my output directory, I don't have epi_reg_d_ANTS.txt and epi_reg_d.mat. Thanks a lot !
Hello - if this is still an issue, can you please copy/paste the output in your terminal when you run the docker/singularity? The most common failures are memory issue (we suggest >12Gb RAM) or the b0.nii.gz is a 4D instead of 3D image.
Hi, having the same issue. Is there a way to run this on 4D image?
Currently there is not. We recommend supplying a 3D b=0 image volume (b0.nii.gz) to the container and it will successfully work.
Thank you, Kurt
Is there an ideal way to convert a 4D image to 3D?
There are two options. I would recommend just extracting the first volume from your b=0 image. This can be done using any toolkit - Matlab, python (DIPY), MRTrix3 (dwiextract), or FSL (fslroi), among others. Alternatively, you can average along the 4th dimension to get the average b=0. This has the possibility of increasing SNR, at the expense of possibly artifacts if the images are not aligned.
thank you. to confirm though. I have already run fslroi on my dti.nii.gz file and when i was running synb0 I using it as one of the inputs. What you're saying is I should run fslroi on this b0 file though and use the two b0 files instead of the 4D nifti file? Which would be the necessary T1 input?
There should only be three inputs. One is a b0.nii.gz file that is a 3D volume of the b=0 image (either a single b=0 or the average of all b=0). The second is is a T1.nii.gz that should be the raw T1 weighted image (3D volume). Finally, the acqparams.txt file that describes acquisition (but you can copy/paste the one on our README if needed). If there are any other files, or any of these are 4D, it is likely our processing pipeline will get confused and/or fail!
Thanks. So I've split the 4D nifti file into 3D which has resulted in 65 nifti files. Does it matter which one of the volumes is used after the split for the raw T1 weighted image?
On Thu, Apr 6, 2023 at 11:30 AM Kurt Schilling @.***> wrote:
There should only be three inputs. One is a b0.nii.gz file that is a 3D volume of the b=0 image (either a single b=0 or the average of all b=0). The second is is a T1.nii.gz that should be the raw T1 weighted image (3D volume). Finally, the acqparams.txt file that describes acquisition (but you can copy/paste the one on our README if needed). If there are any other files, or any of these are 4D, it is likely our processing pipeline will get confused and/or fail!
— Reply to this email directly, view it on GitHub https://github.com/MASILab/Synb0-DISCO/issues/12#issuecomment-1499254915, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM6BRDZVETKUZFHZWTSSE3LW73OPZANCNFSM4VOVIFHQ . You are receiving this because you commented.Message ID: @.***>
I'm sorry I'm a bit confused.
One input should just be your T1 weighted image (a 3D volume with T1-weighted contrast).
The second input should be a b=0 image that has to be a 3D volume. This you can grab from your diffusion dataset as either the average of the b=0 volumes or a single b=0 volume. You will be able to determine the b=0 volumes from your b-val/b-vec scheme files.
Hello, I am getting the same error that is reported here. My INPUTS directory has three files - b0.nii.gz, T1.nii.gz, and acqparams.txt. Both b0 and T1 images are 3D inputs and the T1 is skull-stripped with FSL's bet. I used the --stripped flag
I monitored the memory usage during the docker run, and it never exceeded 0.35% of available memory.
I also monitored the contents of the tmp directory. It seems that T1_norm.nii.gz is never written out to /tmp, hence the following error which occurs right after the ANTS registration:
ANTS syn registration antsRegistrationSyNQuick.sh -d 3 -f /extra/atlases/mni_icbm152_t1_tal_nlin_asym_09c_mask.nii.gz -m /INPUTS/T1.nii.gz -o /tmp/tmp.qX7UTJEhzy/ANTS . . . 1DIAGNOSTIC, 44, -6.011209705691e-01, 3.822047141791e-06, 1.9621e+02, 3.8124e+00, 1DIAGNOSTIC, 45, -6.009289000341e-01, -7.784585248881e-07, 2.0027e+02, 4.0675e+00, Elapsed time (stage 2): 205.8
Total elapsed time: 259.8
Apply linear transform to T1 antsApplyTransforms -d 3 -i /tmp/tmp.qX7UTJEhzy/T1_norm.nii.gz -r /extra/atlases/mni_icbm152_t1_tal_nlin_asym_09c_2_5.nii.gz -n BSpline -t /tmp/tmp.qX7UTJEhzy/ANTS0GenericAffine.mat -o /tmp/tmp.qX7UTJEhzy/T1_norm_lin_atlas_2_5.nii.gz file /tmp/tmp.qX7UTJEhzy/T1_norm.nii.gz does not exist . terminate called after throwing an instance of 'itk::ExceptionObject' what(): /home/local/VANDERBILT/blaberj/ANTS_13_FEB_2019/bin/ants/ITKv5/Modules/Core/Common/src/itkProcessObject.cxx:1412: itk::ERROR: ResampleImageFilter(0x330c0c0): Input Primary is required but not set.
I am getting this error when using the docker image with the tag "latest"
Any insight would be helpful. Thanks!
Update - I was able to solve my problem by using a different license.txt for freesurfer. Thanks for the tool.