how can i create dicom items in sequences?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
veda
Posts: 12
Joined: Fri, 2005-05-13, 05:54
Location: Hyderabad

how can i create dicom items in sequences?

#1 Post by veda »

When i create the second or third sequence items or dcmitems, it is inserting at first position.

Please help me solve this problem
________
Volvo XC60 history
________
Murci?lago
Last edited by veda on Fri, 2011-02-04, 10:33, edited 2 times in total.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

Try the following:

Code: Select all

if (dseq != NULL)
{
    DcmItem *ditem = new DcmItem();
    if (ditem != NULL)
        dseq->insert(ditem);
    else
        status = EC_MemoryExhausted;
}
Or use the DcmItem::findOrCreateSequenceItem() helper function with your DcmDataset.

jlseminara
Posts: 8
Joined: Mon, 2005-05-09, 17:27
Location: argentina, buenos aires
Contact:

#3 Post by jlseminara »

Hello ... I'm interested in image sequences but I can figure out how to do it ... if you succeed would you please share a peace of code ??

thankx
bye

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1437
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#4 Post by Marco Eichelberg »

DICOM objects containing multiple "images" (frames) do not use a sequence structure for encoding the pixel data. They use a direct concatenation of pixel cells inside attribute (7FE0,0010) along with the Multiframe Module that describes properties of the multiframe objects. Details can be found in part 3 of the DICOM standard.

veda
Posts: 12
Joined: Fri, 2005-05-13, 05:54
Location: Hyderabad

creating sequence items

#5 Post by veda »

we are writing the following method CreateDIComSequence() for the client's usage to create new RT file.

unsigned long CreateDIComSequence(unsigned long SliceNo,unsigned long SeqLevel,unsigned long NumSeqItems,unsigned long ItemNum,unsigned long GroupNo, unsigned long ElementNo)
{
DcmDataset *dataset = DataSetArray.GetAt(SliceNo)->getDataset();

OFCondition status;
DcmTag SeqTag(GroupNo,ElementNo,EVR_SQ);
DcmSequenceOfItems *seqitem = new DcmSequenceOfItems(SeqTag);

if(seqitem != NULL)
{
DcmItem *dcItem = new DcmItem();
if (dcItem != NULL)
seqitem->insert(dcItem,OFFalse);
else
status = EC_MemoryExhausted;
}

if(SeqLevel > 0)
{
DcmSequenceOfItems *DSItem = SequenceArray.GetAt(SliceNo);
if(DSItem != NULL)
{
DcmItem *dcItem1 = NULL;
dcItem1 = new DcmItem();
if(dcItem1 != NULL)
{
dcItem1->insert(seqitem,OFFalse);
DSItem->insert(dcItem1,OFFalse);
}

}

return 1;
}

status = dataset->insert(seqitem,OFFalse);
return 1;
}
It will also creates the sequence items in inner levels and changes the different item numbers of item values.
But the problem with this is ,when we insert the second or third items it is inserting at first position only. that means 2nd item is inserting at first position & 1st item is moving to next.
________
buy hot box
Last edited by veda on Thu, 2011-02-03, 21:01, edited 1 time in total.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#6 Post by Jörg Riesmeier »

This is simply because of the parameters you're using to call DcmSequenceOfItems::insert(). Omit the second parameter (OFFalse) and everything should be ok.

Code: Select all

virtual OFCondition insert(DcmItem *item,
                           unsigned long where = DCM_EndOfListIndex,
                           OFBool before = OFFalse);

veda
Posts: 12
Joined: Fri, 2005-05-13, 05:54
Location: Hyderabad

#7 Post by veda »

hi,
I have tried it already.But I didn't get the correct result. It will shows the sequence like


(3006,0010) - RT ROI Referenced Frame of Ref [ -1] Sequence Item
(3006,0012) - RT ROI RT Referenced Study Seq [ -1] Sequence Item
(0008,1150) - ID Referenced SOP Class UID [ 6] first
(3006,0014) - RT ROI RT Referenced Series Se [ -1] Sequence Item
(0020,000E) - REL Series Instance UID [ 6] level2
(3006,0016) - RT ROI Contour Image Sequence [ -1] Sequence Item
(0008,1150) - ID Referenced SOP Class UID [ 6] Value1
(0008,1155) - ID Referenced SOP Instance UID [ 6] Value3
(0008,1150) - ID Referenced SOP Class UID [ 6] Value2
(0008,1155) - ID Referenced SOP Instance UID [ 6] Value3
(3006,0016) - RT ROI Contour Image Sequence [ -1] Sequence Item
(3006,0014) - RT ROI RT Referenced Series Se [ -1] Sequence Item
(3006,0012) - RT ROI RT Referenced Study Seq [ -1] Sequence Item

But my requirement is

(3006,0010) - RT ROI Referenced Frame of Ref [ -1] Sequence Item
(3006,0012) - RT ROI RT Referenced Study Seq [ -1] Sequence Item
(0008,1150) - ID Referenced SOP Class UID [ 6] first
(3006,0014) - RT ROI RT Referenced Series Se [ -1] Sequence Item
(0020,000E) - REL Series Instance UID [ 6] level2
(3006,0016) - RT ROI Contour Image Sequence [ -1] Sequence Item
(0008,1150) - ID Referenced SOP Class UID [ 6] Value1
(0008,1155) - ID Referenced SOP Instance UID [ 6] Value3
(0008,1150) - ID Referenced SOP Class UID [ 6] Value2
(0008,1155) - ID Referenced SOP Instance UID [ 6] Value3
(3006,0012) - RT ROI RT Referenced Study Seq [ -1] Sequence Item
(0008,1150) - ID Referenced SOP Class UID [ 6] second
(3006,0014) - RT ROI RT Referenced Series Se [ -1] Sequence Item
(0020,000E) - REL Series Instance UID [ 6] level2
(3006,0016) - RT ROI Contour Image Sequence [ -1] Sequence Item
(0008,1150) - ID Referenced SOP Class UID [ 6] Value1
(0008,1155) - ID Referenced SOP Instance UID [ 6] Value3
(0008,1150) - ID Referenced SOP Class UID [ 6] Value2
(0008,1155) - ID Referenced SOP Instance UID [ 6] Value3

i don't know ,where the problem is?
________
Continental Mark IV
________
SYNus
Last edited by veda on Fri, 2011-02-04, 10:34, edited 2 times in total.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#8 Post by Jörg Riesmeier »

You could also try DcmSequenceOfItems::append().

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Baidu [Spider], Bing [Bot] and 1 guest