Skip to content

Commit

Permalink
Merge pull request #683 from CWDAVIESJENKINS/develop
Browse files Browse the repository at this point in the history
[BUG FIX] - XA30 DICOM loader - read_dcm_header - CWDJ in #682
  • Loading branch information
CWDAVIESJENKINS authored Dec 20, 2023
2 parents 41b5466 + cd07e69 commit 637b340
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion load/dicom_load_tools/read_dcm_header.m
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,38 @@
DicomHeader.deltaFreq = 0;
end

DicomHeader.B0 = dcmHeader.sProtConsistencyInfo.flNominalB0; % Nominal B0 [T]
DicomHeader.dwellTime = dcmHeader.sRXSPEC.alDwellTime0; % dwell time [ns]
DicomHeader.tx_freq = dcmHeader.sTXSPEC.asNucleusInfo0.lFrequency; % Transmitter frequency [Hz]

if isfield(dcmHeader.sProtConsistencyInfo, 'flNominalB0')
DicomHeader.B0 = dcmHeader.sProtConsistencyInfo.flNominalB0; % Nominal B0 [T]
else % XA30 missing this field, so determine B0 from Tx freq:
Nucleus = dcmHeader.sTXSPEC.asNucleusInfo0.tNucleus;
Nucleus = Nucleus(isstrprop(Nucleus,'alphanum'));

switch strtrim(Nucleus) % Determine correct Gyromagnetic ratio for the Nucleus (3 s.f.):
case '1H'
gamma = 42.577;
case '2H'
gamma = 6.536;
case '3HE'
gamma = -32.434;
case '7LI'
gamma = 16.546;
case '13C'
gamma = 10.708;
case '19F'
gamma = 40.052;
case '23NA'
gamma = 11.262;
case '31P'
gamma = 17.235;
case '129XE'
gamma = -11.777;
end
DicomHeader.B0 = DicomHeader.tx_freq*1e-6 ./ gamma; % determine B0 from the transmit frequency [T]
end

if isfield(dcmHeader,'PatientPosition')
DicomHeader.PatientPosition = dcmHeader.PatientPosition;
end
Expand Down

0 comments on commit 637b340

Please sign in to comment.