Im trying to modify the value of tag inside of a sequence. I think my problem is that I am a bit confused between DicomObjects and DicomElements. For DicomObjects, I have all the necessary methods, but within a Sequence, and I get the DicomElements, I have not methods to edit the values
So here is a chunk of code and how far I get
....
if ( tagVR == VR.SQ )
{
System.out.println ( "Its a sequence : " );
DicomElement sequence = dcmObj.get( tagEnum );
if ( sequence != null )
{
if ( sequence.hasDicomObjects() )
{
System.out.println("\t...the sequence has " + sequence.countItems() + " items" );
for ( int i = 0; i < sequence.countItems(); i++ )
{
DicomObject subDcmObj = sequence.getDicomObject( i );
Iterator<DicomElement> iter = subDcmObj.iterator();
while ( iter.hasNext() )
{
DicomElement element = iter.next();
System.out.println ( "element has " + element.toString() );
// ...so right here, how do I change the element value? DicomElements have no set methods...
//
....
}
}
}
}
}