From: Derek M. <D.R...@le...> - 2016-08-09 11:16:24
|
Hi, I'm struggling to find the correct commands to decode an RLE encoded fragment in a DICOM file (there is only one fragment per file). I can get the raw data something like this (which is what I do for uncompressed data, and it works fine): const gdcm::DataElement &de_idata = ds.GetDataElement( gdcm::Tag(0x7FE0,0x0010) ); const gdcm::SequenceOfFragments *frames = de_idata.GetSequenceOfFragments() ; unsigned int no_of_frames=0 ; const char *bvp ; if(frames!=NULL){ no_of_frames = frames->GetNumberOfFragments() ; const gdcm::Fragment &frag = frames->GetFragment(0) ; unsigned int flength = frag.GetLength() ; const gdcm::ByteValue *bv = frag.GetByteValue() ; bvp = bv->GetPointer() ; // This gives the (potentially compressed) data pointer I can see there are various classes to decode RLE (and other compressions), but can't quite work out how to tie it all together. With JPEG compression I've previously just sent the pointer to libjpeg successfully (but I suspect that's not the best approach). Thanks in advance Derek |