Re: [Gdcm2] DataElement.GetByteValue returning NULL
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: Mathieu M. <mat...@gm...> - 2014-09-05 18:13:20
|
You are creating the image for ex-nihilo so the gdcm::imagewriter will populate the transfer syntax from the gdcm::image. see for example: CreateARGBImage.cxx On Fri, Sep 5, 2014 at 7:08 PM, KB <bul...@gm...> wrote: > If we are using GetBuffer to get access to the image data, what is the recommended way to place modified data back into the gdcm::Image object? > > There is no SetBuffer, so what should we be looking for instead? From what I have seen in the examples it looks like you still need to use SetDataElement. In this case where the transfer syntax in not ExplicitVRLittleEndian we must make sure the buffer is in the correct transfer syntax before calling SetDataElement, is there a recommended way to do this? > > -----Original Message----- > From: Mathieu Malaterre [mailto:mat...@gm...] > Sent: Friday, September 05, 2014 10:05 AM > To: KB > Cc: gdcm-developers > Subject: Re: [Gdcm2] DataElement.GetByteValue returning NULL > > On Fri, Sep 5, 2014 at 3:18 PM, KB <bul...@gm...> wrote: >> We have been using something like the following code snippet as part >> of an application, and have read several thousand images without >> issue. Today however, we came across an image for which GDCM returns >> NULL for de.GetByteValue(). We are trying to understand why? The >> image appears to be OK, we don’t have any issue viewing it in other >> image viewers. Any recommendation on how to proceed? Thanks > [...] >> const gdcm::DataElement& de = >> mergedImage->GetDataElement(); >> >> const gdcm::ByteValue *bv = de.GetByteValue(); > > This only works for uncompressed DICOM file, none of the encapsulated will work in that code (eg. JPEG, JPEG-LS, RLE...). You should really use the gdcm::ImageReader / GetBuffer API instead. > > 2cts > -- Mathieu |