image contrast brightness adjust

Hi all
i want try open multiple images using implay. but want to change contrast first. Below is my code, but still error. anyone can help me.
P = zeros(512, 512, 313);
for K = 1 : 313
petname = sprintf('TRANSA001_CT%03d.dcm', K);
P(:,:,K) = dicomread(petname);
end
Out(:,:,K) = imadjust(P(:,:,K));
implay(Out, [-182 292]);

9 Comments

What error you facing? Show us the error and error line.
Operands to the and && operators must be convertible to logical scalar values.
Error in uiscopes.ScopeCLI/checkSource (line 92) if ~isnumeric(fps) isnan(fps) isinf(fps) ~isreal(fps)
Error in matlabshared.scopes.UnifiedScope (line 105) checkSource( hScopeCfg.ScopeCLI );
Error in uiscopes/new (line 22) hScope = matlabshared.scopes.UnifiedScope(hScopeCfg, varargin{:});
Error in implay (line 60) obj = uiscopes.new(hScopeCfg);
Error in JDT (line 7) implay(Out, [-182 292]);
problem is at implay..I think imadjust is working fine.
i know. do you have idea?
What is class and size of out ?
simply try:
implay(Out)
Name Size Bytes Class Attributes
C2 512x512 524288 int16
if true
% code
end
implay(Out, [-182 292]);
What is Out class?
Name Size Bytes Class Attributes
Out 512x512 524288 int16

Sign in to comment.

 Accepted Answer

DGM
DGM on 9 Apr 2023
The second argument to implay() is the framerate in FPS. It's a scalar. I have no idea why you're passing it a vector including negative values, but that won't work.

More Answers (0)

Asked:

on 14 Mar 2018

Answered:

DGM
on 9 Apr 2023

Community Treasure Hunt

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

Start Hunting!