DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Mon, 2017-12-18, 21:11

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue, 2017-11-21, 18:16 
Offline

Joined: Tue, 2017-11-21, 17:47
Posts: 2
Hi,

I have been struggling to insert a sequence, but with an undefined length, into a data set.
The insertion of the sequence, as well as the insertion of all direct and indirect childs, is done correctly though.

But when I load the DICOM filed generated with Sante DICOM Hexadecimal Viewer I get this:

http://www.hostingpics.net/viewer.php?id=583912sequenceSaved.png

We can see that the Data Size property value is different from FFFFFFFF (that corresponds to the undefined length value -1) and that it has been automatically calculated.

Here is the code I use:
Code:
dcmSQ = new DcmSequenceOfItems(DcmTag(DcmTagKey(group, element), DcmVR(EVR_SQ)), 0xFFFFFFFF);
OFCondition ret = item->insert(dcmSQ);
if (!ret.good())
{
      delete dcmSQ;
      return;
}


How can I modifiy my code to get the Data Size property of my sequence to have its value equal to FFFFFFFF ?

Here the result I'm looking for:
http://www.hostingpics.net/viewer.php?id=956593sequenceBefore.png

Thanks in advance !


Top
 Profile  
 
PostPosted: Tue, 2017-11-21, 18:23 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1651
Location: Oldenburg, Germany
Hi,

you don't have to care about length or undefined length when adding a sequence or item.

Once you want to write the dataset to network or a file, you can use an option to specify whether you want to have sequences written with either
  • With explicit length (applied to all sequences/items, then)
  • With undefined length (applied to all sequences/items, then). This is the default.

See for example the saveFile() method from DcmFileformat. The encodingType value is the relevant one. Click on the datatype to see the possible values.

Is this sufficient for you or do you need to create a mixed dataset (i.e. some items/sequences with undefined length, some with explicit length) from scratch?

Best,
Michael


Top
 Profile  
 
PostPosted: Tue, 2017-11-21, 19:04 
Offline

Joined: Tue, 2017-11-21, 17:47
Posts: 2
Thank you Good Sir,
That is exactly what I was looking for ! :D

Just out of curiosity, and in case of a possible further need, how do we do a such mixed data set ?


Top
 Profile  
 
PostPosted: Wed, 2017-11-22, 11:22 
Offline
DCMTK Developer

Joined: Fri, 2004-11-05, 13:47
Posts: 1651
Location: Oldenburg, Germany
Hi,

it's not possible with DCMTK to write mixed files (to my knowledge :roll:), since we don't think this makes much sense (though it's valid DICOM). So we only allow to write out all sequences and items with either defined or undefined length, consistently.

Best regards,
Michael


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

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


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group