I am considering and expanding the slider here in the answer about To show/join Two Images Simultaneously in Matlab's slider with the capability of changing the colormap by using .mat data in Matlab 2016a.
Therefore, I have to use imagesc
because there you can alter the colormap.
I want to make the images from .mat data containing the variables time
, potential
and matrix
such that I can change colormap/etc
Code with 1 imagesc-imshow
for k=1:2
% loaded variables from .mat data
img=imagesc(time, potential, matrix);
colormap('jet')
signal=cat(2,signal,img);
end
windowWidth = 320;
hImg = imshow(signal(:,1:1 + windowWidth,:), ... % TODO complication here?
'InitialMagnification', 100, 'Border', 'tight');
% End of the video code here https://stackoverflow.com/a/35924614/54964
% Not necessary for the case here!
At the end, I want to do the magnification with imshow
.
Output
Index exceeds matrix dimensions.
Error in masi (line 7)
hImg = imshow(signal(:,1:1 + windowWidth,:), ...
Code 2 with imagesc-write-imshow
I could not find a way to do imagesc-imshow without writing to the disc as .png and reading .png image result.
So there are only the saveas
and imread
here
for k=1:2
% loaded variables from .mat data
imagesc(time, potential, matrix);
colormap('jet');
saveas(gcf,'/tmp/Figure','png');
imgRGB=imread(fullfile('/tmp/','Figure.png'));
signal=cat(2,signal,imgRGB);
end
windowWidth = 320;
hImg = imshow(signal(:,1:1 + windowWidth,:), ...
'InitialMagnification', 100, 'Border', 'tight');
which gives the correct output by writing and reading.
Experimenting total Resolution with print -RGBImage -rNUMBER, Suever
I am experimenting Suever's answer for total resolution. I find the default image result noisy which you can easily see in slider-video. I think the best resolution is -r95. I know that the signal has indicators with 95% sensitivity so I selected it directly. There are uncertainties about 5-15% in the measurement so -r85 could be also good but I cannot evaluate it right now enough well. Low boundary is r55 for the resolution in my system without generation of the image (OS X 13" Macbook Air). Some resolution values and my experience
Error with >r124 in GUI, which indicates some upper boundary
Struct contents reference from a non-struct array object.
Error in matlab.graphics.internal.getframeWithDecorations (line 49)
x = bi.getWidth();
Error in alternateGetframe
Error in getframe (line 84)
x = alternateGetframe(parentFig, h, offsetRect, withinClientRect);
Error in masi (line 114)
writeVideo(vid, getframe());
It would be very nice to be able estimate the quality of resolution between r85, r90 and r95 when uncertainty of the input signal is 5-15% such that I would not lose it in stages from my original 1D signal.
Reviewing Units per Inches and Ghosts, Suever
I got strange results and found that [0 0 15 15]
is the best selection with big output image, little ghosts and no boundary artifacts.
I tried some mathematical factors like sqrt(2) and pi unsuccessfully.
The default points per inches is like the former but with about two times smaller image.
How can show the result of imagesc
using imshow
with magnification?