Hi all!
I got an old dataset for resting state analysis from the archives of my lab. It was made around 10 years ago with GE Signa HDxt scanner (3T according to json). There are fieldmap files but they are different I saw before (I had experience with Siemens (mostly) and Phillips). Each subject has two pairs of real and imaginary files. dcm2niix converts them as “real”, “imaginary” and “reala”, “imaginarya”. The difference is in TE, the first pair has 5.3ms both, and the second has 7.6ms. I’m not sure if these files in Hz, as there is no mention of units in json files. I tried to find something, but the majority of the material explains what to do with one pair real/imaginary files, referencing to Phillips. But I have 2 pair with different TE. Unfortunately, I have nobody to ask, the people who worked at this set left academia already. And everybody works with Siemens scanners now.
Can please somebody explain what procedures and steps should I take to convert these files into something I can use for fieldmap correction in FSL? Or maybe what can I do in general?
From what I can understand, your problem is that you have real and imaginary instead of magnitude and phase, as is typical for field maps. Is that correct?
If so, you should be able to convert them to magnitude and phase images. One tool that can do that is mrcalc: see mrcalc — MRtrix 3.0 documentation.
Something like the following might work:
# Convert the real and imaginary values to complex values
mrcalc -complex real_img.nii.gz imag_img.nii.gz out_complex.nii.gz
# Split up the complex values into magnitude and phase
mrcalc -phase out_complex.nii.gz out_phase.nii.gz
mrcalc -abs out_complex.nii.gz out_mag.nii.gz
# out_phase.nii.gz and out_mag.nii.gz will be the phase and magnitude, respectively
Hi! Thank you for your reply!
Yes, in general. But here are two different TE for each pair real/imaginary. In Siemens, the phase image usually contains two TE. According to your guidance, I will get two phase images at the end, each with own TE.
In this case, which one should I use?
Or do I need to calculate something else, to combine these two phase images? I guess, I may miss info if I will use only one.
It probably depends on what your preprocessing pipeline is, but you should be fine keeping the two phase images (and two magnitude images, if you want) separate. That is equivalent to Case 2 in the BIDS field map documentation: Magnetic Resonance Imaging - Brain Imaging Data Structure v1.9.0.
Pipelines like fMRIPrep should handle separate phase images just fine. It won’t use just one- it will use both and calculate the phase-different map internally.
The pipeline I am required to use is standard FSL FEAT way. So, you are also have no information on what to do with two phase images, except to apply fMRIPrep? Maybe is there any other way? The data is old and not in bids. And I am afraid if I apply so different pipelines on these GE data, they will distinct from others made on Siemens.
You will want to refer to the FSL FUGUE manual. If you have issues, search the fsl jiscmail for prior solutions and if you can not find any, post a message there.
This reminds me old memories. I believe on HDxt system the B0Map pulse sequence (giving directly the fielmap in Hertz and a magnitude image) was not available so, at that time, people were using either a 2-echo pulse sequence or 2 acquisitions with two different TEs. And you seems to be in this last case.
You need to make some basic calculation to get the basic fieldmap and magnitude to input into fsl_prepare_fieldmap
. This can be done with FSL tools or others (like mrcalc).
- Convert the real+imag data of the shortest TE (=TE1) into a complex volume (e.g. using fslcomplex). Let’s call that complex image I1.
- Convert the real+imag data of the longest TE (=TE2) into a complex volume (e.g. using fslcomplex). This second image will be called I2.
- Get the magnitude image of I1 (or if you wish also the magnitude of I2)
- Compute deltaTE (TE2-TE1) in milliseconds.
- Compute the phase difference as phase_diff=phase(I2./I1). This can be done with fslmaths and fslcomplex.
- With that you can input that in
fsl_prepare_fieldmap
using SIEMENS mode
fsl_prepare_fieldmap SIEMENS phase_diff magnitude_of_I1 your_output deltaTE
A possible alternative is to do the following for point 5 and point 6.
- Compute the Fieldmap in Hertz as fieldmap_hertz = phase(I2./I1)/(2piDeltaTE). Not that DeltaTE should be in seconds here. This can be done with fslmaths and fslcomplex.
- Run
fsl_prepare_fieldmap
using GEHC_FIELDMAPHZ mode
fsl_prepare_fieldmap GEHC_FIELDMAPHZ fieldmap_hertz magnitude_of_I1 your_output deltaTE
Then you should be good to go.
I’m not sure if you have ever come across GE scans which output two echoes but with zero indication of whether they are complex/imaginary/etc. Quick view for reference:
I’ve uploaded an example in this repository along with the gdcmdump of a central DICOM in the second echo image.
The ImageType
is [“ORIGINAL”, “PRIMARY”, “OTHER”] for both echoes. My initial assumption is that they are complex images based on the FUGUE guide examples. However, running Step 5 with either fslcomplex
or mrcalc
results in a blank image.
Example:
mrcalc GE_MR750Discovery_2Echoes_Complex_e2.nii GE_MR750Discovery_2Echoes_Complex_e1.nii -div -phase phasediff.nii
Side note: curiously, Step 3 causes a segmentation error in fslcomplex
but not in mrcalc
.
Any chance that the provided information is sufficient to suggest a workaround?
Thank you!
EDIT: Full disclosure, the uploaded files are from Series 6 in my dataset. Each visit also has a similar Series 7 which outputs another echo1 and echo2 pair. Perhaps there is a missing piece of the puzzle with this tibit of info
Hi Maurice,
So your using the 2 echoes 2dfast, and I assume you output Magnitude/Phase/Real/Imaginary (or a subset of that).
The ImageType ORIGINAL/PRIMARY/OTHER is related to the DICOM (0008,0008).
see Image Type Attribute – DICOM Standard Browser
This is not expected to give Real/Imaginary/Phase/Magnitude.
On the DICOM side the the image type Magnitude, Phase, Real, Imaginary, Phase is given in DICOM tag (0043,102f) it should says 0,1,2,3 for Magnitude, Phase, Real, Imaginary.
I suggest to start by checking this field in the dicoms.
Then it looks like the images in the repository are of data_type INT16 (so not complex) as revealed by fslinfo filename.nii.
Can you share the dicom ?
Pulling @mr-jaemin he might have some more thoughts.
Thanks Brice for the field suggestion. It has clarified that I seem to only be working with real images. I’m not permitted to share direct DICOM files but I have taken gdcmdump
output and pasted it here after removing certain fields (i.e. patient-related)
So I seem to only be working with “real” numbers here.
(0043,102f) SS 0 # 2,1 Image Type (real, imaginary, phase, magnitude)
And this appears to be the case for all the DICOMs captured w.r.t this acquisition.
dcm2niix (v1.0.20201102 or later) would detect and report them such as REAL, IMAGINARY, PHASE (see dcm2niix’s commit here)
It might be worth to check the tag (0002,0013) ImplementationVersionName whether private tag (0043,102f) might be removed/modified by PACS or other software.
DICOM directly from GE will report:
(0002,0013) SH [MR30.1] # 6, 1 ImplementationVersionName
(0018,1020) LO [30\LX\SIGNA_LX1.MR30.1_DA_2312.g] # 32, 3 SoftwareVersions
Others will report something like:
(0002,0013) SH [dcm4che-1.4.31] # 14, 1 ImplementationVersionName
or
(0002,0013) SH [VERTEX3.6.4.0] # 14, 1 ImplementationVersionName
while SoftwareVersions (0018,1020) SH [RX29.0] remains unchanged.
Hi Maurice,
It seems to be coming from DV22.0 (2012).
This
(0043,102f) SS 0
Indicate that this particular DICOM file is a magnitude image.
Just to make it clear, Magnitude, Phase, Real, Imaginary, are stored in separate files.
(0043,102f) SS 0 => Magnitude
(0043,102f) SS 1 => Phase
(0043,102f) SS 2 => Real
(0043,102f) SS 3 => Imaginary
So I suggest checking what kind of DICOM data you have for this particular series.
It might be that you only have the magnitude images of the 2 echoes.
You can also check the number of DICOM files for that particular series.
It should be (#slices) x (#echoes) x (#ImageType , so 1 or 2 or 3 or 4).
With this, I can’t say much more.
Hope this helps.
This is exactly the case. From the very helpful clarification here, it is now evident that each series is 100 DICOMs, 50 of which become Echo1 magnitude and 50 of which become Echo2 magnitude. To my knowledge, without any phase-information-containing acquisitions, this is a dead end in terms of calculating a field map for distortion correction.
Thanks again.
This is correct: you can not generate a fieldmap with two magnitude images. The FSL FUGUE Guide provides details on how you can reconstruct fieldmaps from other forms of data, including complex (real/imaginary) and phase/magnitude pairs.