MASILab / Synb0-DISCO

Distortion correction of diffusion weighted MRI without reverse phase-encoding scans or field-maps
https://my.vanderbilt.edu/masi
57 stars 28 forks source link

T1_norm.nii.gz does not exist #23

Open Meryam1985 opened 2 years ago

Meryam1985 commented 2 years ago

Hello I want to use MRTRIX3 to create the connectum of the DWI images. Converting the images I was using to BIDS format GIVEN:

Elapsed time (stage 2): 241.8

Total elapsed time: 299.3

Apply linear transform to T1 antsApplyTransforms -d 3 -i /tmp/tmp.RRepiyfNdY/T1_norm.nii.gz -r /extra/atlases/mni_icbm152_t1_tal_nlin_asym_09c_2_5.nii.gz -n BSpline -t /tmp/tmp.RRepiyfNdY/ANTS0GenericAffine.mat -o /tmp/tmp.RRepiyfNdY/T1_norm_lin_atlas_2_5.nii.gz file /tmp/tmp.RRepiyfNdY/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(0x33c07c0): Input Primary is required but not set. /extra/prepare_input.sh: line 83: 744 Aborted (core dumped) antsApplyTransforms -d 3 -i /tmp/tmp.RRepiyfNdY/T1_norm.nii.gz -r /extra/atlases/mni_icbm152_t1_tal_nlin_asym_09c_2_5.nii.gz -n BSpline -t /tmp/tmp.RRepiyfNdY/ANTS0GenericAffine.mat -o /tmp/tmp.RRepiyfNdY/T1_norm_lin_atlas_2_5.nii.gz

Apply linear transform to distorted b0 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.RRepiyfNdY/ANTS0GenericAffine.mat -t /tmp/tmp.RRepiyfNdY/epi_reg_d_ANTS.txt -o /tmp/tmp.RRepiyfNdY/b0_d_lin_atlas_2_5.nii.gz Transform file does not exist: /tmp/tmp.RRepiyfNdY/epi_reg_d_ANTS.txt

Apply nonlinear transform to T1 antsApplyTransforms -d 3 -i /tmp/tmp.RRepiyfNdY/T1_norm.nii.gz -r /extra/atlases/mni_icbm152_t1_tal_nlin_asym_09c_2_5.nii.gz -n BSpline -t /tmp/tmp.RRepiyfNdY/ANTS1Warp.nii.gz -t /tmp/tmp.RRepiyfNdY/ANTS0GenericAffine.mat -o /tmp/tmp.RRepiyfNdY/T1_norm_nonlin_atlas_2_5.nii.gz file /tmp/tmp.RRepiyfNdY/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(0x37aecb0): Input Primary is required but not set. /extra/prepare_input.sh: line 99: 754 Aborted (core dumped) antsApplyTransforms -d 3 -i /tmp/tmp.RRepiyfNdY/T1_norm.nii.gz -r /extra/atlases/mni_icbm152_t1_tal_nlin_asym_09c_2_5.nii.gz -n BSpline -t /tmp/tmp.RRepiyfNdY/ANTS1Warp.nii.gz -t /tmp/tmp.RRepiyfNdY/ANTS0GenericAffine.mat -o /tmp/tmp.RRepiyfNdY/T1_norm_nonlin_atlas_2_5.nii.gz

Apply nonlinear transform to distorted b0 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.RRepiyfNdY/ANTS1Warp.nii.gz -t /tmp/tmp.RRepiyfNdY/ANTS0GenericAffine.mat -t /tmp/tmp.RRepiyfNdY/epi_reg_d_ANTS.txt -o /tmp/tmp.RRepiyfNdY/b0_d_nonlin_atlas_2_5.nii.gz Transform file does not exist: /tmp/tmp.RRepiyfNdY/epi_reg_d_ANTS.txt

knowing that I used the following acqparams.txt 0 1 0 0.034 0 1 0 0.000 with 0.034 is calculate by this way:1/BandwidthPerPixelPhaseEncode = 1/29.727 I would be grateful if someone can help me identify the error. cordially.

hanscol commented 2 years ago

Hello, It looks like you are missing the path to link the freesurfer license within the docker in your command

-v /media/docc/freesurfer-linux-centos6_x86_64-7.1.1/freesurfer/license.txt:/extra/freesurfer/license.txt

Let us know if you still see an error with this.

Meryam1985 commented 2 years ago

Thank you very much for your cooperation, I tried with this command: sudo docker run --rm \ -v /media/docc/ses-001use_sb0/anat/:/INPUTS/ \ -v /media/docc/ses-001use_sb0/anat/out:/OUTPUTS/ \ -v /media/docc/freesurfer-linux-centos6_x86_64-7.1.1/freesurfer/license.txt:/extra/freesurfer/license.txt \ --user $(id -u):$(id -g) \ hansencb/synb0 Unfortunately, here is the error message I received: Elapsed time (stage 2): 244.1

Total elapsed time: 306.4

Apply linear transform to T1 antsApplyTransforms -d 3 -i /tmp/tmp.UGPHAXqAYu/T1_norm.nii.gz -r /extra/atlases/mni_icbm152_t1_tal_nlin_asym_09c_2_5.nii.gz -n BSpline -t /tmp/tmp.UGPHAXqAYu/ANTS0GenericAffine.mat -o /tmp/tmp.UGPHAXqAYu/T1_norm_lin_atlas_2_5.nii.gz

Apply linear transform to distorted b0 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.UGPHAXqAYu/ANTS0GenericAffine.mat -t /tmp/tmp.UGPHAXqAYu/epi_reg_d_ANTS.txt -o /tmp/tmp.UGPHAXqAYu/b0_d_lin_atlas_2_5.nii.gz Transform file does not exist: /tmp/tmp.UGPHAXqAYu/epi_reg_d_ANTS.txt

Apply nonlinear transform to T1 antsApplyTransforms -d 3 -i /tmp/tmp.UGPHAXqAYu/T1_norm.nii.gz -r /extra/atlases/mni_icbm152_t1_tal_nlin_asym_09c_2_5.nii.gz -n BSpline -t /tmp/tmp.UGPHAXqAYu/ANTS1Warp.nii.gz -t /tmp/tmp.UGPHAXqAYu/ANTS0GenericAffine.mat -o /tmp/tmp.UGPHAXqAYu/T1_norm_nonlin_atlas_2_5.nii.gz

Apply nonlinear transform to distorted b0 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.UGPHAXqAYu/ANTS1Warp.nii.gz -t /tmp/tmp.UGPHAXqAYu/ANTS0GenericAffine.mat -t /tmp/tmp.UGPHAXqAYu/epi_reg_d_ANTS.txt -o /tmp/tmp.UGPHAXqAYu/b0_d_nonlin_atlas_2_5.nii.gz Transform file does not exist: /tmp/tmp.UGPHAXqAYu/epi_reg_d_ANTS.txt

Copying results to results path... cp: cannot stat '/tmp/tmp.UGPHAXqAYu/epi_reg_d.mat': No such file or directory cp: cannot stat '/tmp/tmp.UGPHAXqAYu/epi_reg_d_ANTS.txt': No such file or directory cp: cannot stat '/tmp/tmp.UGPHAXqAYu/b0_d_lin_atlas_2_5.nii.gz': No such file or directory cp: cannot stat '/tmp/tmp.UGPHAXqAYu/b0_d_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.0001betas(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/b0_d_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 img_model = inference(T1_input_path, b0_input_path, model, device) File "/extra/inference.py", line 32, in inference img_b0_d = np.expand_dims(util.get_nii_img(b0_d_path), axis=3) File "/extra/util.py", line 24, in get_nii_img nii = nib.load(path_nii) File "/extra/pytorch/lib/python3.6/site-packages/nibabel/loadsave.py", line 42, in load raise FileNotFoundError("No such file or no access: '%s'" % filename) FileNotFoundError: No such file or no access: '/OUTPUTS/b0_d_lin_atlas_2_5.nii.gz' Performing inference on FOLD: 2 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_2.nii.gz Model path: /extra/dual_channel_unet/num_fold_2_total_folds_5_seed_1_num_epochs_100_lr_0.0001betas(0.9, 0.999)_weight_decay_1e-05_num_epoch_98.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/b0_d_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 img_model = inference(T1_input_path, b0_input_path, model, device) File "/extra/inference.py", line 32, in inference img_b0_d = np.expand_dims(util.get_nii_img(b0_d_path), axis=3) File "/extra/util.py", line 24, in get_nii_img nii = nib.load(path_nii) File "/extra/pytorch/lib/python3.6/site-packages/nibabel/loadsave.py", line 42, in load raise FileNotFoundError("No such file or no access: '%s'" % filename) FileNotFoundError: No such file or no access: '/OUTPUTS/b0_d_lin_atlas_2_5.nii.gz' Performing inference on FOLD: 3 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_3.nii.gz Model path: /extra/dual_channel_unet/num_fold_3_total_folds_5_seed_1_num_epochs_100_lr_0.0001betas(0.9, 0.999)_weight_decay_1e-05_num_epoch_90.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/b0_d_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 img_model = inference(T1_input_path, b0_input_path, model, device) File "/extra/inference.py", line 32, in inference img_b0_d = np.expand_dims(util.get_nii_img(b0_d_path), axis=3) File "/extra/util.py", line 24, in get_nii_img nii = nib.load(path_nii) File "/extra/pytorch/lib/python3.6/site-packages/nibabel/loadsave.py", line 42, in load raise FileNotFoundError("No such file or no access: '%s'" % filename) FileNotFoundError: No such file or no access: '/OUTPUTS/b0_d_lin_atlas_2_5.nii.gz' Performing inference on FOLD: 4 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_4.nii.gz Model path: /extra/dual_channel_unet/num_fold_4_total_folds_5_seed_1_num_epochs_100_lr_0.0001betas(0.9, 0.999)_weight_decay_1e-05_num_epoch_90.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/b0_d_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 img_model = inference(T1_input_path, b0_input_path, model, device) File "/extra/inference.py", line 32, in inference img_b0_d = np.expand_dims(util.get_nii_img(b0_d_path), axis=3) File "/extra/util.py", line 24, in get_nii_img nii = nib.load(path_nii) File "/extra/pytorch/lib/python3.6/site-packages/nibabel/loadsave.py", line 42, in load raise FileNotFoundError("No such file or no access: '%s'" % filename) FileNotFoundError: No such file or no access: '/OUTPUTS/b0_d_lin_atlas_2_5.nii.gz' Performing inference on FOLD: 5 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_5.nii.gz Model path: /extra/dual_channel_unet/num_fold_5_total_folds_5_seed_1_num_epochs_100_lr_0.0001betas(0.9, 0.999)_weight_decay_1e-05_num_epoch_88.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/b0_d_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 img_model = inference(T1_input_path, b0_input_path, model, device) File "/extra/inference.py", line 32, in inference img_b0_d = np.expand_dims(util.get_nii_img(b0_d_path), axis=3) File "/extra/util.py", line 24, in get_nii_img nii = nib.load(path_nii) File "/extra/pytorch/lib/python3.6/site-packages/nibabel/loadsave.py", line 42, in load raise FileNotFoundError("No such file or no access: '%s'" % filename) FileNotFoundError: No such file or no access: '/OUTPUTS/b0_d_lin_atlas_2_5.nii.gz' Taking ensemble average Image Exception : #63 :: No image files match: /OUTPUTS/b0_u_lin_atlas_2_5FOLD terminate called after throwing an instance of 'std::runtime_error' what(): No image files match: /OUTPUTS/b0_u_lin_atlas_2_5FOLD /extra/pipeline.sh: line 45: 1477 Aborted (core dumped) fslmerge -t /OUTPUTS/b0_u_lin_atlas_2_5_merged.nii.gz /OUTPUTS/b0_u_lin_atlas_2_5FOLD*.nii.gz Image Exception : #63 :: No image files match: /OUTPUTS/b0_u_lin_atlas_2_5_merged terminate called after throwing an instance of 'std::runtime_error' what(): No image files match: /OUTPUTS/b0_u_lin_atlas_2_5_merged /extra/pipeline.sh: line 46: 1478 Aborted (core dumped) fslmaths /OUTPUTS/b0_u_lin_atlas_2_5_merged.nii.gz -Tmean /OUTPUTS/b0_u_lin_atlas_2_5.nii.gz Applying inverse xform to undistorted b0 file /OUTPUTS/b0_u_lin_atlas_2_5.nii.gz does not exist . Transform file does not exist: /OUTPUTS/epi_reg_d_ANTS.txt Applying slight smoothing to distorted b0 Running topup Image Exception : #63 :: No image files match: /OUTPUTS/b0_u terminate called after throwing an instance of 'std::runtime_error' what(): No image files match: /OUTPUTS/b0_u /extra/pipeline.sh: line 61: 1485 Aborted (core dumped) fslmerge -t /OUTPUTS/b0_all.nii.gz /OUTPUTS/b0_d_smooth.nii.gz /OUTPUTS/b0_u.nii.gz Image Exception : #63 :: No image files match: /OUTPUTS/b0_all Image Exception : #22 :: Failed to read volume /OUTPUTS/b0_all.nii.gz Error : No image files match: /OUTPUTS/b0_all

Part of FSL (ID: 6.0.1) topup

Usage: topup --imain=<some 4D image> --datain= --config= --out=my_topup_results

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!!!

hanscol commented 2 years ago

It looks like the epi_reg might have failed, but I can’t be sure without the full output log. Could you provide all of the output text in a txt file? That would make things easier. Also could you check if you are providing the full DWI or just the b0 image in the input directory. That may be the issue.

Meryam1985 commented 2 years ago

Hello here is attached the totality of the answer and error. also a screenshot of the files used. Cordially.

Le vendredi 3 septembre 2021, 17:12:25 UTC+2, Colin Hansen ***@***.***> a écrit :  

It looks like the epi_reg might have failed, but I can’t be sure without the full output log. Could you provide all of the output text in a txt file? That would make things easier. Also could you check if you are providing the full DWI or just the b0 image in the input directory. That may be the issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

Meryam1985 commented 2 years ago

Hello here is attached the full answer and error when I try to work without docker. Cordially.

Le vendredi 3 septembre 2021, 18:15:59 UTC+2, mabrouk Besma ***@***.***> a écrit :  

Hello here is attached the totality of the answer and error. also a screenshot of the files used. Cordially.

Le vendredi 3 septembre 2021, 17:12:25 UTC+2, Colin Hansen ***@***.***> a écrit :  

It looks like the epi_reg might have failed, but I can’t be sure without the full output log. Could you provide all of the output text in a txt file? That would make things easier. Also could you check if you are providing the full DWI or just the b0 image in the input directory. That may be the issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

hanscol commented 2 years ago

For some reason I'm not seeing the attached files. If it is easier, you can email them to me directly hanscol45@gmail.com.