How to change the color of dicom loop using function image?
Show older comments
Hello, I have a problem with coloring my dicom loop. I have a GUI for loading and displaying DICOM loop from ultrasound. Im using function image for displaying loop because this function is the best option with timing for me }functions as imshow and so on are too slow). The loop should be black and white, but after displaying its blue and yellow. Could anyone help me how can I change the coloring of the loop? Thanks
3 Comments
Rik
on 29 Nov 2017
This sounds like it doesn't have anything to do with the fact that it is dicom data. What format does your matrix have after loading, and what is the syntax you are using?
You can also use imshow to initialize the axis and then set the CData property to the new frame. Don't forget to add a drawnow. I think that might be the fastest method. (although initializing with image will probably work as well)
Jaroslava Orenicova
on 29 Nov 2017
Jaroslava Orenicova
on 29 Nov 2017
Answers (1)
Walter Roberson
on 29 Nov 2017
Edited: Walter Roberson
on 29 Nov 2017
colormap(gray(256))
Note: because timing is important to you, you should be coding something like,
for idx = 1: ....
...
if idx == 1
ih = image(YourData);
colormap(gray(256));
else
set(ih, 'CData', YourData);
end
title( sprintf('Slice #%d', idx) );
drawnow();
end
1 Comment
Jaroslava Orenicova
on 29 Nov 2017
Categories
Find more on DICOM Format in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!