[Dcmlib] Question regarding reading data entries other then strings

Jean-Pierre Roux jpr at creatis.insa-lyon.fr
Wed Jan 23 10:08:48 CET 2008


Neerav Patel wrote:
> Hi,
>  
> I have a dicom image with a (x,y,z) parameter sitting at 0x0018, 
> 0x5212 and it looks like the following when I open it up with a dicom 
> viewer
>  
> How does one grab that,  I tried using
>  
> float * temp = new float[3];
> temp = (float * ) f->GetEntryBinArea( 0x0018, 0x5212 ); 

Hi, Neerav.
I think I answered the wrong mail.

--> 0x0018, 0x5212 is not a binary element, but as "DS" -Decimal String-
To get the values, you must use something like :
DataEntry *e_0018_5212 = f->GetDataEntry(0x0018, 0x5212);
std::vector <double> valueVector;
bool res = e_0018_5212->GetDSValue(valueVector);
if (!res)
   std::cout << "Sorry, you cannot use GetDSValue on non DS DataElement" ...

HTH

JPRx
>  
> but the data is all garbage in there.  what am I doing wrong?
>  
> Thanks for the help in advance.
>  
> Neerav Patel
>  
> 0002,0000,File Meta Elements Group Len=156
> 0002,0001,File Meta Info Version=256
> 0002,0002,Media Storage SOP Class UID=1.2.840.10008.5.1.4.1.1.6.1.
> 0002,0003,Media Storage SOP Inst 
> UID=1.2.246.352.91.0004141.20061121092559304644.
> 0002,0010,Transfer Syntax UID=1.2.840.10008.1.2.
> 0002,0012,Implementation Class UID=1.2.246.352.70.2.1.7
> 0008,0008,Image Type=ENDORECTAL
> 0008,0016,SOP Class UID=1.2.840.10008.5.1.4.1.1.6.1.
> 0008,0018,SOP Instance UID=1.2.246.352.91.0004141.20061121092559304644.
> 0008,0020,Study Date=20060918
> 0008,0030,Study Time=
> 0008,0050,Accession Number=
> 0008,0060,Modality=US
> 0008,0070,Manufacturer=Varian Medical Systems. Inc.
> 0008,0090,Referring Physician's Name=
> 0008,1048,?=Mackenzie.Michael
> 0008,1090,Manufacturer's Model Name=VariSeed
> 0010,0010,Patient's Name=..0523749.t
> 0010,0020,Patient ID=..0523749.t
> 0010,0030,Patient Date of Birth=
> 0010,0040,Patient Sex=
> 0018,1020,Software Version=7.1
> 0018,5210,?=1.00000000\.000000000\.000000000\.000000000\-1.00000000\.000000000
> 0018,5212,?=.000000000\.000000000\.000000000
> 0018,6018,?=0
> 0018,601A,?=0
> 0018,601C,?=800
> 0018,601E,?=600
> 0018,6020,?=0
> 0018,6022,?=0
> 0018,6024,?=3
> 0018,6026,?=3
> 0018,602C,?=4333.-..
> 0018,602E,?=........
> 0020,000D,Study Instance UID=1.2.246.352.91.0004141.20061121092559.
> 0020,000E,Series Instance UID=1.2.246.352.91.0004141.20061121092559.1.
> 0020,0010,Study ID=4141
> 0020,0011,Series Number=
> 0020,0013,Image Number=1
> 0020,0020,Patient Orientation=
> 0020,0052,Frame of Reference 
> UID=1.2.246.352.91.0004141.20061121092559.1.1.
> 0020,1040,Position Reference=
> 0028,0002,Samples Per Pixel=1
> 0028,0004,Photometric Interpretation=MONOCHROME2
> 0028,0010,Rows=600
> 0028,0011,Columns=800
> 0028,0034,Pixel Aspect Ratio=145\147
> 0028,0100,Bits Allocated=8
> 0028,0101,Bits Stored=8
> 0028,0102,High Bit=7
> 0028,0103,Pixel Representation=0
> 0028,1050,Window Center=128.000000
> 0028,1051,Window Width=370.000000
> 7FE0,0010,Pixel Data=480000
>
>
> ------------------------------------------------------------------------
> ------------------------------------------------------------------------
>
> _______________________________________________
> Dcmlib mailing list
> Dcmlib at creatis.insa-lyon.fr
> http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib



More information about the Dcmlib mailing list