DVPresentationState why not exposing currentImage?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
oblivion81
Posts: 15
Joined: Tue, 2013-12-10, 13:19

DVPresentationState why not exposing currentImage?

#1 Post by oblivion81 »

Hi everybody,
I'm working with presentation states and I'm wondering why the DVPresentationState
is not exposing the internal attached image to the outside.

I have the following code that I've simplified for the example:

m_file = new DcmFileFormat;
m_file->loadFile(filepath);

m_presentationState = new DVPresentationState();

DcmFileFormat psFile;
psFile.loadFile(presentationFilePath);
m_presentationState->read(*psFile.getDataset());

m_presentationState->attachImage(m_file, false);

After this calls I have a fileformat and a presentation state attached to it that, by looking to the code,
is wrapping a DicomImage that is storing the pixels for the original image (before presentation state
is applied).
There's no way though to access this image, or at least its pixels, that I need for some computations.
And this is forcing me to allocate another DicomImage on the same dataset, that is a waste of memory.

Am I doing anything wrong?

Thanks!
Daniele

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

Re: DVPresentationState why not exposing currentImage?

#2 Post by J. Riesmeier »

I'm not the original author of this class, but I guess that this was a deliberate design decision. The complexity of the DicomImage class should be hidden by the DVPresentationState interface. I'm also not sure whether direct access to the internal DicomImage instance causes any side effects...

Maybe, you could investigate this in more detail and come up with a proposal (i.e. a patch based on the latest development version).

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest