how can i create dicom items in sequences?
Moderator: Moderator Team
how can i create dicom items in sequences?
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
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.
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
Try the following:
Or use the DcmItem::findOrCreateSequenceItem() helper function with your DcmDataset.
Code: Select all
if (dseq != NULL)
{
DcmItem *ditem = new DcmItem();
if (ditem != NULL)
dseq->insert(ditem);
else
status = EC_MemoryExhausted;
}
-
- Posts: 8
- Joined: Mon, 2005-05-09, 17:27
- Location: argentina, buenos aires
- Contact:
-
- OFFIS DICOM Team
- Posts: 1437
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
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.
creating sequence items
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
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.
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
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);
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
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.
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
Who is online
Users browsing this forum: Ahrefs [Bot], Baidu [Spider], Bing [Bot] and 1 guest