Browsing this Thread:   1 Anonymous Users


 Bottom   Previous Topic   Next Topic  Register To Post



Dicom Tags
Quite a regular
Joined:
2009/11/16 8:02
Group:
Registered Users
Posts: 14
Level : 2; EXP : 50
HP : 0 / 37
MP : 4 / 560
Offline
Hello,

I want to read a tag from the Dicom File, for example "Patient Name". Can I do it with DVTk Library?

Thanks

Posted on: 2010/1/4 15:59
Transfer the post to other applications Transfer


Re: Dicom Tags
Quite a regular
Joined:
2009/11/16 8:02
Group:
Registered Users
Posts: 14
Level : 2; EXP : 50
HP : 0 / 37
MP : 4 / 560
Offline
Open in new window


I couldnt find "Values" member in attribute class. If I use "DvtkHighLevelInterface.Dicom.Other.Attribute" reference, .NET can't convert DvtkData.Dimse.Attribute to it.

How can I get value by this way?

Posted on: 2010/1/5 10:23
Transfer the post to other applications Transfer


Re: Dicom Tags
Quite a regular
Joined:
2009/11/16 8:02
Group:
Registered Users
Posts: 14
Level : 2; EXP : 50
HP : 0 / 37
MP : 4 / 560
Offline

Posted on: 2010/1/5 10:24
Transfer the post to other applications Transfer


Re: Dicom Tags
Quite a regular
Joined:
2009/11/16 8:02
Group:
Registered Users
Posts: 14
Level : 2; EXP : 50
HP : 0 / 37
MP : 4 / 560
Offline
public string readDicomFile(string filePath)
{
string protocol="";
DicomFile dcFile = new DicomFile();
DvtkData.Dimse.Tag dcmTag = new DvtkData.Dimse.Tag(0008, 0032);
dcFile.Read(filePath);

DvtkData.Dimse.Attribute attribute = dcFile.DataSet.DvtkDataDataSet.GetAttribute(dcmTag);
attribute.???
return protocol;
}

Posted on: 2010/1/5 10:25
Transfer the post to other applications Transfer


Re: Dicom Tags
Core Team Member
Joined:
2005/9/15 8:27
From Bangalore, INDIA
Group:
Webmasters
Registered Users
Core Developers
Content Owners
Posts: 117
Level : 9; EXP : 84
HP : 0 / 221
MP : 39 / 5987
Offline

Hi,

I think you are looking for following sample code:

public string readDicomFile(string filePath)
{
string protocol="";
DicomFile dcFile = new DicomFile();

dcFile.Read(filePath);

// Get the Attribute

DvtkHighLevelInterface.Dicom.Other.Attribute attr = dcFile.DataSet["0x00080032"];

string attrValue = attr.Values[0];

return protocol;
}

Regards,

Piyush


Posted on: 2010/1/5 12:34
Transfer the post to other applications Transfer


Re: Dicom Tags
Quite a regular
Joined:
2009/11/16 8:02
Group:
Registered Users
Posts: 14
Level : 2; EXP : 50
HP : 0 / 37
MP : 4 / 560
Offline
Thank you for your help. I've tried other way and it's working now. It's like;


public int readDicomFile(string filePath)
{
            
string protocol;
            
int varDicom 0;
            
DicomFile dcFile = new DicomFile();
            
dcFile.Read(filePath);

            
DvtkData.Dimse.Attribute attribute dcFile.DataSet.DvtkDataDataSet.GetAttribute(0x00200012);
            
DvtkData.Dimse.IntegerString dt = (DvtkData.Dimse.IntegerString)attribute.DicomValue;
            
protocol dt.Values[0];
            
varDicom Convert.ToInt32(protocol);
            return 
varDicom;
        }


Thank you again.

Posted on: 2010/1/5 15:31
Transfer the post to other applications Transfer


Re: Dicom Tags
Quite a regular
Joined:
2009/11/16 8:02
Group:
Registered Users
Posts: 14
Level : 2; EXP : 50
HP : 0 / 37
MP : 4 / 560
Offline
I've got another question :)

In your code examples, you use group and element number to get value. In the code part above, I get an "Acquisition Time" value. Can I get the attribute value by using tag name (Acquisition Time) ?

Posted on: 2010/1/7 9:51
Transfer the post to other applications Transfer


Re: Dicom Tags
Core Team Member
Joined:
2005/9/15 8:27
From Bangalore, INDIA
Group:
Webmasters
Registered Users
Core Developers
Content Owners
Posts: 117
Level : 9; EXP : 84
HP : 0 / 221
MP : 39 / 5987
Offline

Hi,

No, you can't get attribute by Attribute name. Attribute tag is unique for attribute and doesn't change but attribute name may change in future.

Regards,

Piyush


Posted on: 2010/1/8 4:51
Transfer the post to other applications Transfer


Re: Dicom Tags
Quite a regular
Joined:
2009/11/16 8:02
Group:
Registered Users
Posts: 14
Level : 2; EXP : 50
HP : 0 / 37
MP : 4 / 560
Offline
Thank you, i'm going to use group and element number for that.

Best regards

Posted on: 2010/1/11 8:36
Transfer the post to other applications Transfer



 Top   Previous Topic   Next Topic

 Register To Post


You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.

[Advanced Search]