Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
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

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by