How to make presentationLUTData

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
m-ishihara
Posts: 40
Joined: Thu, 2008-09-18, 09:20
Location: Japan

How to make presentationLUTData

#1 Post by m-ishihara »

Hi forks,

I am not the person who sent this question originally.
But I have a very simple and important problem.
So, I would appriciate it if someone answer my question.

I am tring to implement to apply PresentationLUT data from outside of the DICOM file to the DICOM image.
But I don't know how to make the PresentationLUT data with DcmUnsignedShort.
Once I tried to make DcmUnsignedShort data, as follows;

unsigned short *ee = new unsigned short[8];
ee[0]=0;
ee[1]=1;
ee[2]=2;
ee[3]=3;
ee[4]=4;
ee[5]=5;
ee[6]=6;
ee[7]=7;

DcmUnsignedShort *data;
data = (DcmUnsignedShort *)ee;

But the "data" which come as a consequence weren't the intended data.
Please tell me how to make the DcmUnsignedShort data from unsigned short data.

Thanks,
Maty

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

The little tool "dcmmklut" shows how to create presentation LUT data and add the required attributes to a DICOM file.

m-ishihara
Posts: 40
Joined: Thu, 2008-09-18, 09:20
Location: Japan

#3 Post by m-ishihara »

Hi Jörg,

Thank you for your help.
BTW, I tried to make the source code to put PresentationLut made by user into the DICOM image.
The sample program is as follows;


//PresentationLut
DcmUnsignedShort *presentationLUTDescriptor = new DcmUnsignedShort(DCM_LUTDescriptor);
DcmUnsignedShort *presentationLUTData = new DcmUnsignedShort(DCM_LUTData);
presentationLUTDescriptor->putUint16(1);
presentationLUTDescriptor->putUint16(1);
presentationLUTDescriptor->putUint16(16);
presentationLUTData->putUint16(1);
dcmimage->setPresentationLut(*presentationLUTData, *presentationLUTDescriptor);


Is this code OK?
If there is something wrong, please let me know.

Thanks,
Maty

m-ishihara
Posts: 40
Joined: Thu, 2008-09-18, 09:20
Location: Japan

#4 Post by m-ishihara »

Hello DICOM @ OFFIS,

Thank you for your help everyday.
BTW, I recognized that the source code I wrote yesterday was wrong and found out the correct coding to apply PresentationLut.
So, I don't need more reply for this issue.

Thank you very much for your help!
Maty

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest