Saturday, May 18, 2013
Google Custom Search

Our Community

Membership Membership:
Latest New User Latest: andresg
New Today New Today: 2
New Yesterday New Yesterday: 12
User Count Overall: 28632

People Online People Online:
Visitors Visitors: 5
Members Members: 0
Total Total: 5

Online Now Online Now:

ClearCanvas Community Forums

We've moved our Developer Forums!
To better assist our open source community, we have moved our repository and developer forums to GitHub. You can access the new developer forums on our ClearCanvas GitHub issues board.

Displaying annotation value with a '\' and functional group
Last Post 2012-08-13 08:55 AM by stewart. 4 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
mfaizan
New Member
New Member
Posts:4

--
2012-07-27 07:15 PM

Hi, 

I have written plugin with a custom annotation provider for a client. It is working fine for the most part, except for two issues.

 

1. If the tag is part of a functional group, the program can't find the tag when I try to access it as follows.

_annotationItems.Add(
new DicomAnnotationItem<string>("000882144", resolver, delegate(Frame frame) { try { return frame.ParentImageSop[System.Convert.ToUInt32("00082144", 16)].GetString(0, null); } catch { return ""; } }, DicomDataFormatHelper.RawStringFormat));

2. If the tag contains a value, that has a backslash '\' in it, the above statement only returns me the left portion before the first slash. For example, '07/27/2012' will be returned as 07. This rather seems to be the default behavior in ClearCanvas, as we modified one of the tags that is displayed by default annotation settings, and clear canvas only display the left portion of the string before the first slash. The tag id is '0018, 1030' (aquisition matrix) and the type is US 

 

I am using ClearCanvas Workstation 2.0 SP1, Visual Studio 2010, c#

Appreciate if someone can help me with either of the above issues. Let me know if I should post more information.

Thanks -

mfaizan
New Member
New Member
Posts:4

--
2012-08-02 04:29 PM
Wondering if anyone has any clue. Please let me know if Posted in the wrong forum, as to why no one might have looked at this post.

- Thanks
stewart
Senior Member
Senior Member
Posts:2336

--
2012-08-06 08:35 AM
For #1, DICOM tags are hexadecimal values, so the string conversion will probably produce the wrong uint value. You can just do this:

frame.ParentImageSop[0x00082144] ...

For #2, GetString(0, ...) gets the value at index 0. To get all the values, including the backslashes, just call GetStringValue(). If you want to parse them into an array to format them for display, pass the full value to the appropriate method in DicomStringHelper.
Live and real-time support available for Personal and Team Edition customers
mfaizan
New Member
New Member
Posts:4

--
2012-08-06 12:39 PM
Hi Stewart,

Thank you so much for your help.

1. The conversion is actually working fine as all other tags (standard and private) are returning me tag values. I will give hex format a try for functional group.

2. I don't see any method GetStringValue(). This could be because of the version of ClearCanvas (2.0 SP1) I am using. However, I do see Values property that returns me an object. I think i will play around with it and see if I can get any luck with it.

I will post again with my response.

Thanks,
Faizan
stewart
Senior Member
Senior Member
Posts:2336

--
2012-08-13 08:55 AM
Sorry, I was pretty sure we added a GetStringValue to complement SetStringValue, but apparently not. Anyway, DicomAttribute.ToString is what you are looking for; much better than trying to work with the Value/Values members.
Live and real-time support available for Personal and Team Edition customers
You are not authorized to post a reply.

Active Forums 4.1
Copyright 2013 ClearCanvas Inc. All Rights Reserved