saveFile after modifing pixel data

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
m-ishihara
Posts: 40
Joined: Thu, 2008-09-18, 09:20
Location: Japan

saveFile after modifing pixel data

#1 Post by m-ishihara »

Hi DICOM @ OFFIS,

Thank you for your everyday's support.
This time, I have wondering how to save DICOM file after internal pixel data is modified.
This process is as follows;

1. Reading original DICOM file using DcmDataset::loadFile()
2. Getting pixel data using DiPixel::getDataPtr()
3. Modifing the pixel data using some filter kernel
4. Rendering the bitmap image of the modified pixel data using DicomImage::createWindowsDIB()
5. Writing the DICOM file of the modified pixel data using DcmDataset::saveFile()

1. through 4. processes were successful, but in the last process 5. I only got the original DICOM file not the modified DICOM file.
I would appreciate it if you let me know what is wong with the last process.
I anticipate that writing process needs someting to assign some values...

Best Regards,

Maty
Maty

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

First of all, DicomImage::getInterData() returns a "const DiPixel *", so you should not modify the internal pixel data as you apparently do in step 3!

Nevertheless, using DicomImage::writeFrameToDataset() or DicomImage::writeImageToDataset() between step 3 and 5 might do what you want.

m-ishihara
Posts: 40
Joined: Thu, 2008-09-18, 09:20
Location: Japan

#3 Post by m-ishihara »

Hi Jörg,

Thank you for your reply.
For your suggestion, I could solve the problem.

Thanks,
Maty

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest