Menu

#1 Sequence does not load the last tag.

open
nobody
None
5
2007-11-13
2007-11-13
No

When a sequence gets loaded, the last tag is always missing.

This due to a bug in the "LoadFrom" method from the "Sequence" object.

Replacing the "LoadFrom" method with the one below, solves the problem:

/// <summary>
/// Re-creates a new DICOM sequence instance and fills it with
/// DICOM data elements from specified DICOM output stream using
/// <see cref="Sequence.TransferSyntax" />.
/// </summary>
public virtual void LoadFrom(Stream stream)
{
streamPosition = stream.Position;
DataElement element = null;
bool isTrailingPadding = false;

while (stream.Position < stream.Length)
{
element = new DataElement(stream, TransferSyntax);
if (element.Tag.Equals(DelimiterTag))
break;
isTrailingPadding = element.Tag.Equals("(0000,0000)");
if (!isTrailingPadding)
Add(element);
}
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.