Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG FIX] - XA30 DICOM loader - read_dcm_header - CWDJ in #682 #683

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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