フィルターのクリア

Problem with clims using imagesc display

18 ビュー (過去 30 日間)
Maxime Yon
Maxime Yon 2016 年 10 月 18 日
編集済み: Adam 2016 年 10 月 18 日
Hi, I'm using imagesc to display two images. I would like to have the same color for the same value of a pixel. Thereby, I use the clims commande : (my images contains value betwwen 0 and 1000)
clims = [0 1000];
hf = figure('units','normalized','outerposition',[0 0 1 1],'Color',[1 1 1]);
clims = [0 1000];
colormap(jet(256))
imagesc(x,y,planuCT_i,clims)
title('X-ray Microtomographie')
hf = figure('units','normalized','outerposition',[0 0 1 1],'Color',[1 1 1]);
clims = [0 1000];
colormap(jet(256))
imagesc(x,y,plan31P_i,clims)
title('CP ^1H \rightarrow ^3^1P MRI')
But even with that two pixel with the same value do not have the same color : The color are close but the RGB code are differents. Where is my mistake ?
I'm using Matlab R2013b Thank you very much

回答 (1 件)

Adam
Adam 2016 年 10 月 18 日
編集済み: Adam 2016 年 10 月 18 日
clims = [0 1000];
will just create a variable and do nothing else.
caxis( hAxes, clims );
where hAxes is the handle to your axes, will apply the clims to the axes.
Or just
caxis( clims )
to take your life in your hands and rely on the current axis and apply it to that!
  3 件のコメント
Maxime Yon
Maxime Yon 2016 年 10 月 18 日
I zoom on the chosen pixel and the color is the same. Only the RGB code is wrong.
Even if there is still a problem it is okay for me : I will directly look on the colormap array to get the true code.
Adam
Adam 2016 年 10 月 18 日
編集済み: Adam 2016 年 10 月 18 日
Ah, sorry, I missed that you were passing clims to imagesc which should work fine. Your images are too low res for me to be able to read what the data cursor reports though.

サインインしてコメントする。

製品

Community Treasure Hunt

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

Start Hunting!

Translated by