DICOM SR and Multiframe

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
falko
Posts: 9
Joined: Fri, 2011-07-29, 16:14

DICOM SR and Multiframe

#1 Post by falko »

We have an already functioning DICOM Structured Report module that generates an SR report using our predefined structure. We are using DSRImageReferenceValue to reference images within the tree. That all worked fine for single-frame images, since every slice/frame had its own SOPInstanceUID.
Now I am extending the code to also support multi-frame data. I saw in the documentation of DSRImageReferenceValue that is has a frame list, so I tried the code below to add the frame index of the multi-frame slice to its frame list. This all compiles but if I check the exported SR file, then I do not find the frame reference anywhere. I also checked in the code of DSRImageReferenceValue and when exported as XML it would show up as a <frames></frames> block, which I also don't find.

Any suggestion on how to fix this issue?

Code: Select all

size_t id = doc->getTree().addContentItem(DSRTypes::RT_selectedFrom, DSRTypes::VT_Image, DSRTypes::AM_belowCurrent);

DSRImageReferenceValue imageRef = DSRImageReferenceValue( SOPClassUID, SOPInstanceUID );

DSRImageFrameList frames = imageRef.getFrameList();
frames.putString( frameIndex );

status = doc->getTree().getCurrentContentItem().setImageReference( imageRef );
Thanks in advance for any hints!

J. Riesmeier
DCMTK Developer
Posts: 2503
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#2 Post by J. Riesmeier »

What does putString() return and how did you separate the frame numbers?

falko
Posts: 9
Joined: Fri, 2011-07-29, 16:14

#3 Post by falko »

putString() returns OF_OK suggesting that everything went fine.
Since I always only reference ONE frame number, I'll just pass in that number, e.g. "2" (represented as string).

J. Riesmeier
DCMTK Developer
Posts: 2503
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#4 Post by J. Riesmeier »

And what is the value of "status" in the last line of your above sample code?

falko
Posts: 9
Joined: Fri, 2011-07-29, 16:14

#5 Post by falko »

The status is always OK, since we evaluate it for bad() status after every step in the process. I just didn't add it in the example to keep it simple to read and understand.

Maybe I miss something here and the text, xml and html exports simply ignore it?

falko
Posts: 9
Joined: Fri, 2011-07-29, 16:14

#6 Post by falko »

Actually, I even tried this:

Code: Select all

OFBool ok = imageRef.appliesToFrame(frameIndex);
And that returns 1, meaning that the image reference stored my frame index properly.
Still it it is not shown with dcmdump or the XML, text or HTML output.

J. Riesmeier
DCMTK Developer
Posts: 2503
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#7 Post by J. Riesmeier »

No, this could also mean that the list of referenced frame numbers is empty (see documentation).

I guess your problem is related to the by-reference return value of getFrameList(). In other words: You are modifying a copy of the frame list :-)
E.g. the following should work if you really prefer putString() (instead of "addItem()"):

Code: Select all

imageRef.getFrameList().putString( frameIndex );

falko
Posts: 9
Joined: Fri, 2011-07-29, 16:14

#8 Post by falko »

Thank you very much Jens! That was it. After putting it in one line instead of two it works fine!

So SR is working properly now - next GSPS (see my other post) :-(

J. Riesmeier
DCMTK Developer
Posts: 2503
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#9 Post by J. Riesmeier »

Adding a "&" to the variable declaration would also work, of course.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest