Welcome! Log In Create A New Profile

Advanced

.gif files

Posted by bts 
bts
.gif files
August 05, 2020 01:51PM
Hi Jaewon,

When I try to call a .gif file using ImageGraphic, I get the error "PIC: Number of elements must not change. Use [] as one of the size inputs to automatically calculate the appropriate size for that dimension." Any ideas what might be the issue?

When I put [] as one or both of the size inputs, I get the error "Can't parse out".

I also get the first error if I don't specify size at all.
Re: .gif files
August 05, 2020 03:56PM
ImageGraphic does not take any size argument nor produce an error message prefixing "PIC". Please double-check which function/script made the error.
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#ImageGraphic
bts
Re: .gif files
August 05, 2020 04:18PM
Sorry, I should have been more specific. The error happens when I create a scene that includes ImageGraphic and call the taskobject from the userloop. It works fine with static images but not gif images. Here is the section of code causing the issue:

img1 = ImageGraphic(eye_);
fix1 = SingleTarget(img1);
fix1.Target = fix_cue_img;
fix1.Threshold = fix_cue_threshold;
fth1 = FreeThenHold(fix1);
fth1.MaxTime = fix_cue_max_response_time;
fth1.HoldTime = fix_cue_required_hold_time;
scene1 = create_scene(fth1, fix_cue_img);

fix_cue_img is the taskobject from the userloop file and can be a static image or gif (chosen by user via editable)

Here is all the error info:

Error using mlconditions/parse_object (line 123)
PIC: Number of elements must not change. Use [] as one of the size inputs to automatically calculate the appropriate size for that dimension.
(blinking_white_box.gif)

Error in mltaskobject (line 36)
if iscell(taskobj), taskobj = MLConfig.MLConditions.parse_object(taskobj); end

Error in run_trial (line 122)
TaskObject = mltaskobject(taskobject,MLConfig,TrialRecord);

Error in monkeylogic/UIcallback (line 866)
result = run_trial(MLConfig,datafile);

Error while evaluating UIControl Callback.
Re: .gif files
August 05, 2020 05:51PM
Animated GIFs are not supported. Make it as a movie.

ImageGraphic is not doing anything in your script. You may as well remove it.
bts
Re: .gif files
August 05, 2020 05:56PM
Ok. I assumed animated GIFs were supported based on this table that says GIF is an acceptable format for static images: [monkeylogic.nimh.nih.gov]

I understand now that it is referring to static GIFs only.

I will make it a movie instead. Thank you.
Re: .gif files
August 06, 2020 04:49AM
Update your NIMH ML and you will be able to use GIF as a movie source. Use MOV, instead of PIC.
https://monkeylogic.nimh.nih.gov/docs_TaskObjects.html
bts
Re: .gif files
August 06, 2020 12:26PM
Thanks Jaewon, works great.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.