insert Sequence Item in DICOM Dataset

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
julia_h
Posts: 2
Joined: Mon, 2017-07-17, 18:13

insert Sequence Item in DICOM Dataset

#1 Post by julia_h »

Hi,

I try to insert a Sequence Item in a SmartPtr_DCMDatSet. I tried it the following way:

Code: Select all

DcmItem* dicomItem = new DcmItem(DCM_LongTrianglePointIndexList, triangleVertices.size());		
if (datasetPointer->insertSequenceItem(DCM_SurfaceMeshPrimitivesSequence, dicomItem).bad()) {
      std::cout << "Surface Mesh Primitives Sequence (0066, 0013) can not be generated.\n";
}
It seemed to work, but when I tried to read the generated DICOM Tree I get an error called:
Cerr: E: DcmSequenceOfItems: Parse error in sequence (0066,0013), found (0066,0041) instead of sequence delimiter (fffe,e0dd)

I thought the "insertSequenceItem" method would create the Sequence, if not already existing and I can just add items to the sequence, but obviously it is not working.

Can anybody tell me what I am ding wrong or how I can add such a sequence delimiter?

Thank you in advance! :)

Julia

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: insert Sequence Item in DICOM Dataset

#2 Post by J. Riesmeier »

The first line of your code makes no sense: if you want to create an item with the data element LongTrianglePointIndexList, you should create the DcmItem instance without parameters (i.e. use the default constructor) and insert the data element to it.

This Howto might also be helpful (using Google's cache since the OFFIS server seems to be down).

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest