How do I add a sequence tag?

311 views
Skip to first unread message

Joe W.

unread,
May 1, 2015, 12:49:07 PM5/1/15
to dcm...@googlegroups.com


I am new to dcm4che3 and I need help writing a vr.sq tag. I searched the documentation and available example but still need help and/or a sample.


I am constructing an XC modality dicom file and it requires an Anatomic Region Sequence.

Tag (0008,2218)


I want to insert a sequence with a Coding Scheme Designator of SRT, code value of R-1021A, code meaning of “Eye”.


How do I apply this into the Attributes list?


Thank you very much for the help.




This is a segment of the code I have tried



……

Attributes dicom = new Attributes();

dicom.setString(Tag.PerformingPhysicianName, VR.PN, sgPhysicianID);
dicom.setString(Tag.AdmittingDiagnosesDescription, VR.LO, sgDiag);

Attributes Ars = new Attributes();

byte[] ItemStart = {0xF,0xF,0xF,0xE,0xE,0x0,0x0,0x0}; //FFFE,E000

byte[] ItemEnd = {0xF,0xF,0xF,0xE,0xE,0x0,0x0,0xD}; //FFFE,E00D

byte[] SeqEnd = {0xF,0xF,0xF,0xE,0xE,0x0,0xD,0xD}; //FFFE,E0DD


Ars.setBytes(Tag.SequenceDelimitationItem, VR.CS, ItemStart);


Ars.setString(Tag.CodingSchemeDesignator, VR.SH, "SRT");

Ars.setString(Tag.CodeValue, VR.SH, "T-AA000");

Ars.setString(Tag.CodeMeaning, VR.LO, "Eye");


Ars.setBytes(Tag.ItemDelimitationItem, VR.CS, ItemEnd);

Ars.setBytes(Tag.SequenceDelimitationItem, VR.CS, SeqEnd);


Ars.setInt(Tag.FileMetaInformationGroupLength, VR.UL, Ars.size());


dicom.setValue(Tag.AnatomicRegionSequence, VR.SQ, Ars);

……….


I get an java.lang.UnsupportedOperationException error.


Dimitri Pianeta

unread,
May 2, 2015, 2:57:27 AM5/2/15
to dcm...@googlegroups.com

My solution is following :

  dicom.setString(Tag.PerformingPhysicianName, VR.PN, "Jean");
             dicom.setString(Tag.AdmittingDiagnosesDescription, VR.LO, "CHU");
                Sequence seq= dicom.newSequence(Tag.AnatomicRegionSequence,0);
                    Attributes dicom2 = new Attributes(); 
                   
                    dicom2.setString(Tag.CodingSchemeDesignator, VR.SH, "SRT");
                    dicom2.setString(Tag.CodeValue, VR.SH, "T-AA000");
                    dicom2.setString(Tag.CodeMeaning, VR.LO, "Eye");             
                seq.add(dicom2);
            
            

Joe W.

unread,
May 2, 2015, 9:32:47 AM5/2/15
to dcm...@googlegroups.com
WOW, Easy when you do it. :-)

I tested and it and it works for me. Thank you for the quick response.

Joe
Reply all
Reply to author
Forward
0 new messages