'horzcat' error when using dicomread() within a for-loop
Mostra commenti meno recenti
Hi
I have a set of 460 DICOM files that I would like to read in one-by-one, subtract 1000 from each pixel, and write them out as DICOM files. I have tried the following code, but continue to get an errror saying "CAT arguments dimensions are not consistent":
I=zeros(512,512);
for i=0:459
I=dicomread(['IMG (' int2str(i) ').dcm']);
I=im2double(I);
I=I-(1000*ones(size(I)));
I=int16(I);
dicomwrite([I,'IMG (' int2str(i) '.dcm'])
end;
I assume this problem comes from a line in dicomwrite(), but I can't work out how to change this.
Any suggestions would be much appreciated.
Thanks,
Roman
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Read and Write Image Data from Files in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!