Skip to content

Commit

Permalink
Disable XA partial vol detection for single slice files (#742)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Reid committed Apr 18, 2024
1 parent d17927e commit 70abd5e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion console/nii_dicom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8041,7 +8041,19 @@ const uint32_t kEffectiveTE = 0x0018 + uint32_t(0x9082 << 16); //FD
//}
if (numberOfFramesICEdims < 2) //issue751: icedims[20] frames for EPI only
numberOfFramesICEdims = 0;
if ((numberOfFramesICEdims > 0) && (d.xyzDim[3] != numberOfFramesICEdims)) {
// Issue 742: Detect *currently* enhanced Siemens XA volumes with fewer
// than the expected number of slices, and mark them as derived, with
// SeriesNumber + 1000. However, valid XA series are often unenhanced,
// likely post-scanner, and can arrive as files with just 1 slice each
// in d.xyzDim[3] but the total number of z locations for the series in
// their ICEdims, so they appear to be partial volumes until the
// dcmList is completed (nii_dicom_batch.cpp). Thus we use the
// heuristic that d.xyzDim[3] == 1 is probably OK but between 1 and
// numberOfFramesICEdims (exclusively) is an enhanced partial
// volume. It would miss the case of a true enhanced partial volume
// with just 1 slice, but that seems much less likely than unenhanced
// DICOM with unmodified ICEDims tags.
if ((numberOfFramesICEdims > 0) && (d.xyzDim[3] > 1) && (d.xyzDim[3] != numberOfFramesICEdims)) {
printWarning("Series %ld includes partial volume (issue 742): %d slices acquired but ICE dims (0021,118e) specifies %d \n", d.seriesNum, d.xyzDim[3], numberOfFramesICEdims);
d.seriesNum += 1000;
d.isDerived = true;
Expand Down

0 comments on commit 70abd5e

Please sign in to comment.