필터 지우기
필터 지우기

dicomwrite creates a black and white image, why?

조회 수: 1 (최근 30일)
MYimage
MYimage 2012년 8월 1일
Hi there,
I have a problem in writing and reading a dicom CT image , I explained in the code below, I think I miss something, would you please let me know what I miss. Thanks a lot.
x=dicomread('t3.dcm'); % a grayscale image
metadata=dicominfo('t3.dcm');
... process x data
imshow(x,[]); % a correct grayscale image
dicomwrite (x,'t1.dcm',metadata);
x1=dicomread('t1.dcm');
imshow(x1,[]); % it is a black and white image, why?

답변 (2개)

venkat vasu
venkat vasu 2012년 8월 1일
info = dicominfo('CT-MONO2-16-ankle.dcm'); I = dicomread(info); dicomwrite(I,'ankle.dcm',info);
this code will help you...

Sean de Wolski
Sean de Wolski 2012년 8월 1일
What is the class of x after you read it in?
class(x) %?
And after this:
max(x(:))
min(x(:))
I would guess you are writing the file out and not accounting for the class of the data, causing it to scale wierdly or saturate at the edges.
  댓글 수: 1
MYimage
MYimage 2012년 8월 2일
thank you for your answer, I corrected it by converting the data from double to uint16.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by