Page MenuHomePhabricator

Failure when loading DICOM files with missing series instance UID
Closed, ResolvedPublic

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

Maybe some extension: it would be nice if a warning could be general for incomplete DICOM files. I recently had a different case where the modality was missing, and at the moment it is quite difficult to figure out what information is missing since there is just a crash with little information.
So if we add a warning here, maybe it could be in a way that works for any required DICOM tags that are missing.

@s434n do you have an example case? One needs to check, if it is the same spote in the call tree (and therefor the same solution) or if your point should be a different ticket.

kislinsk claimed this task.
kislinsk added a project: Moved to git.dkfz.de.

This task was closed here on Phabricator since it was migrated to GitLab. Please continue on GitLab.