pixel fragment file offsets

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
boxerab
Posts: 11
Joined: Fri, 2014-02-21, 17:16

pixel fragment file offsets

#1 Post by boxerab »

Hello,

I am looking at the following code in djcodecd.cc:

Code: Select all

 while (EJ_Suspension == result)
                      {
                        result = pixSeq->getItem(pixItem, currentItem++);
                        if (result.good())
                        {
                          fragmentLength = pixItem->getLength();
                          result = pixItem->getUint8Array(jpegData);
                          if (result.good())
                          {
                            result = jpeg->decode(jpegData, fragmentLength, imageData8, frameSize, isSigned);
                          }
                        }
Is it possible to get the pixel fragment file offsets, without actually reading them into memory?

I would like the registered codec to read the data directlry in from file

Thanks,
Aaron

J. Riesmeier
DCMTK Developer
Posts: 2541
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: pixel fragment file offsets

#2 Post by J. Riesmeier »

Are you talking about the Basic Offset Table (first item in the pixel sequence) or do you really mean the file offsets of each pixel item (within the pixel sequence)?

Loading large element values can be postponed by specifying an appropriate value for the "maxReadLength" parameter of loadFile() / read(), so large element values are only loaded when actually accessed (using one of the getXXX() methods).

boxerab
Posts: 11
Joined: Fri, 2014-02-21, 17:16

Re: pixel fragment file offsets

#3 Post by boxerab »

Thanks. Yes, I would like to know the actual file offsets of each block of pixel data, plus the length of each block.

For maxReadLength, can I set this to any value I like? Can I set it to 2, for example? just curious.

J. Riesmeier
DCMTK Developer
Posts: 2541
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: pixel fragment file offsets

#4 Post by J. Riesmeier »

Yes, I would like to know the actual file offsets of each block of pixel data, plus the length of each block.
I guess the first is buried somewhere in the DcmInputStream class (or related classes), the latter should be available from the length field of the DcmPixelItem instance.
For maxReadLength, can I set this to any value I like? Can I set it to 2, for example? just curious.
Yes, this should be possible, even though one usually sets this parameter to some kBytes. See default value and option --max-read-length for the various DCMTK command line tools.

boxerab
Posts: 11
Joined: Fri, 2014-02-21, 17:16

Re: pixel fragment file offsets

#5 Post by boxerab »

Thanks!

Post Reply

Who is online

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