How to change the column pixel values of a DICOM image and assign new values columnwise)?

Illustration
Rahman Ud Din - 2023-11-03T09:53:58+00:00
Question: How to change the column pixel values of a DICOM image and assign new values columnwise)?

I want to change the column-wise values of a DICOM image and assign them with new values to generate a new image. Columns (384) will be divided into 1-130, 131-230, 231-330, 331-384 and I want to multiply each (for example, all columns from 1-130 will be multiplied by * 0.15, to get a new value of the pixel). Please anyone may like to help.   thanks  

Expert Answer

Profile picture of Neeta Dsouza Neeta Dsouza answered . 2025-11-20

multfactor = repelem([0.15, 0.18, 0.04, 0.23], [130 100 100 54]);  %modify factors appropriately

newimage = oldimage .* multfactor;

If you need to write out the new image in the form of a dicom file, it can get a bit messy to get all of the details right. But use dicominfo() to get the information about the DICOM file, and pass the info in the dicomwrite() call.


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!