How to remove the grey margin from the imshow image

13 ビュー (過去 30 日間)
Shuyang Zhang
Shuyang Zhang 2022 年 12 月 5 日
コメント済み: Shuyang Zhang 2022 年 12 月 7 日
I'm analysing the MRI data with the imshow function. But every time the image pop out in a small window with a large grey (or white if I save it) margin around it. I have to zoom in the image in order to select the ROI.
Is there a code that can remove or reduce the margin as well as show the image in a larger window so that I don't have to double click it to full screen every single time?
Please see my code below. Thank you very much!
%% Draw kidney left t1 ROIs
slice =4 ;
figure; imshow(Maps.kidney.t1(:,:,slice),[0 1500]); colormap('jet');
r = drawrectangle('Position',[32 84 3 3]), wait(r);

回答 (1 件)

Image Analyst
Image Analyst 2022 年 12 月 6 日
You're probably saving it with exportgraphics or saveas instead of imwrite. Use imwrite instead when you save your image.
  9 件のコメント
Shuyang Zhang
Shuyang Zhang 2022 年 12 月 7 日
The image with a small white padding is good enough for me. Thank you very much for your help!

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

カテゴリ

Find more on Image Processing Toolbox 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!

Translated by