Page MenuHomePhabricator

Failure when loading DICOM files with missing series instance UID
Open, NormalPublic

Description

Currently MITK is not able to load explicitly selected dcm files if the have no series instance uid defined.
This tag is required, so DICOM compliant files should always have it. Nevertheless in case of custom written dcm files (e.g. scientific output scripts) it happens that the tag is missing (just had such a case).

Currently you can work arround that problem by loading the whole directory.

Reason for the behavior can be found in function mitk::FilterDICOMFilesForSameSeries (mitkDICOMFileHelpers.cpp); line 70 ff.

auto uid = scanner.GetValue(refFilePath.c_str(), seriesInstanceUIDTag);

if (uid != nullptr)
{
  const std::string refUID = uid;
  scanner.Scan(dicomFiles);
  return scanner.GetAllFilenamesFromTagToValue(seriesInstanceUIDTag, refUID.c_str());
}

scanner.GetValue results in nullptr and therfore all files will be dismissed (same would happen if you try to call scanner.GetAllFilenamesFromTagtoValue with nullptr.

To be discussed: How to deal with it. Option that I see:

  1. keep as is
  2. keep as is, but print a warning
  3. in case no series instance uid only return the refFilePath (thus only the selected file will be loaded) and print a warning that the file is invalid and due to missing series uid. Therefore only the selected file is loaded.
  4. change code so that all files with nullptr should be loaded.

I currently favor option 3.

Event Timeline

I am also in favor of option 3.

floca triaged this task as Normal priority.Feb 21 2024, 11:07 AM
floca removed a project: Request for Discussion.

Result: We take opt 3