External Email - Use Caution
Hello FreeSurfer Developers
I hope i don't spam, if anyone has a clue...
I need to convert 512 dicom files from Bruker into .nii . I firstly add .dcm to my Bruker multi gradient echo phase files then enter the following command : mri_convert MRIm001.dcm phaseMGE.nii
Here is the first message :
reading from MRIm001.dcm... Starting DICOMRead2() dcmfile = /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm dcmdir = /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2 ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH -- ERROR: GetDICOMInfo(): dcmGetDWIParams() 1 DICOM File: /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm break /home/rd521/space_freesurfer/build/docker_ubuntu18/trunk/rd521-7.2.0/utils/DICOMRead.cpp:4930 Ref Series No = 4 Found 514 files, checking for dicoms ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH -- ERROR: GetDICOMInfo(): dcmGetDWIParams() 1 DICOM File: /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm break /home/rd521/space_freesurfer/build/docker_ubuntu18/trunk/rd521-7.2.0/utils/DICOMRead.cpp:4930 ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH -- ERROR: GetDICOMInfo(): dcmGetDWIParams() 1
Then 508 error messages like the three last lines appear. It ends with :
First Sorting Computing Slice Direction Vs: 0 0 1 Vs: 0 0 1 Second Sorting IsDWI = 0, IsPhilipsDWI = 0 Counting frames nframes = 8 nslices = 63 ndcmfiles = 508 ERROR: the number of frames * number of slices does not equal the number of dicom files.
I did a test with only 448 files (I just copy-paste the first 448 files = 7 TE * 64 slices) and I obtained the same error messages but the nifti files are created and seem usable (quick test with Fiji). Here are the last lines :
First Sorting Computing Slice Direction Vs: 0 0 1 Vs: 0 0 1 Second Sorting IsDWI = 1, IsPhilipsDWI = 0 Counting frames nframes = 7 nslices = 64 ndcmfiles = 448 INFO: rescale not needed PE Dir = COL (dicom read) Loading pixel data TR=50.00, TE=3.10, TI=0.00, flip angle=15.00 i_ras = (-1, -0, 0) j_ras = (-0, -1, 0) k_ras = (-0, -0, 1) writing to phaseMGR.nii... Saving bvals and bvecs
I'm pretty new with mri convert and I don't understand why it stops converting to nii with 512 files (8 TE) but not 448 files for Brucker files.
Best Regards,
Mateo
Version: freesurfer-linux-ubuntu18_x86_64-7.2.0-20210721-aa8f76b
Hi Mateo,
It looks like mri_convert terminated prematurely when you tried to convert those 512 dicom files.
Those error messages are printed when mri_convert wasn’t able to retrieve DTI information from dicom. If you don’t need the DTI values, you can ignore those error messages.
Also, looking at the codes, I think if you set environment variable FS_LOAD_DWI to 0 before running mri_convert, it should finish convert all 512 dicom files. To set the environment variable, you do ‘export FS_LOAD_DWI = 0’ in bash, and ‘setenv FS_LOAD_DWI 0’ in csh.
Can you give it a try?
Thanks.
Yujing
From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu On Behalf Of Mateo Jean Sent: Tuesday, April 26, 2022 7:51 AM To: freesurfer freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
External Email - Use Caution Hello FreeSurfer Developers
I hope i don't spam, if anyone has a clue...
I need to convert 512 dicom files from Bruker into .nii . I firstly add .dcm to my Bruker multi gradient echo phase files then enter the following command : mri_convert MRIm001.dcm phaseMGE.nii
Here is the first message :
reading from MRIm001.dcm... Starting DICOMRead2() dcmfile = /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm dcmdir = /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2 ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH -- ERROR: GetDICOMInfo(): dcmGetDWIParams() 1 DICOM File: /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm break /home/rd521/space_freesurfer/build/docker_ubuntu18/trunk/rd521-7.2.0/utils/DICOMRead.cpp:4930 Ref Series No = 4 Found 514 files, checking for dicoms ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH -- ERROR: GetDICOMInfo(): dcmGetDWIParams() 1 DICOM File: /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm break /home/rd521/space_freesurfer/build/docker_ubuntu18/trunk/rd521-7.2.0/utils/DICOMRead.cpp:4930 ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH -- ERROR: GetDICOMInfo(): dcmGetDWIParams() 1
Then 508 error messages like the three last lines appear. It ends with :
First Sorting Computing Slice Direction Vs: 0 0 1 Vs: 0 0 1 Second Sorting IsDWI = 0, IsPhilipsDWI = 0 Counting frames nframes = 8 nslices = 63 ndcmfiles = 508 ERROR: the number of frames * number of slices does not equal the number of dicom files.
I did a test with only 448 files (I just copy-paste the first 448 files = 7 TE * 64 slices) and I obtained the same error messages but the nifti files are created and seem usable (quick test with Fiji). Here are the last lines :
First Sorting Computing Slice Direction Vs: 0 0 1 Vs: 0 0 1 Second Sorting IsDWI = 1, IsPhilipsDWI = 0 Counting frames nframes = 7 nslices = 64 ndcmfiles = 448 INFO: rescale not needed PE Dir = COL (dicom read) Loading pixel data TR=50.00, TE=3.10, TI=0.00, flip angle=15.00 i_ras = (-1, -0, 0) j_ras = (-0, -1, 0) k_ras = (-0, -0, 1) writing to phaseMGR.nii... Saving bvals and bvecs
I'm pretty new with mri convert and I don't understand why it stops converting to nii with 512 files (8 TE) but not 448 files for Brucker files.
Best Regards,
Mateo
Version: freesurfer-linux-ubuntu18_x86_64-7.2.0-20210721-aa8f76b
External Email - Use Caution
Thank you for your answer.
Even though I don't need the DTI values, I can't avoid this message :
"ERROR: the number of frames * number of slices does not equal the number of dicom files."
I'm not very familiar with Ubuntu too so I might have made a mistake :
I try to set the environnement variable ‘ export FS_LOAD_DWI = 0 ’ in bash (I use the command $cd then $nano .bashrc and write after
export FS_LICENSE=/home/jeanmri/license.txt
export FREESURFER_HOME=/home/jeanmri/freesurfer/7.2.0
the line export FS_LOAD_DWI = 0 )
Then I open with nano the FreeSurferEnv.csh and add setenv FS_LOAD_DWI 0 at the end but when I use mri_convert on my bruker dicom files, the same error reappeared.
Did I miss something ?
Best Regards,
Mateo
De: "Huang, Yujing" YHUANG43@MGH.HARVARD.EDU À: "freesurfer" freesurfer@nmr.mgh.harvard.edu Envoyé: Mardi 26 Avril 2022 21:22:28 Objet: Re: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
Hi Mateo,
It looks like mri_convert terminated prematurely when you tried to convert those 512 dicom files.
Those error messages are printed when mri_convert wasn’t able to retrieve DTI information from dicom. If you don’t need the DTI values, you can ignore those error messages.
Also, looking at the codes, I think if you set environment variable FS_LOAD_DWI to 0 before running mri_convert, it should finish convert all 512 dicom files. To set the environment variable, you do ‘export FS_LOAD_DWI = 0’ in bash, and ‘setenv FS_LOAD_DWI 0’ in csh.
Can you give it a try?
Thanks.
Yujing
From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu On Behalf Of Mateo Jean Sent: Tuesday, April 26, 2022 7:51 AM To: freesurfer freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
External Email - Use Caution
Hello FreeSurfer Developers
I hope i don't spam, if anyone has a clue...
I need to convert 512 dicom files from Bruker into .nii . I firstly add .dcm to my Bruker multi gradient echo phase files then enter the following command :
mri_convert MRIm001.dcm phaseMGE.nii
Here is the first message :
reading from MRIm001.dcm...
Starting DICOMRead2()
dcmfile = /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm
dcmdir = /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2
ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH --
ERROR: GetDICOMInfo(): dcmGetDWIParams() 1
DICOM File: /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm
break /home/rd521/space_freesurfer/build/docker_ubuntu18/trunk/rd521-7.2.0/utils/DICOMRead.cpp:4930
Ref Series No = 4
Found 514 files, checking for dicoms
ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH --
ERROR: GetDICOMInfo(): dcmGetDWIParams() 1
DICOM File: /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm
break /home/rd521/space_freesurfer/build/docker_ubuntu18/trunk/rd521-7.2.0/utils/DICOMRead.cpp:4930
ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH --
ERROR: GetDICOMInfo(): dcmGetDWIParams() 1
Then 508 error messages like the three last lines appear.
It ends with :
First Sorting
Computing Slice Direction
Vs: 0 0 1
Vs: 0 0 1
Second Sorting
IsDWI = 0, IsPhilipsDWI = 0
Counting frames
nframes = 8
nslices = 63
ndcmfiles = 508
ERROR: the number of frames * number of slices does
not equal the number of dicom files.
I did a test with only 448 files (I just copy-paste the first 448 files = 7 TE * 64 slices) and I obtained the same error messages but the nifti files are created and seem usable (quick test with Fiji). Here are the last lines :
First Sorting
Computing Slice Direction
Vs: 0 0 1
Vs: 0 0 1
Second Sorting
IsDWI = 1, IsPhilipsDWI = 0
Counting frames
nframes = 7
nslices = 64
ndcmfiles = 448
INFO: rescale not needed
PE Dir = COL (dicom read)
Loading pixel data
TR=50.00, TE=3.10, TI=0.00, flip angle=15.00
i_ras = (-1, -0, 0)
j_ras = (-0, -1, 0)
k_ras = (-0, -0, 1)
writing to phaseMGR.nii...
Saving bvals and bvecs
I'm pretty new with mri convert and I don't understand why it stops converting to nii with 512 files (8 TE) but not 448 files for Brucker files.
Best Regards,
Mateo
Version: freesurfer-linux-ubuntu18_x86_64-7.2.0-20210721-aa8f76b
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://secure-web.cisco.com/1gYetxR1-VwqeD9fRK1VOueswhIHJLqg3UCKtLeFc6lLXvn... The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at https://secure-web.cisco.com/1hr4VxS75RBJJ1n9RhM9N2hJSnXUpov8NwQ3YHOIhFxAqtI... https://secure-web.cisco.com/1hr4VxS75RBJJ1n9RhM9N2hJSnXUpov8NwQ3YHOIhFxAqtIkazBRHFSnqN685b922mZm3mas3osZZzdD97lXEXtM_l2LNqt3oq9cAFG_ddUMnNuZ5T2gT2fHty2GuDLcvNqvNDi13KcBM0wgEwgUmk7WzZu9AJOXp_upjWbL3D71ASPIzxnUcsekr7odehG6DxZ564LfISjXJbFGB-jdIOBLqeJq8kZbVgvpi8HSBOq5No1O7AhhpEgZttw02UMbyIMN0G4xJQ5W0HyOERwxa7OMTgOTcuAVwDL98w3mwSUxuN7O9-Gjn2fR6QptsE-BC/https%3A%2F%2Fwww.massgeneralbrigham.org%2Fcomplianceline . Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.
I’m assuming you didn’t source .bashrc after editing it.
You can actually set it on the command line before submitting mri_convert. So, the setting only affect that window. You can use echo $FS_LOAD_DWI to verify the setting.
Here is an example for csh:
echo $FS_LOAD_DWI
FS_LOAD_DWI: Undefined variable.
setenv FS_LOAD_DWI 0 echo $FS_LOAD_DWI
0
mri_convert …
I’m hoping it will solve your problem by setting the environment variable.
Best,
Yujing
From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu On Behalf Of Mateo Jean Sent: Wednesday, April 27, 2022 8:16 AM To: freesurfer freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
External Email - Use Caution Thank you for your answer.
Even though I don't need the DTI values, I can't avoid this message :
"ERROR: the number of frames * number of slices does not equal the number of dicom files."
I'm not very familiar with Ubuntu too so I might have made a mistake :
I try to set the environnement variable ‘export FS_LOAD_DWI = 0’ in bash (I use the command $cd then $nano .bashrc and write after export FS_LICENSE=/home/jeanmri/license.txt export FREESURFER_HOME=/home/jeanmri/freesurfer/7.2.0 the line export FS_LOAD_DWI = 0)
Then I open with nano the FreeSurferEnv.csh and add setenv FS_LOAD_DWI 0 at the end but when I use mri_convert on my bruker dicom files, the same error reappeared.
Did I miss something ?
Best Regards,
Mateo
________________________________ De: "Huang, Yujing" <YHUANG43@MGH.HARVARD.EDUmailto:YHUANG43@MGH.HARVARD.EDU> À: "freesurfer" <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Envoyé: Mardi 26 Avril 2022 21:22:28 Objet: Re: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
Hi Mateo,
It looks like mri_convert terminated prematurely when you tried to convert those 512 dicom files.
Those error messages are printed when mri_convert wasn’t able to retrieve DTI information from dicom. If you don’t need the DTI values, you can ignore those error messages.
Also, looking at the codes, I think if you set environment variable FS_LOAD_DWI to 0 before running mri_convert, it should finish convert all 512 dicom files. To set the environment variable, you do ‘export FS_LOAD_DWI = 0’ in bash, and ‘setenv FS_LOAD_DWI 0’ in csh.
Can you give it a try?
Thanks.
Yujing
From: freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu> On Behalf Of Mateo Jean Sent: Tuesday, April 26, 2022 7:51 AM To: freesurfer <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Subject: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
External Email - Use Caution Hello FreeSurfer Developers
I hope i don't spam, if anyone has a clue...
I need to convert 512 dicom files from Bruker into .nii . I firstly add .dcm to my Bruker multi gradient echo phase files then enter the following command : mri_convert MRIm001.dcm phaseMGE.nii
Here is the first message :
reading from MRIm001.dcm... Starting DICOMRead2() dcmfile = /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm dcmdir = /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2 ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH -- ERROR: GetDICOMInfo(): dcmGetDWIParams() 1 DICOM File: /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm break /home/rd521/space_freesurfer/build/docker_ubuntu18/trunk/rd521-7.2.0/utils/DICOMRead.cpp:4930 Ref Series No = 4 Found 514 files, checking for dicoms ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH -- ERROR: GetDICOMInfo(): dcmGetDWIParams() 1 DICOM File: /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm break /home/rd521/space_freesurfer/build/docker_ubuntu18/trunk/rd521-7.2.0/utils/DICOMRead.cpp:4930 ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH -- ERROR: GetDICOMInfo(): dcmGetDWIParams() 1
Then 508 error messages like the three last lines appear. It ends with :
First Sorting Computing Slice Direction Vs: 0 0 1 Vs: 0 0 1 Second Sorting IsDWI = 0, IsPhilipsDWI = 0 Counting frames nframes = 8 nslices = 63 ndcmfiles = 508 ERROR: the number of frames * number of slices does not equal the number of dicom files.
I did a test with only 448 files (I just copy-paste the first 448 files = 7 TE * 64 slices) and I obtained the same error messages but the nifti files are created and seem usable (quick test with Fiji). Here are the last lines :
First Sorting Computing Slice Direction Vs: 0 0 1 Vs: 0 0 1 Second Sorting IsDWI = 1, IsPhilipsDWI = 0 Counting frames nframes = 7 nslices = 64 ndcmfiles = 448 INFO: rescale not needed PE Dir = COL (dicom read) Loading pixel data TR=50.00, TE=3.10, TI=0.00, flip angle=15.00 i_ras = (-1, -0, 0) j_ras = (-0, -1, 0) k_ras = (-0, -0, 1) writing to phaseMGR.nii... Saving bvals and bvecs
I'm pretty new with mri convert and I don't understand why it stops converting to nii with 512 files (8 TE) but not 448 files for Brucker files.
Best Regards,
Mateo
Version: freesurfer-linux-ubuntu18_x86_64-7.2.0-20210721-aa8f76b
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline https://www.massgeneralbrigham.org/complianceline . Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.
External Email - Use Caution
Hi,
Thanks! It works I guess. I didn't manage to use setenv in the command line before using mri_convert (command not found)
But I did the following modifications and mri_convert works now (it doesn't put the error message anymore and I have the nifti file at the end) : ---------------------------------------------------------------------------------------------------------------------------------------- Opening ubuntu
$cd then > $ nano .bashrc
And I write just before the source /path/freesurfer/7.2.0/SetUpFreeSurfer.sh the line : export FS_LOAD_DWI=0
Then I change the directory to freesurfer : > $ cd /path//freesurfer/7.2.0 and open the csh : > $nano SetUpFreeSurfer.csh I add setenv FS_LOAD_DWI before the line source $FREESURFER_HOME/FreeSurferEnv.csh ---------------------------------------------------------------------------------------------------------------------------------------- I suppose this locks the DWI to zero and I need to remodify it if one day I want to use Diffusion data.
So mri_convert for Bruker data now works. The last problem (and I might create an other post) is that negative values were not kept. When I compared phase imagec converted in nifti with 3D slicer and phase image converted in nifti with mri_convert, 3D slicer's nifti have values ranging from - 32 766 to 32 766 while mri_convert's nifti only have values ranging from 0 to 32 767.
How can I set mri_convert to convert values in signed- 16 bits ?
Thank you for your previous answer !!!
Best Regards,
Mateo
De: "Huang, Yujing" YHUANG43@mgh.harvard.edu À: "freesurfer" freesurfer@nmr.mgh.harvard.edu Envoyé: Mercredi 27 Avril 2022 15:20:37 Objet: Re: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
I’m assuming you didn’t source .bashrc after editing it.
You can actually set it on the command line before submitting mri_convert. So, the setting only affect that window. You can use echo $FS_LOAD_DWI to verify the setting.
Here is an example for csh:
echo $FS_LOAD_DWI
FS_LOAD_DWI: Undefined variable.
setenv FS_LOAD_DWI 0
echo $FS_LOAD_DWI
0
mri_convert …
I’m hoping it will solve your problem by setting the environment variable.
Best,
Yujing
From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu On Behalf Of Mateo Jean Sent: Wednesday, April 27, 2022 8:16 AM To: freesurfer freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
External Email - Use Caution
Thank you for your answer.
Even though I don't need the DTI values, I can't avoid this message :
"ERROR: the number of frames * number of slices does not equal the number of dicom files."
I'm not very familiar with Ubuntu too so I might have made a mistake :
I try to set the environnement variable ‘ export FS_LOAD_DWI = 0 ’ in bash (I use the command $cd then $nano .bashrc and write after
export FS_LICENSE=/home/jeanmri/license.txt
export FREESURFER_HOME=/home/jeanmri/freesurfer/7.2.0
the line export FS_LOAD_DWI = 0 )
Then I open with nano the FreeSurferEnv.csh and add setenv FS_LOAD_DWI 0 at the end but when I use mri_convert on my bruker dicom files, the same error reappeared.
Did I miss something ?
Best Regards,
Mateo
De: "Huang, Yujing" < [ mailto:YHUANG43@MGH.HARVARD.EDU | YHUANG43@MGH.HARVARD.EDU ] > À: "freesurfer" < [ mailto:freesurfer@nmr.mgh.harvard.edu | freesurfer@nmr.mgh.harvard.edu ] > Envoyé: Mardi 26 Avril 2022 21:22:28 Objet: Re: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
Hi Mateo,
It looks like mri_convert terminated prematurely when you tried to convert those 512 dicom files.
Those error messages are printed when mri_convert wasn’t able to retrieve DTI information from dicom. If you don’t need the DTI values, you can ignore those error messages.
Also, looking at the codes, I think if you set environment variable FS_LOAD_DWI to 0 before running mri_convert, it should finish convert all 512 dicom files. To set the environment variable, you do ‘export FS_LOAD_DWI = 0’ in bash, and ‘setenv FS_LOAD_DWI 0’ in csh.
Can you give it a try?
Thanks.
Yujing
From: [ mailto:freesurfer-bounces@nmr.mgh.harvard.edu | freesurfer-bounces@nmr.mgh.harvard.edu ] < [ mailto:freesurfer-bounces@nmr.mgh.harvard.edu | freesurfer-bounces@nmr.mgh.harvard.edu ] > On Behalf Of Mateo Jean Sent: Tuesday, April 26, 2022 7:51 AM To: freesurfer < [ mailto:freesurfer@nmr.mgh.harvard.edu | freesurfer@nmr.mgh.harvard.edu ] > Subject: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
External Email - Use Caution
Hello FreeSurfer Developers
I hope i don't spam, if anyone has a clue...
I need to convert 512 dicom files from Bruker into .nii . I firstly add .dcm to my Bruker multi gradient echo phase files then enter the following command :
mri_convert MRIm001.dcm phaseMGE.nii
Here is the first message :
reading from MRIm001.dcm...
Starting DICOMRead2()
dcmfile = /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm
dcmdir = /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2
ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH --
ERROR: GetDICOMInfo(): dcmGetDWIParams() 1
DICOM File: /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm
break /home/rd521/space_freesurfer/build/docker_ubuntu18/trunk/rd521-7.2.0/utils/DICOMRead.cpp:4930
Ref Series No = 4
Found 514 files, checking for dicoms
ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH --
ERROR: GetDICOMInfo(): dcmGetDWIParams() 1
DICOM File: /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm
break /home/rd521/space_freesurfer/build/docker_ubuntu18/trunk/rd521-7.2.0/utils/DICOMRead.cpp:4930
ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH --
ERROR: GetDICOMInfo(): dcmGetDWIParams() 1
Then 508 error messages like the three last lines appear.
It ends with :
First Sorting
Computing Slice Direction
Vs: 0 0 1
Vs: 0 0 1
Second Sorting
IsDWI = 0, IsPhilipsDWI = 0
Counting frames
nframes = 8
nslices = 63
ndcmfiles = 508
ERROR: the number of frames * number of slices does
not equal the number of dicom files.
I did a test with only 448 files (I just copy-paste the first 448 files = 7 TE * 64 slices) and I obtained the same error messages but the nifti files are created and seem usable (quick test with Fiji). Here are the last lines :
First Sorting
Computing Slice Direction
Vs: 0 0 1
Vs: 0 0 1
Second Sorting
IsDWI = 1, IsPhilipsDWI = 0
Counting frames
nframes = 7
nslices = 64
ndcmfiles = 448
INFO: rescale not needed
PE Dir = COL (dicom read)
Loading pixel data
TR=50.00, TE=3.10, TI=0.00, flip angle=15.00
i_ras = (-1, -0, 0)
j_ras = (-0, -1, 0)
k_ras = (-0, -0, 1)
writing to phaseMGR.nii...
Saving bvals and bvecs
I'm pretty new with mri convert and I don't understand why it stops converting to nii with 512 files (8 TE) but not 448 files for Brucker files.
Best Regards,
Mateo
Version: freesurfer-linux-ubuntu18_x86_64-7.2.0-20210721-aa8f76b
_______________________________________________ Freesurfer mailing list [ mailto:Freesurfer@nmr.mgh.harvard.edu | Freesurfer@nmr.mgh.harvard.edu ] [ https://secure-web.cisco.com/1cMvJLcArlCaffsfxHtRypj2umnjyAVwKoz80_9fJACw18k... | https://secure-web.cisco.com/1cMvJLcArlCaffsfxHtRypj2umnjyAVwKoz80_9fJACw18k... ] The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at [ https://secure-web.cisco.com/1ode8nsaR9dNNr1hYzOJTCQxvSkhn29K75je2epfC4SMvNK... | https://secure-web.cisco.com/1ode8nsaR9dNNr1hYzOJTCQxvSkhn29K75je2epfC4SMvNK... ] < [ https://secure-web.cisco.com/1ode8nsaR9dNNr1hYzOJTCQxvSkhn29K75je2epfC4SMvNK... | https://secure-web.cisco.com/1ode8nsaR9dNNr1hYzOJTCQxvSkhn29K75je2epfC4SMvNK... ] > . Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://secure-web.cisco.com/1cMvJLcArlCaffsfxHtRypj2umnjyAVwKoz80_9fJACw18k... The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at https://secure-web.cisco.com/1ode8nsaR9dNNr1hYzOJTCQxvSkhn29K75je2epfC4SMvNK... https://secure-web.cisco.com/1ode8nsaR9dNNr1hYzOJTCQxvSkhn29K75je2epfC4SMvNKrZ6nUqIGYCrtv3AtIYxCpbtElEHuKOz7sP798PEdk3iYpCFWDbhF5VWq1OV7kZPzgMMMQ1KiGuWezHYrOwzv746cLJJSyQt7NUO14czGrooeMY1bGYWywZERQ3EGXPS4TQM0NmCOhXyKhVnz6XONAPeTfbkcIEPnCLcMIB5j0p9ZAFGmF0GymcLVr0a9ox4BaGLrMv8ILCVryNfKTWXuTPmC-gL_ocPateuwaxqN3fZL-9GO11VPOiAeAWAGdsJ-LX0gi_VfJAcajj80Gt/https%3A%2F%2Fwww.massgeneralbrigham.org%2Fcomplianceline . Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.
Hi Mateo,
I’m glad mri_convert works for you now.
I’m little confused about the value ranges you saw. We map DT_SIGNED_SHORT (-32766~32766) to signed short. mri_info should give ‘type: SHORT (4)’.
In Freesurfer 7.2, we don’t support DT_UINT16. We map DT_UINT16 (0~65535) to signed short. You will see value maxed at 32766 for DT_UINT16. Is this what you were experiencing?
Yujing
From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu On Behalf Of Mateo Jean Sent: Thursday, April 28, 2022 6:06 AM To: freesurfer freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
External Email - Use Caution Hi,
Thanks! It works I guess. I didn't manage to use setenv in the command line before using mri_convert (command not found)
But I did the following modifications and mri_convert works now (it doesn't put the error message anymore and I have the nifti file at the end) : ---------------------------------------------------------------------------------------------------------------------------------------- Opening ubuntu
$cd then >$ nano .bashrc
And I write just before the source /path/freesurfer/7.2.0/SetUpFreeSurfer.sh the line : export FS_LOAD_DWI=0
Then I change the directory to freesurfer : >$ cd /path//freesurfer/7.2.0 and open the csh : >$nano SetUpFreeSurfer.csh I add setenv FS_LOAD_DWI before the line source $FREESURFER_HOME/FreeSurferEnv.csh ---------------------------------------------------------------------------------------------------------------------------------------- I suppose this locks the DWI to zero and I need to remodify it if one day I want to use Diffusion data.
So mri_convert for Bruker data now works. The last problem (and I might create an other post) is that negative values were not kept. When I compared phase imagec converted in nifti with 3D slicer and phase image converted in nifti with mri_convert, 3D slicer's nifti have values ranging from - 32 766 to 32 766 while mri_convert's nifti only have values ranging from 0 to 32 767.
How can I set mri_convert to convert values in signed-16 bits ?
Thank you for your previous answer !!!
Best Regards,
Mateo
________________________________ De: "Huang, Yujing" <YHUANG43@mgh.harvard.edumailto:YHUANG43@mgh.harvard.edu> À: "freesurfer" <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Envoyé: Mercredi 27 Avril 2022 15:20:37 Objet: Re: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
I’m assuming you didn’t source .bashrc after editing it.
You can actually set it on the command line before submitting mri_convert. So, the setting only affect that window. You can use echo $FS_LOAD_DWI to verify the setting.
Here is an example for csh:
echo $FS_LOAD_DWI
FS_LOAD_DWI: Undefined variable.
setenv FS_LOAD_DWI 0 echo $FS_LOAD_DWI
0
mri_convert …
I’m hoping it will solve your problem by setting the environment variable.
Best,
Yujing
From: freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu> On Behalf Of Mateo Jean Sent: Wednesday, April 27, 2022 8:16 AM To: freesurfer <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
External Email - Use Caution Thank you for your answer.
Even though I don't need the DTI values, I can't avoid this message :
"ERROR: the number of frames * number of slices does not equal the number of dicom files."
I'm not very familiar with Ubuntu too so I might have made a mistake :
I try to set the environnement variable ‘export FS_LOAD_DWI = 0’ in bash (I use the command $cd then $nano .bashrc and write after export FS_LICENSE=/home/jeanmri/license.txt export FREESURFER_HOME=/home/jeanmri/freesurfer/7.2.0 the line export FS_LOAD_DWI = 0)
Then I open with nano the FreeSurferEnv.csh and add setenv FS_LOAD_DWI 0 at the end but when I use mri_convert on my bruker dicom files, the same error reappeared.
Did I miss something ?
Best Regards,
Mateo
________________________________ De: "Huang, Yujing" <YHUANG43@MGH.HARVARD.EDUmailto:YHUANG43@MGH.HARVARD.EDU> À: "freesurfer" <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Envoyé: Mardi 26 Avril 2022 21:22:28 Objet: Re: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
Hi Mateo,
It looks like mri_convert terminated prematurely when you tried to convert those 512 dicom files.
Those error messages are printed when mri_convert wasn’t able to retrieve DTI information from dicom. If you don’t need the DTI values, you can ignore those error messages.
Also, looking at the codes, I think if you set environment variable FS_LOAD_DWI to 0 before running mri_convert, it should finish convert all 512 dicom files. To set the environment variable, you do ‘export FS_LOAD_DWI = 0’ in bash, and ‘setenv FS_LOAD_DWI 0’ in csh.
Can you give it a try?
Thanks.
Yujing
From: freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu> On Behalf Of Mateo Jean Sent: Tuesday, April 26, 2022 7:51 AM To: freesurfer <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Subject: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
External Email - Use Caution Hello FreeSurfer Developers
I hope i don't spam, if anyone has a clue...
I need to convert 512 dicom files from Bruker into .nii . I firstly add .dcm to my Bruker multi gradient echo phase files then enter the following command : mri_convert MRIm001.dcm phaseMGE.nii
Here is the first message :
reading from MRIm001.dcm... Starting DICOMRead2() dcmfile = /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm dcmdir = /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2 ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH -- ERROR: GetDICOMInfo(): dcmGetDWIParams() 1 DICOM File: /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm break /home/rd521/space_freesurfer/build/docker_ubuntu18/trunk/rd521-7.2.0/utils/DICOMRead.cpp:4930 Ref Series No = 4 Found 514 files, checking for dicoms ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH -- ERROR: GetDICOMInfo(): dcmGetDWIParams() 1 DICOM File: /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm break /home/rd521/space_freesurfer/build/docker_ubuntu18/trunk/rd521-7.2.0/utils/DICOMRead.cpp:4930 ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH -- ERROR: GetDICOMInfo(): dcmGetDWIParams() 1
Then 508 error messages like the three last lines appear. It ends with :
First Sorting Computing Slice Direction Vs: 0 0 1 Vs: 0 0 1 Second Sorting IsDWI = 0, IsPhilipsDWI = 0 Counting frames nframes = 8 nslices = 63 ndcmfiles = 508 ERROR: the number of frames * number of slices does not equal the number of dicom files.
I did a test with only 448 files (I just copy-paste the first 448 files = 7 TE * 64 slices) and I obtained the same error messages but the nifti files are created and seem usable (quick test with Fiji). Here are the last lines :
First Sorting Computing Slice Direction Vs: 0 0 1 Vs: 0 0 1 Second Sorting IsDWI = 1, IsPhilipsDWI = 0 Counting frames nframes = 7 nslices = 64 ndcmfiles = 448 INFO: rescale not needed PE Dir = COL (dicom read) Loading pixel data TR=50.00, TE=3.10, TI=0.00, flip angle=15.00 i_ras = (-1, -0, 0) j_ras = (-0, -1, 0) k_ras = (-0, -0, 1) writing to phaseMGR.nii... Saving bvals and bvecs
I'm pretty new with mri convert and I don't understand why it stops converting to nii with 512 files (8 TE) but not 448 files for Brucker files.
Best Regards,
Mateo
Version: freesurfer-linux-ubuntu18_x86_64-7.2.0-20210721-aa8f76b
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurferhttps://secure-web.cisco.com/1cMvJLcArlCaffsfxHtRypj2umnjyAVwKoz80_9fJACw18k1udcWUOLghfIfGPsak5bwgXo4OSkUFs4JzBUTKS9AAp6m1zquowItne8a8sWPsYem1pj0rUgJIKW-4vjaQ-_mWVNO95pGy-Vn7odssRBADmf4dghnEseub0lI96qwYF8FJUEGQL2K93qBrKifQ_VZUzSGHLQPnEI3sgzxH2UehNo8QpdMDxIT9n4o2VEdLbwZTSYaxOFTiTamP_NaxlBp3WXu_1kAT_6tW1dP4oeFp3Z6lGFLr9sahcXbdoSKCyEgw1W-uu_BUY9Y7sDVK/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Ffreesurfer The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://www.massgeneralbrigham.org/compliancelinehttps://secure-web.cisco.com/1ode8nsaR9dNNr1hYzOJTCQxvSkhn29K75je2epfC4SMvNKrZ6nUqIGYCrtv3AtIYxCpbtElEHuKOz7sP798PEdk3iYpCFWDbhF5VWq1OV7kZPzgMMMQ1KiGuWezHYrOwzv746cLJJSyQt7NUO14czGrooeMY1bGYWywZERQ3EGXPS4TQM0NmCOhXyKhVnz6XONAPeTfbkcIEPnCLcMIB5j0p9ZAFGmF0GymcLVr0a9ox4BaGLrMv8ILCVryNfKTWXuTPmC-gL_ocPateuwaxqN3fZL-9GO11VPOiAeAWAGdsJ-LX0gi_VfJAcajj80Gt/https%3A%2F%2Fwww.massgeneralbrigham.org%2Fcomplianceline <MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://www.massgeneralbrigham.org/compliancelinehttps://secure-web.cisco.com/1ode8nsaR9dNNr1hYzOJTCQxvSkhn29K75je2epfC4SMvNKrZ6nUqIGYCrtv3AtIYxCpbtElEHuKOz7sP798PEdk3iYpCFWDbhF5VWq1OV7kZPzgMMMQ1KiGuWezHYrOwzv746cLJJSyQt7NUO14czGrooeMY1bGYWywZERQ3EGXPS4TQM0NmCOhXyKhVnz6XONAPeTfbkcIEPnCLcMIB5j0p9ZAFGmF0GymcLVr0a9ox4BaGLrMv8ILCVryNfKTWXuTPmC-gL_ocPateuwaxqN3fZL-9GO11VPOiAeAWAGdsJ-LX0gi_VfJAcajj80Gt/https%3A%2F%2Fwww.massgeneralbrigham.org%2Fcomplianceline> . Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline https://www.massgeneralbrigham.org/complianceline . Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.
Hi Mateo,
Sorry, I’m confused by your question.
Can you try to rerun mri_convert by passing it additional flag ‘--rescale-dicom’, or setting environment variable FS_RESCALE_DICOM to 1?
Hope that will solve your problem. Repost your question in a different thread is a good idea since it is a different problem now.
Best,
Yujing
From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu On Behalf Of Huang, Yujing Sent: Thursday, April 28, 2022 10:00 AM To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
Hi Mateo,
I’m glad mri_convert works for you now.
I’m little confused about the value ranges you saw. We map DT_SIGNED_SHORT (-32766~32766) to signed short. mri_info should give ‘type: SHORT (4)’.
In Freesurfer 7.2, we don’t support DT_UINT16. We map DT_UINT16 (0~65535) to signed short. You will see value maxed at 32766 for DT_UINT16. Is this what you were experiencing?
Yujing
From: freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu> On Behalf Of Mateo Jean Sent: Thursday, April 28, 2022 6:06 AM To: freesurfer <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
External Email - Use Caution Hi,
Thanks! It works I guess. I didn't manage to use setenv in the command line before using mri_convert (command not found)
But I did the following modifications and mri_convert works now (it doesn't put the error message anymore and I have the nifti file at the end) : ---------------------------------------------------------------------------------------------------------------------------------------- Opening ubuntu
$cd then >$ nano .bashrc
And I write just before the source /path/freesurfer/7.2.0/SetUpFreeSurfer.sh the line : export FS_LOAD_DWI=0
Then I change the directory to freesurfer : >$ cd /path//freesurfer/7.2.0 and open the csh : >$nano SetUpFreeSurfer.csh I add setenv FS_LOAD_DWI before the line source $FREESURFER_HOME/FreeSurferEnv.csh ---------------------------------------------------------------------------------------------------------------------------------------- I suppose this locks the DWI to zero and I need to remodify it if one day I want to use Diffusion data.
So mri_convert for Bruker data now works. The last problem (and I might create an other post) is that negative values were not kept. When I compared phase imagec converted in nifti with 3D slicer and phase image converted in nifti with mri_convert, 3D slicer's nifti have values ranging from - 32 766 to 32 766 while mri_convert's nifti only have values ranging from 0 to 32 767.
How can I set mri_convert to convert values in signed-16 bits ?
Thank you for your previous answer !!!
Best Regards,
Mateo
________________________________ De: "Huang, Yujing" <YHUANG43@mgh.harvard.edumailto:YHUANG43@mgh.harvard.edu> À: "freesurfer" <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Envoyé: Mercredi 27 Avril 2022 15:20:37 Objet: Re: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
I’m assuming you didn’t source .bashrc after editing it.
You can actually set it on the command line before submitting mri_convert. So, the setting only affect that window. You can use echo $FS_LOAD_DWI to verify the setting.
Here is an example for csh:
echo $FS_LOAD_DWI
FS_LOAD_DWI: Undefined variable.
setenv FS_LOAD_DWI 0 echo $FS_LOAD_DWI
0
mri_convert …
I’m hoping it will solve your problem by setting the environment variable.
Best,
Yujing
From: freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu> On Behalf Of Mateo Jean Sent: Wednesday, April 27, 2022 8:16 AM To: freesurfer <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Subject: Re: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
External Email - Use Caution Thank you for your answer.
Even though I don't need the DTI values, I can't avoid this message :
"ERROR: the number of frames * number of slices does not equal the number of dicom files."
I'm not very familiar with Ubuntu too so I might have made a mistake :
I try to set the environnement variable ‘export FS_LOAD_DWI = 0’ in bash (I use the command $cd then $nano .bashrc and write after export FS_LICENSE=/home/jeanmri/license.txt export FREESURFER_HOME=/home/jeanmri/freesurfer/7.2.0 the line export FS_LOAD_DWI = 0)
Then I open with nano the FreeSurferEnv.csh and add setenv FS_LOAD_DWI 0 at the end but when I use mri_convert on my bruker dicom files, the same error reappeared.
Did I miss something ?
Best Regards,
Mateo
________________________________ De: "Huang, Yujing" <YHUANG43@MGH.HARVARD.EDUmailto:YHUANG43@MGH.HARVARD.EDU> À: "freesurfer" <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Envoyé: Mardi 26 Avril 2022 21:22:28 Objet: Re: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
Hi Mateo,
It looks like mri_convert terminated prematurely when you tried to convert those 512 dicom files.
Those error messages are printed when mri_convert wasn’t able to retrieve DTI information from dicom. If you don’t need the DTI values, you can ignore those error messages.
Also, looking at the codes, I think if you set environment variable FS_LOAD_DWI to 0 before running mri_convert, it should finish convert all 512 dicom files. To set the environment variable, you do ‘export FS_LOAD_DWI = 0’ in bash, and ‘setenv FS_LOAD_DWI 0’ in csh.
Can you give it a try?
Thanks.
Yujing
From: freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu> On Behalf Of Mateo Jean Sent: Tuesday, April 26, 2022 7:51 AM To: freesurfer <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Subject: [Freesurfer] Mri Convert Bruker MGRE files dicom to nii error
External Email - Use Caution Hello FreeSurfer Developers
I hope i don't spam, if anyone has a clue...
I need to convert 512 dicom files from Bruker into .nii . I firstly add .dcm to my Bruker multi gradient echo phase files then enter the following command : mri_convert MRIm001.dcm phaseMGE.nii
Here is the first message :
reading from MRIm001.dcm... Starting DICOMRead2() dcmfile = /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm dcmdir = /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2 ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH -- ERROR: GetDICOMInfo(): dcmGetDWIParams() 1 DICOM File: /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm break /home/rd521/space_freesurfer/build/docker_ubuntu18/trunk/rd521-7.2.0/utils/DICOMRead.cpp:4930 Ref Series No = 4 Found 514 files, checking for dicoms ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH -- ERROR: GetDICOMInfo(): dcmGetDWIParams() 1 DICOM File: /mnt/c/Users/Sahadatou/Documents/Stage_JEAN_2022/data/fantomes/tests/bug_test2/MRIm001.dcm break /home/rd521/space_freesurfer/build/docker_ubuntu18/trunk/rd521-7.2.0/utils/DICOMRead.cpp:4930 ERROR: don't know how to get DWI parameters from --Bruker BioSpin MRI GmbH -- ERROR: GetDICOMInfo(): dcmGetDWIParams() 1
Then 508 error messages like the three last lines appear. It ends with :
First Sorting Computing Slice Direction Vs: 0 0 1 Vs: 0 0 1 Second Sorting IsDWI = 0, IsPhilipsDWI = 0 Counting frames nframes = 8 nslices = 63 ndcmfiles = 508 ERROR: the number of frames * number of slices does not equal the number of dicom files.
I did a test with only 448 files (I just copy-paste the first 448 files = 7 TE * 64 slices) and I obtained the same error messages but the nifti files are created and seem usable (quick test with Fiji). Here are the last lines :
First Sorting Computing Slice Direction Vs: 0 0 1 Vs: 0 0 1 Second Sorting IsDWI = 1, IsPhilipsDWI = 0 Counting frames nframes = 7 nslices = 64 ndcmfiles = 448 INFO: rescale not needed PE Dir = COL (dicom read) Loading pixel data TR=50.00, TE=3.10, TI=0.00, flip angle=15.00 i_ras = (-1, -0, 0) j_ras = (-0, -1, 0) k_ras = (-0, -0, 1) writing to phaseMGR.nii... Saving bvals and bvecs
I'm pretty new with mri convert and I don't understand why it stops converting to nii with 512 files (8 TE) but not 448 files for Brucker files.
Best Regards,
Mateo
Version: freesurfer-linux-ubuntu18_x86_64-7.2.0-20210721-aa8f76b
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurferhttps://secure-web.cisco.com/1cMvJLcArlCaffsfxHtRypj2umnjyAVwKoz80_9fJACw18k1udcWUOLghfIfGPsak5bwgXo4OSkUFs4JzBUTKS9AAp6m1zquowItne8a8sWPsYem1pj0rUgJIKW-4vjaQ-_mWVNO95pGy-Vn7odssRBADmf4dghnEseub0lI96qwYF8FJUEGQL2K93qBrKifQ_VZUzSGHLQPnEI3sgzxH2UehNo8QpdMDxIT9n4o2VEdLbwZTSYaxOFTiTamP_NaxlBp3WXu_1kAT_6tW1dP4oeFp3Z6lGFLr9sahcXbdoSKCyEgw1W-uu_BUY9Y7sDVK/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Ffreesurfer The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://www.massgeneralbrigham.org/compliancelinehttps://secure-web.cisco.com/1ode8nsaR9dNNr1hYzOJTCQxvSkhn29K75je2epfC4SMvNKrZ6nUqIGYCrtv3AtIYxCpbtElEHuKOz7sP798PEdk3iYpCFWDbhF5VWq1OV7kZPzgMMMQ1KiGuWezHYrOwzv746cLJJSyQt7NUO14czGrooeMY1bGYWywZERQ3EGXPS4TQM0NmCOhXyKhVnz6XONAPeTfbkcIEPnCLcMIB5j0p9ZAFGmF0GymcLVr0a9ox4BaGLrMv8ILCVryNfKTWXuTPmC-gL_ocPateuwaxqN3fZL-9GO11VPOiAeAWAGdsJ-LX0gi_VfJAcajj80Gt/https%3A%2F%2Fwww.massgeneralbrigham.org%2Fcomplianceline <MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://www.massgeneralbrigham.org/compliancelinehttps://secure-web.cisco.com/1ode8nsaR9dNNr1hYzOJTCQxvSkhn29K75je2epfC4SMvNKrZ6nUqIGYCrtv3AtIYxCpbtElEHuKOz7sP798PEdk3iYpCFWDbhF5VWq1OV7kZPzgMMMQ1KiGuWezHYrOwzv746cLJJSyQt7NUO14czGrooeMY1bGYWywZERQ3EGXPS4TQM0NmCOhXyKhVnz6XONAPeTfbkcIEPnCLcMIB5j0p9ZAFGmF0GymcLVr0a9ox4BaGLrMv8ILCVryNfKTWXuTPmC-gL_ocPateuwaxqN3fZL-9GO11VPOiAeAWAGdsJ-LX0gi_VfJAcajj80Gt/https%3A%2F%2Fwww.massgeneralbrigham.org%2Fcomplianceline> . Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline https://www.massgeneralbrigham.org/complianceline . Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.
freesurfer@nmr.mgh.harvard.edu