unable to restore photo quality

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
George
Posts: 52
Joined: Sun, 2023-11-12, 16:50

unable to restore photo quality

#1 Post by George »

Hello,

I tried to extract images to BMP using dcmtk and then using img2dcm to create a dicom, but the problem was that the image quality was different.

this code was used to write each frame:

Code: Select all

 
            DicomImage *dicomImage = new DicomImage(dicomConverted.c_str(), CIF_UsePartialAccessToPixelData, frameNumber, 1 );
            if (dicomImage->getStatus() != EIS_Normal) 
            {
                LOG("Error: Unable to load DICOM file: ");
                delete dicomImage;
                continue;
            }
            
            .....
            
            if ( dicomImage->writeBMP(concat.c_str(), 24) != 1)
            {
                LOG("Error writing BMP: ");
            }
            
dcmicmp dicom_one.dcm dicom_two.dcm
Max Absolute Error = 2985
Mean Absolute Error (MAE) = 384.874
Root Mean Square Error (RMSE) = 639.142
Peak Signal to Noise Ratio (PSNR) [dB] = 13.9475
Signal to Noise Ratio (SNR) [dB] = 0.55674

What can I do to fix that issue?

Best Regards
George

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: unable to restore photo quality

#2 Post by Michael Onken »

It depends on the input image parameters. E.g. if Bits Stored is > 8 in the input image, and you force the image to be rendered into RGB data with 8 bit per channel (BMP), you loose information. There can also be other relevant parameters. Also there may be some typical "gotchas" that one must have in mind when using dcmicmp and I am not an expert in that tool.

As a first approach, I would compare the common image parameters from input and output image using dcmdump before moving on to dcmicmp.

BR Michael

George
Posts: 52
Joined: Sun, 2023-11-12, 16:50

Re: unable to restore photo quality

#3 Post by George »

Hello,

How do I force the image to be rendered exactly? So I try to narrow the problem.

Best Regards
George

Post Reply

Who is online

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