Current image item number and name


Author
Message
nanu1002
nanu1002
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 9, Visits: 61
Hello,
I have been trying to figure this out, but need your help. So I have 2 sets of 24 images ,48 iterations and no duplicates are allowed. This was working fine, till I had to also tried to include the itemnumber and picture name information as in code below (if/else condition). I am trying to figure out how to get a current image variable to store all the information and not cause an increase in the index to  the items list ( causing duplicates I believe). See current image code in the second part.

Original code:

<item refnegpicslab>
/1 = "images_neg/spl/reframe/214.jpg"
...24 items here
</item>

<item reactnegpicslab>
...24 items here
</item>

<picture refneglab>
/items = refnegpicslab
/select = noreplacenorepeat
/position = (50%, 50%)
/resetinterval = 5
</picture>

<picture reactneglab>
/items = reactnegpicslab
/select = noreplacenorepeat
/position = (50%, 50%)
/resetinterval = 5
</picture>

<trial picnegative>
/pretrialpause = 16.6666666667 * 3
/ontrialbegin = [values.trialcurrenttime = script.currenttime; ]
/ontrialbegin = [ if (values.currentinstrtype == "REFRAME-NEGATIVE") {trial.picnegative.insertstimulusframe(shape.rectangle_blue,1); trial.picnegative.insertstimulusframe(picture.refneglab,2); values.stimulusitem = picture.refneglab.currentitem ; values.stimulusnumber = picture.refneglab.currentitemnumber;}]
/ontrialbegin = [ if (values.currentinstrtype == "REACT-NEGATIVE") {trial.picnegative.insertstimulusframe(shape.rectangle_green,1); trial.picnegative.insertstimulusframe(picture.reactneglab,2); values.stimulusitem = picture.reactneglab.currentitem ; values.stimulusnumber = picture.reactneglab.currentitemnumber;}]
/timeout = 10000 + (16.6666666667 * 3 )
/showmousecursor = false
</trial>


Current Image Code:
------------------------------

Tried storing  picture in a current image ( http://www.millisecond.com/forums/Topic3960.aspx#3960. ) but not sure how to go about this one in the "if/else" condition. The image now doesn't index to the next and I am not sure how. 

<trial picnegative>
/pretrialpause = 16.6666666667 * 3
/stimulusframes = [2=PIC_canvas;3=PPTmark;10=trigger_0]
/ontrialbegin = [values.trialcurrenttime = script.currenttime; ]
/ontrialbegin = [ if (values.currentinstrtype == "REFRAME-NEGATIVE") {trial.picnegative.insertstimulusframe(shape.rectangle_blue,1); item.ITEM_canvas.item= picture.refneglab.currentitem; }]
/ontrialbegin = [ if (values.currentinstrtype == "REACT-NEGATIVE") {trial.picnegative.insertstimulusframe(shape.rectangle_green,1); item.ITEM_canvas.item= picture.reactneglab.currentitem; }]
/timeout = 500 + (16.6666666667 * 3 )
/ontrialend = [values.trialelapsedtime = trial.picnegative.elapsedtime; values.scriptelaspedtime = script.elapsedtime]
/showmousecursor = false
/ontrialend = [ values.response=0; ]
/ontrialend = [ values.stimulusitem = picture.PIC_canvas.currentitem; values.stimulusnumber = picture.PIC_canvas.currentitemnumber;]

</trial>

<item ITEM_canvas>
</item>

<picture PIC_canvas>
/ items = ITEM_canvas
/ position = (50%, 50%)
</picture>

----------------------------------

My main problem is that asking for currentitemnumber, currentitem increases the index count in the 24 items set (?) and is  causing duplicate images to show up in my trials.




GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search