access original pixel data

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
nobnet
Posts: 28
Joined: Mon, 2005-02-28, 20:23
Contact:

access original pixel data

#1 Post by nobnet »

I am using DcmDataset to get original pixel data but when I write the array generated one only value is shown. I am using the fallowing code:

DcmFileFormat fileformat;


OFCondition status=fileformat.loadFile(NameImg.text());


if(status.good())
{

fileformat.getDataset()->findAndGetUint16Array(DCM_PixelData,buffer );
}

please give me suggestion.

pboninsk
Posts: 5
Joined: Wed, 2005-03-09, 20:36
Location: Poland
Contact:

#2 Post by pboninsk »

given code looks ok. In my opinion your problem is somewhere else. What about buffer var or way of dealing with buffer ?

nobnet
Posts: 28
Joined: Mon, 2005-02-28, 20:23
Contact:

access original pixel data

#3 Post by nobnet »

thanks!. it was only buffer var that it wasn't NULL and this isn't explicit in documention. I was allocating and the metod finandgetuint16array was failing.

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

#4 Post by Jörg Riesmeier »

I don't think that there are any ambiguities:

Code: Select all

    /** find element and get value as an array of unsigned 16-bit integers.
     *  Applicable to the following VRs: AT, OW, US
     *  The result variable 'value' is automatically set to NULL if an error occurs.
     *  @param tagKey DICOM tag specifying the attribute to be searched for
     *  @param value variable in which the reference to the element value is stored
     *  @param count stores number of items in the result array (if not NULL)
     *  @param searchIntoSub flag indicating whether to search into sequences or not
     *  @return EC_Normal upon success, an error code otherwise.
     */
    OFCondition findAndGetUint16Array(const DcmTagKey &tagKey,
                                      const Uint16 *&value,
                                      unsigned long *count = NULL,
                                      const OFBool searchIntoSub = OFFalse);

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest