function print_random_images(w, type, deviceIndex, path, img,folder, N, text, ...
backgroundColor, textColor, dispW, dispH, slack)
images = dir(fullfile(path, '*.jpg'));
files = fullfile({images.folder}, {images.name});
index = 1:numel(files);
if type == 0
displayTextCentered(w, text, backgroundColor,textColor, 1.5,50, 'center', 'center');
waitTTL(deviceIndex)
for i = 1:numel(files) / 10
selected = randperm(numel(index), N);
file = img{selected};
image = imread(fullfile(folder,file));
imageDisplay = Screen('MakeTexture',w,image);
showImagesAndFixationCross(w,backgroundColor,dispW,dispH,slack, imageDisplay)
index(selected) = [];
end
elseif type == 1
displayTextCentered(w, text, backgroundColor,textColor, 1.5,50, 'center', 'center');
waitForSpaceKeyPress()
for i= 1:numel(files)/ 10
selected = randperm(numel(index), N);
file = img{selected};
image = imread(fullfile(folder, file));
imageDisplay = Screen('MakeTexture', w, image);
showImagesAndFixationCross(w,backgroundColor,dispW,dispH,slack, imageDisplay)
end
end
end
0 Comments
Sign in to comment.