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

2 次查看(过去 30 天)
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

采纳的回答

Walter Roberson
Walter Roberson 2023-11-2
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.
  5 个评论
Walter Roberson
Walter Roberson 2023-11-2
newimage = cast( double(im1T2) .* multfactor, 'like', Im1T2) ;
But how did multfactor get to be 770 long? The code I posted creates 384 long.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Language Support 的更多信息

产品


版本

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by