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 = 0in 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
MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be 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 MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://www.massgeneralbrigham.org/complianceline <MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be 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 mailing list
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.