Blunted Reward Responsiveness During Social Feedback: Associations with Peer Victimization and Anhedonia in Socially Anxious Adolescents.
The 3 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
- [1] § Methods › Measures › fMRI Task › Island Getaway Task (Kujawa et al. ) ↔ IG_Task_Code.py, lines 633–720 · score 0.66 · Island Getaway, Big Island, game, matched, profile, player
- [2] § Methods › Data Analytic Plan › fMRI Preprocessing ↔ 2_watershedandANTS.sh, the whole file · a weak match · score 0.63 · Skull stripping, ANTs, MNI, transformation, brain
- [3] § Methods › Procedures ↔ IG_Task_Code.py, lines 633–720 · score 0.53 · Island Getaway, instructions, game, profile, filled
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 877 lines · 39 KB · no license · 2 matches
- #!/usr/bin/env python
- # encoding: UTF-8
- if __name__ == '__main__':
- try:
- #!/usr/bin/env python
- # encoding: UTF-8
- # Silence warnings
- import psychopy.logging
- psychopy.logging.console.setLevel(psychopy.logging.CRITICAL)
- import schizoidpy
- from schizoidpy import StimGroup, TriggerKey
- from psychopy.visual import TextStim, ImageStim, Rect, Circle
- from psychopy.visual.ratingscale import RatingScale
- from psychopy.core import CountdownTimer
- from random import random, lognormvariate, expovariate, sample
- from collections import Counter
- from cgi import escape
- from sys import argv
- par = dict((('committed', 'Fri Feb 22 14:01:45 2019 -0500'), ('deployed', 'Sat Feb 23 10:07:36 2019'), ('task_version', '51f11b7f67a422727851368261d30dda20489dad'), ('image_dir', 'images/'), ('debug', False), ('eeg', False))); import socket; par["fmri_mode"] = socket.gethostname() == "vt000346844"; par["subject_portrait_path"] = "C:/subject.jpg" if socket.gethostname() in ["TRACLab-wr2", "TracLabWhisper2"] else "subject.jpg"; par["debug_log_dir"] = "output-fmri" if par["fmri_mode"] else "output-eeg" if socket.gethostname() in ["PSY-B4B80M2", "PSY-2S5XQP2"] else "output-age-15" if socket.gethostname() == "PsychA115WR" else "output"; par["output_path_fmt"] = "{}/survivor-{{subject}}.json".format(par["debug_log_dir"]); par["inpout32_addr"] = None if socket.gethostname() == "CAPLAB-Whisp2in" else 53328 if socket.gethostname() in ["StewsLab-PC", "TRACLab-wr2", "TracLabWhisper2"] else 57424 if socket.gethostname() in ["Kujawa-Task-D45KNSD2"] else 57360 if socket.gethostname() in ["PSYCH1457", "PSY-B4B80M2"] else 16376 if socket.gethostname() == "PSY-2S5XQP2" else 888; par["double_draw"] = socket.gethostname() == "CAPLAB-Whisp2in"; par["shrink_screen"] = socket.gethostname() in ["TRACLab-wr2", "TracLabWhisper2"]
- o = schizoidpy.Task(
- debug_log_dir = par['debug_log_dir'],
- send_actiview_trigger_codes = par['eeg'] and not par['fmri_mode'],
- inpout32_addr = par['inpout32_addr'],
- double_draw = par['double_draw'],
- button_radius = .12,
- okay_button_pos = (0, -.7),
- bg_color = 'black', fixation_cross_color = 'white')
- o.save('task_version', par['task_version'])
- # ------------------------------------------------------------
- # * Data
- # ------------------------------------------------------------
- portrait_dims = (144, 216)
- ages = map(str, [
- 15, 14, 17,
- 16, 13, 16,
- 15, 14, 17,
- 15, 13,
- 16, 17])
- if par['fmri_mode']:
- male_names = {'Steve', 'Cody', 'Kyle', 'Aiden', 'Jacob', 'Daniel', 'Nick'}
- extra_male_name = 'Rob'
- female_names = {'Addison', 'Holly', 'Rachel', 'Lauren', 'Jennifer', 'Molly', 'Jessica'}
- extra_female_name = 'Kelsey'
- male_portraits = {'klein-age15-m-{}.jpg'.format(i + 1) for i in range(7)}
- female_portraits = {'klein-age15-f-{}.jpg'.format(i + 1) for i in range(7)}
- schools = {'Kinnelon', 'Christiansburg', 'Lynn haven', 'princess Anne', 'Auburn', 'tallahassee', 'Pearl R. Miller', 'East Lake', 'Palm Harbor', 'Countryside', 'Jupiter', 'Bozeman', 'palm beach gardens'}
- interests = {
- 'fishing, reading, spending time with friends',
- 'rock climbing, nature',
- 'design and music',
- 'playing guitar and spending time with friends and family',
- 'art and reading',
- 'chess, spending time with friends',
- 'drawing and painting',
- 'cooking, meeting new people',
- 'singing, choreography',
- 'travel and swimming',
- 'volunteering, reading, Spanish',
- 'sculpting, working out',
- 'running, baking, hanging out with friends'}
- poll = [
- ['Who is your favorite fictional character?',
- ["Harry potter", "Katniss Everdeen", "Iron Man", "Jim from The Office", "Groot", "Luke skywalker", "Atticus finch", "Hannibal lector", "Captain jack sparrow", "Jane Eyre", "Sherlock holmes", "Daenerys Targaryen"]],
- ['If you could be any animal, what kind of animal would you be?',
- ["Golden retriever", "Cat", "Beta fish", "Hummingbird", "Mountain lion", "Panther", "Water snake", "Giraffe", "Wild horse", "Beagle", "Hedgehog"]],
- ['What is your favorite class in school school?',
- ["Math", "spanish", "English", "science", "Calculus", "Shop class", "Science class", "French", "English", "history"]],
- ['If you could live in any time period, which would it be?',
- ["The future", "The wild west", "The 1960s", "the 80s", "Paris in the 1920s", "medieval France", "the renaissance", "ancient Greece", "the golden age of film in Hollywood"]],
- ['If you suddenly won a million dollars, what would be the first thing you bought with the money?',
- ["A really fancy car", "A private island", "A mansion", "A beach house for my parents", "puppies", "designer clothes", "a farm", "a jet ski"]]]
- else:
- male_names = {'Brandon', 'Tyler', 'Matt', 'Zach', 'Connor', 'Eli', 'Isaiah'}
- extra_male_name = 'Peter'
- female_names = {'Taylor', 'Clare', 'Emma', 'Jennifer', 'Renee', 'Maya', 'Alysa'}
- extra_female_name = 'Sarah'
- male_portraits = {'vanderbilt-undergrad-eeg-m-{}.jpg'.format(i + 1) for i in range(7)}
- female_portraits = {'vanderbilt-undergrad-eeg-f-{}.jpg'.format(i + 1) for i in range(7)}
- schools = {'Centre College', 'Baylor University', 'Northwestern University', 'Ohio State University', 'Southern Methodist University', 'Purdue University', 'University of Northern Colorado', 'Florida International University', 'Valdosta State University', 'DeVry University', 'Stony Brook University', 'University of Oregon', 'University of Missouri'}
- interests = {
- 'College football, exploring my city',
- 'Learning foreign languages and traveling',
- 'Reading good books, cooking',
- 'Visiting national parks, jogging, baking',
- 'Lacrosse, poetry, hanging with friends',
- 'business, astronomy, traveling',
- 'exploring new places, spending time with family and friends',
- 'sketching, hiking',
- 'social justice, public policy',
- 'yoga, soccer',
- 'volunteering, traveling',
- 'dogs',
- 'photography, French'}
- polls = [
- ["What is your favorite movie?",
- {"Pulp Fiction", "Titanic", "Avengers: Infinity War", "Harry potter and the deathly hallows (part 1 and 2)", "Forrest Gump", "A clockwork orange", "the matrix", "la la land", "Black swan", "Pitch Perfect", "The Lion King", "Star Wars the force awakens"}],
- ["If money didn't matter, what would be your dream job?",
- {"Broadway singer", "Chef", "Travel agent", "food blogger", "Event planner", "Children's book illustrator", "Antique shop owner", "Architect", "Astronaut", "Chocolatier", "advice columnist"}],
- ["If you had a whole day to do whatever you wanted, what would you do?",
- {"Sleep", "Go for a run and then hang out with friends", "Go to the airport and get on a random flight to somewhere I've never been before", "Go visit my parents", "Sleep late and watch Netflix", "Go to a coffee shop and read", "Go to the beach", "Do yoga in the park and then cook dinner with friends", "Go to brunch with my friends", "Go on a hike somewhere new"}],
- ["What is your least favorite class?",
- {"Chem", "Biology", "Macro economics", "Physics II", "Medieval literature", "Early American art history", "Statistics", "History of cinema", "Calculus"}],
- ["If you could have dinner with any person, living or dead, who would it be?",
- {"Barack Obama", "Nelson Mandela", "spike lee", "Stephen king", "John Lennon", "Beyonce", "Kanye west", "Mark Zuckerberg"}]]
- round_descriptions = [
- dict(place = 'Kauai',
- background = 'Hanalei,_Kauai_HI.jpg',
- fluff = "Welcome to Kauai, the geologically oldest of the Hawaiian Islands! You are getting closer to the Big Island of Hawaii. Let's play another round."),
- dict(place = 'Oahu',
- background = 'Sunset_next_to_Waikiki_Beach,_Oahu,_Hawai,_USA1.jpg',
- fluff = "Welcome to Oahu, the third-largest of the Hawaiian Islands! You are getting closer and closer to the Big Island. Let's play another round."),
- dict(place = 'Molokai',
- background = 'Church_at_the_end_of_the_road.jpg',
- fluff = "Welcome to Molokai, an island built from two shield volcanoes and one step closer to the Big Island. Let's play again."),
- dict(place = 'Lanai',
- background = 'Full_moon_setting_over_Lanai.jpg',
- fluff = "Welcome to Lanai, a comma-shaped island that was once covered with pineapple plantations. You're the nearest you've come to the Big Island yet, but which of you will make it there? Let's play another round."),
- dict(place = 'Maui',
- background = 'Kipahulu_coast.jpg',
- fluff = "Welcome to Maui, the second-largest of the Hawaiian Islands! You're almost there! Let's play again to see who will make it to the Big Island of Hawaii.")]
- round_wait = 2
- # The format of EEG trigger codes is as follows:
- #
- # Bits 0–2: Encodes the type of event.
- events = dict(
- # We skip 0 because that's a control code.
- subject_votes_to_accept = 0b00000001,
- subject_votes_to_reject = 0b00000010,
- subject_votes_neutral = 0b00000011,
- subject_gets_accept_vote = 0b00000100,
- subject_gets_reject_vote = 0b00000101,
- subject_gets_neutral_vote = 0b00000110)
- # Bit 3: Encodes coplayer gender (0 male, 1 female).
- # Bits 4–6: Encodes the coplayer involved in the event. These
- # ID numbers are gender-specific (e.g., male coplayer 3 and
- # female coplayer 3 are different coplayers).
- # Bit 7: Always 0, avoiding confusion with codes 255 and 256
- # (which are more control codes).
- def trigger_code(coplayer, event):
- return (
- (coplayer['trigger_id'] << 4) |
- (coplayer['female'] << 3) |
- events[event])
- button_box = {
- # Maps fingers to their fMRI button-box codes.
- 'left pinkie': '1',
- 'left ring': '2',
- 'left middle': '3',
- 'left index': '4',
- 'left thumb': '5',
- 'right index': '6',
- 'right middle': '7',
- 'right ring': '8',
- 'right pinkie': '9',
- 'right thumb': '0'}
- fmri_start_scanning_key = '5'
- # ------------------------------------------------------------
- # * Helper functions
- # ------------------------------------------------------------
- def shuffled(x): return sample(x, len(x))
- def choice(x): return shuffled(x)[0]
- # random.choice doesn't work on sets.
- def image_path(image):
- return par['image_dir'] + image
- big_canvas = Rect(o.win,
- width = 1.5, height = 1.8,
- fillColor = 'white', opacity = .8)
- strip_canvas = Rect(o.win,
- width = 1.2, height = .3,
- fillColor = 'white', opacity = .8)
- background_imagestim = ImageStim(o.win,
- image_path('Niihau_sep_2007.jpg'),
- units = 'pix',
- size = [o.screen_width, o.screen_height])
- def background(image_name):
- background_imagestim.setImage(image_path(image_name))
- return o.showing(background_imagestim, big_canvas)
- def message(duration, string):
- # Temporarily replace big_canvas with strip_canvas.
- with o.hiding(big_canvas):
- o.wait_screen(duration,
- strip_canvas,
- o.text(0, 0, string, wrap = 1.2))
- def fake_message(dkey, keys, string):
- # Look like `message`, but actually wait for a keypress instead
- # of waiting a fixed time.
- with o.hiding(big_canvas):
- o.keypress_screen(dkey, keys,
- strip_canvas,
- o.text(0, 0, string, wrap = 1.2))
- blank_background = o.hiding(background_imagestim, big_canvas)
- def lag(duration):
- message(duration, lag_msg)
- lag_msg = u'Waiting for all players to finish…'
- def write(write_point):
- # Don't use o.save in case we're inside a `dkey_prefix`.
- o.data['write_point'] = write_point
- p = par['output_path_fmt'].format(**o.data)
- o.write(p, json_default = json_default)
- print 'Data written to', p
- def json_default(x):
- if x is Reject:
- return -1
- elif x is Neutral:
- return 0
- elif x is Accept:
- return 1
- else:
- raise TypeError
- def simplify_gender(gender):
- # When the text string `gender` clearly identifies a binary gender,
- # return "Male" or "Female". Otherwise, just normalize capitalization.
- g = gender.lower()
- if g in ['m', 'male', 'b', 'boy', 'man']:
- return 'Male'
- if g in ['f', 'female', 'g', 'girl', 'w', 'woman']:
- return 'Female'
- return gender[0].upper() + gender[1:].lower()
- #class TransformedRatingScale(RatingScale):
- #def __init__(self, *args, **kwargs):
- #self.transform = kwargs.pop('transform', None)
- #RatingScale.__init__(self, *args, **kwargs)
- #def getRating(self):
- #v = RatingScale.getRating(self)
- #if v is None or not self.transform:
- #return v
- #return self.transform(v)
- #def rating_scale(y, num_options, **kwargs):
- #rs = TransformedRatingScale(o.win, pos = (0, y),
- #low = 1, high = num_options,
- #textColor = 'black', lineColor = 'black',
- #marker = 'circle', markerColor = 'black',
- #stretch = 2,
- #respKeys =
- #[button_box[k] for k in (
- # 'left ring', 'left middle',
- # 'left index')[:num_options]]
- #if par['fmri_mode']
- #else [str(i) for i in range(1, num_options + 1)],
- #acceptKeys = button_box['right index']
- #if par['fmri_mode']
- #else 'return',
- #showValue = False, skipKeys = None, scale = None,
- #showAccept = False,
- #**kwargs)
- #return rs
- #def rating_scale_controls_text(num_options):
- #fmri_choice_controls = (
- #{5: 'left hand', 6: 'left hand or right index'}[num_options])
- #return o.text(0, -.7, wrap = 2, string =
- #'{} - Choose an option\n{} - Confirm'.format(
- #fmri_choice_controls if par['fmri_mode'] else 'number keys',
- #'right index' if par['fmri_mode'] else 'Enter'))
- # ------------------------------------------------------------
- # * Coplayers
- # ------------------------------------------------------------
- class VoteType(object):
- def __init__(self, letter):
- self.letter = letter
- def __str__(self):
- return self.letter
- Reject = VoteType('R')
- Reject.key = button_box['left index'] if par['fmri_mode'] else 'f'
- Neutral = VoteType('N')
- Accept = VoteType('A')
- Accept.key = button_box['right index'] if par['fmri_mode'] else 'j'
- coplayers = dict(
- mean3 = dict(expendable = False,
- votes = (Reject, Reject, Reject, Neutral, Reject, Reject)),
- mean2 = dict(expendable = False,
- votes = (Reject, Reject, Neutral, Reject, Reject, Neutral)),
- mean1 = dict(expendable = False,
- votes = (Neutral, Reject, Reject, Accept, Reject, Neutral)),
- indiff = dict(expendable = False,
- votes = (Neutral, Neutral, Neutral, Reject, Accept, Neutral)),
- nice1 = dict(expendable = False,
- votes = (Accept, Neutral, Accept, Accept, Neutral, Reject)),
- nice2 = dict(expendable = False,
- votes = (Accept, Accept, Accept, Neutral, Neutral, Accept)),
- nice3 = dict(expendable = False,
- votes = (Accept, Accept, Neutral, Accept, Accept, Accept)),
- xpendable_rna = dict(expendable = True,
- votes = (Reject, Neutral, Accept, Reject, Neutral, Accept)),
- xpendable_ran = dict(expendable = True,
- votes = (Reject, Accept, Neutral, Reject, Accept, Neutral)),
- xpendable_nra = dict(expendable = True,
- votes = (Neutral, Reject, Accept, Neutral, Reject, Accept)),
- xpendable_nar = dict(expendable = True,
- votes = (Neutral, Accept, Reject, Neutral, Accept, Reject)),
- xpendable_arn = dict(expendable = True,
- votes = (Accept, Reject, Neutral, Accept, Reject, Neutral)),
- xpendable_anr = dict(expendable = True,
- votes = (Accept, Neutral, Reject, Accept, Neutral, Reject)))
- for k, p in sorted(coplayers.items()):
- p['id'] = k
- p['poll_responses'] = len(p['votes']) * [None]
- coplayers = coplayers.values()
- # Enable this block to show the properties of the matrix of votes
- # among the non-expendable coplayers.
- if False:
- mat = [cp['votes']
- for x in ('mean3', 'mean2', 'mean1', 'indiff', 'nice1', 'nice2', 'nice3')
- for cp in coplayers
- if cp['id'] == x]
- print 'Totals'
- for votetype in Reject, Neutral, Accept:
- print votetype, sum(1 for row in mat for v in row if v is votetype)
- print ''
- print 'Columns'
- ncol = len(mat[0])
- for votetype in Reject, Neutral, Accept:
- print votetype, ' '.join(
- str(sum(1 for row in mat if row[i] == votetype))
- for i in range(ncol))
- print ''
- print 'Rows'
- from collections import Counter
- for row in mat:
- d = Counter(row)
- print 'R {}, N {}, A {}'.format(d[Reject], d[Neutral], d[Accept])
- exit()
- # Decide what order the expendables will be kicked out. We choose
- # a random order that will result in the subject getting an equal
- # number of each type of vote.
- while True:
- kickout_order = shuffled([p for p in coplayers if p['expendable']])
- counts = Counter([vote
- for i, cp in enumerate(kickout_order)
- for vote in cp['votes'][: i + 1]])
- if len(counts.keys()) == len('RNA') and len(set(counts.values())) == 1:
- break
- o.save('coplayer_kickout_order', [p['id'] for p in kickout_order])
- # Make the coplayers evenly split by gender within the expendable
- # and non-expendable groups.
- for i, p in enumerate(shuffled([p for p in coplayers if p['expendable']])):
- p['female'] = bool(i % 2)
- for i, p in enumerate(shuffled([p for p in coplayers if not p['expendable']])):
- p['female'] = bool(i % 2)
- # Because there's an odd number of non-expendable coplayers,
- # we're left with one more male than we have females. Later,
- # if we learn that the subject is male, we'll make one of
- # the male non-expendables female.
- def pronoun_nom(p): return 'she' if p['female'] else 'he'
- def pronoun_obj(p): return 'her' if p['female'] else 'him'
- def pronoun_gen(p): return 'her' if p['female'] else 'his'
- # Assign names and portraits.
- males = zip(shuffled(male_names), shuffled(male_portraits))
- females = zip(shuffled(female_names), shuffled(female_portraits))
- for p in coplayers:
- p['name'], p['portrait'] = females.pop() if p['female'] else males.pop()
- portrait_stim_cache = {}
- def portrait_stim(x, y, p, border_color = 'black'):
- img = par['subject_portrait_path'] if p is None else image_path(p['portrait'])
- k = x, y, border_color, img
- if k not in portrait_stim_cache:
- portrait_stim_cache[k] = StimGroup((
- ImageStim(o.win, pos = (x, y),
- image = img),
- Rect(o.win, pos = (x, y),
- width = (portrait_dims[0] + 3) / (.5 * o.screen_width),
- height = (portrait_dims[1] + 3) / (.5 * o.screen_height),
- lineColor = border_color, lineWidth = 3)))
- return portrait_stim_cache[k]
- # Assign fluff.
- for p, age, school, interest in zip(
- coplayers, shuffled(ages), shuffled(schools), shuffled(interests)):
- p['fluff'] = dict(
- Age = age, School = school, Interests = interest)
- o.save('coplayers', {p['id']: p for p in coplayers})
- # We don't copy the coplayer-objects because we want later edits
- # (such as the addition of poll responses) to be recorded.
- # ------------------------------------------------------------
- # * The likability-rating subroutine
- # ------------------------------------------------------------
- #def rate_likabilities(time):
- #num_options = 3
- #cps = shuffled(o.data['coplayers'].values())
- # We don't just say `shuffled(coplayers)` because we want
- # the subject to rate coplayers that have been kicked out.
- #o.save(('likability_rating', time, 'rating_order'),
- #[p['id'] for p in cps])
- #for p in cps:
- #o.scale_screen(('likability_rating', time, 'ratings', p['id']),
- #portrait_stim(-.5, .5, p),
- #o.text(0, 0, 'How much do you like {}?'.format(p['name'])),
- #rating_scale(y = -.2,
- #num_options = num_options,
- #labels = ['Not at all', 'Somewhat', 'Extremely']),
- #rating_scale_controls_text(num_options = num_options))
- # ------------------------------------------------------------
- # * The voting subroutine
- # ------------------------------------------------------------
- icon_dim = 200 # Pixels
- icon_thickness = 10 # Pixels
- def icon_frame(x, color):
- kw = dict(units = 'pix', fillColor = color, lineColor = color)
- return [
- Rect(o.win, icon_dim, icon_thickness,
- pos = (x, icon_dim/2 - icon_thickness/2), **kw),
- Rect(o.win, icon_dim, icon_thickness,
- pos = (x, -icon_dim/2 + icon_thickness/2), **kw),
- Rect(o.win, icon_thickness, icon_dim,
- pos = (x + icon_dim/2, 0), **kw),
- Rect(o.win, icon_thickness, icon_dim,
- pos = (x - icon_dim/2, 0), **kw)]
- def reject_icon(x = 0, y = 0):
- return ImageStim(o.win, pos = (x, y),
- image = image_path('thumbs-down.png'))
- Reject.icon_c = reject_icon()
- def accept_icon(x = 0, y = 0):
- return ImageStim(o.win, pos = (x, y),
- image = image_path('thumbs-up.png'))
- Accept.icon_c = accept_icon()
- def neutral_icon(x = 0, y = 0):
- return Rect(o.win, width = .25, height = .5, pos = (x, y),
- fillColor = 'yellow',
- lineColor = 'gray', lineWidth = 10)
- Neutral.icon_c = neutral_icon()
- #extended time limit
- voting_time_limit = 7 # In seconds
- mean_postfeedback_wait = 5 if par['fmri_mode'] else 1.5 # In seconds
- def voting(nround):
- practice = nround is None
- if practice:
- cps = [
- dict(id = 'practice_a',
- name = 'Player A', female = False,
- portrait = 'example-male.png',
- vote = Accept),
- dict(id = 'practice_b',
- name = 'Player B', female = True,
- portrait = 'example-female.png',
- vote = Reject)]
- else:
- cps = shuffled(coplayers)
- o.save('vote_order', [p['id'] for p in cps])
- if par['fmri_mode']:
- # Create a randomly ordered set of post-feedback waits with
- # mean equal to `mean_postfeedback_wait`.
- postfeedback_waits = [mean_postfeedback_wait + x
- for i in range(1, len(cps) // 2 + 1)
- for x in (-.25 * i, .25 * i)]
- if len(cps) % 2:
- postfeedback_waits.append(mean_postfeedback_wait)
- postfeedback_waits = shuffled(postfeedback_waits)
- o.save('postfeedback_waits', postfeedback_waits)
- else:
- # Make every post-feedback wait equal to the mean.
- postfeedback_waits = [mean_postfeedback_wait] * len(cps)
- if par['fmri_mode'] and not practice:
- fake_message('begin_fmri',
- fmri_start_scanning_key,
- lag_msg)
- with blank_background:
- if par['fmri_mode']:
- o.wait_screen(5,
- o.text(0, 0, color = 'white', string = "Use the buttons under your index fingers to vote. Voting will begin in a few seconds."))
- else:
- o.keypress_screen('start',
- {Accept.key: 'Keep', Reject.key: 'Kick\nOut'},
- o.text(0, 0, color = 'white', string = "Position your index fingers over the \"{Reject.key}\" and \"{Accept.key}\" keys. Then, press either one to begin voting.".format(**globals())))
- for i, p in enumerate(cps):
- # The subject votes.
- stimuli = [
- portrait_stim(-.5, .5, p, border_color = 'white'),
- o.html(.2, .8, vAlign = 'top', color = 'white', font_size = 14, string =
- # Show the coplayer's profile.
- '<b>{}</b><br><br>'.format(p['name']) +
- '<b>{}</b><br>'.format('Female' if p['female'] else 'Male') +
- ('' if practice else '<br>'.join(
- ['<b>{}:</b> {}'.format(k, escape(p['fluff'][k])) for k in
- ['Age', 'School', 'Interests']])))]
- voting_timer = CountdownTimer(voting_time_limit)
- o.keypress_screen(('subject_votes', p['id']),
- {
- voting_timer: TriggerKey('Neutral', None if practice else
- trigger_code(p, 'subject_votes_neutral')),
- Reject.key: TriggerKey('Kick\nOut', None if practice else
- trigger_code(p, 'subject_votes_to_reject')),
- Accept.key: TriggerKey('Keep', None if practice else
- trigger_code(p, 'subject_votes_to_accept'))},
- o.text(0, -.5, color = 'white', wrap = 2, string =
- 'Vote on ' + p['name']),
- o.text(-.25, -.7, color = 'white', string =
- '{} - Kick Out'.format(
- 'left' if par['fmri_mode'] else Reject.key)),
- o.text(.25, -.7, color = 'white', string =
- '{} - Keep'.format(
- 'right' if par['fmri_mode'] else Accept.key)),
- *stimuli)
- o.wait_screen_till(voting_timer,
- o.text(0, -.5, color = 'white', wrap = 2, string =
- 'Vote registered'),
- *stimuli)
- # Show a fixation cross.
- o.wait_screen(5, o.fixation_cross)
- # Now show the coplayer's vote extended 2 to 5.
- pv = p['vote'] if practice else p['votes'][nround]
- if not practice: o.trigger(trigger_code(p, {
- Reject: 'subject_gets_reject_vote',
- Neutral: 'subject_gets_neutral_vote',
- Accept: 'subject_gets_accept_vote'}[pv]))
- o.wait_screen(5, pv.icon_c)
- # Show a fixation cross again.
- o.wait_screen(postfeedback_waits[i], o.fixation_cross)
- if not practice:
- # An expendable coplayer is ousted.
- loser = kickout_order[nround]
- coplayers.remove(loser)
- o.wait_screen(5,
- portrait_stim(0, .5, loser),
- o.text(0, -.2, "And it's final decision time. Looks like {} got the most votes to go home! {} journey ends here. You get to continue on to the next island!".format(
- loser['name'],
- pronoun_gen(loser).capitalize())))
- # ------------------------------------------------------------
- # * Preliminaries
- # ------------------------------------------------------------
- o.save('mode', 'fmri' if par['fmri_mode'] else 'eeg')
- par['subject_portrait_path'] = 'subject-{}.jpg'.format(o.data['mode'])
- if par['debug']:
- o.data['subject'] = 'test'
- else:
- o.get_subject_id('Island Getaway - ' + o.data['mode'])
- subject_name = '???'
- o.start_clock()
- # ------------------------------------------------------------
- # * Introduction
- # ------------------------------------------------------------
- with background('Hawaje-NoRedLine.jpg'):
- message(2, 'Aloha!')
- with o.dkey_prefix('introduction'):
- o.instructions('set_the_scene', "Let's pretend you've just landed on the Hawaiian Island of Niihau to begin a summer vacation with a group of {} other teens. But the journey isn't over yet! First, you must make your way along the islands to get to the Big Island of Hawaii. Once there, your vacation will begin!".format(
- len(coplayers)))
- o.instructions('game_overview', "As you travel along the islands, you'll get to know more and more about the other players. After each round, you'll vote for who you would like to continue on to the Big Island with you and who you would like to send home. But the other players will also be voting on you! And your goal is to stay in the game and be one of the {} players (out of the original {}) who make it to the Big Island!".format(
- len(coplayers) + 1 - (len(round_descriptions) + 1),
- len(coplayers) + 1))
- with o.dkey_prefix('profile'):
- o.text_entry_screen('gender', 'Now you can fill out your profile.\n\nWhat is your gender?')
- o.data['profile']['gender'] = simplify_gender(o.data['profile']['gender'])
- if o.data['profile']['gender'] == 'Male':
- # Make a male non-expendable female so that there's
- # of equal number of male and female players.
- transgal = choice([p for p in coplayers if not p['female']])
- transgal['female'] = True
- transgal['name'] = choice(female_names - {p['name'] for p in coplayers if p['female']})
- transgal['portrait'] = choice(female_portraits - {p['portrait'] for p in coplayers if p['female']})
- o.text_entry_screen('name', 'What is your first name?')
- subject_name = o.data['profile']['name']
- # Try to normalize capitalization.
- if subject_name.isalpha() and (
- subject_name.islower() or
- (len(subject_name) > 2 and subject_name.isupper())):
- # Don't downcase "AJ".
- subject_name = subject_name.lower().capitalize()
- # If the subject's name exactly matches the name of a
- # coplayer (case-insensitively), rename the coplayer.
- try:
- p = next(p for p in coplayers if
- p['name'].lower() == subject_name.lower())
- p['name'] = extra_female_name if p['female'] else extra_male_name
- except StopIteration:
- pass
- o.nonneg_int_entry_screen('age', 'How old are you?')
- o.text_entry_screen('school', 'What school do you go to?')
- o.text_entry_screen('interests', "What are some things you're interested in?")
- o.okay_screen('view',
- portrait_stim(0, .5, None),
- o.html(0, 0,
- subject_name + "<br><br>" +
- '<b>{}</b><br>'.format(o.data['profile']['gender']) +
- '<br>'.join(
- '<b>{}:</b> {}'.format(k.capitalize(), escape(o.data['profile'][k])) for k in
- ['age', 'school', 'interests'])))
- # Don't keep the profile data due to IRB shenanigans (for
- # the Kujawa lab at Penn State).
- del o.data['profile']
- lag(3)
- # Now that the coplayers' genders are set, we can assign trigger
- # codes.
- seen_genders = [0, 0]
- for p in coplayers:
- p['trigger_id'] = seen_genders[p['female']]
- seen_genders[p['female']] += 1
- write('intro')
- # ------------------------------------------------------------
- # * Round 0
- # ------------------------------------------------------------
- with o.dkey_prefix(('round', 0)), background('Niihau_sep_2007.jpg'):
- message(round_wait, 'Round 1: Niihau')
- o.instructions('read_profiles', 'Take a moment to learn about the other players.')
- cps = shuffled(coplayers)
- o.save('profile_order', [p['id'] for p in cps])
- for i, p in enumerate(cps):
- o.okay_screen(('fluff', i),
- portrait_stim(0, .5, p),
- o.html(0, 0,
- '<b>{}</b><br><br>'.format(p['name']) +
- '<b>{}</b><br>'.format('Female' if p['female'] else 'Male') +
- '<br>'.join(
- '<b>{}:</b> {}'.format(k, escape(p['fluff'][k])) for k in
- ['Age', 'School', 'Interests'])))
- if par['fmri_mode']:
- ready_key = 'r'
- o.keypress_screen('fmri_setup',
- ready_key,
- o.text(0, 0, string = 'You may now enter the fMRI scanner.\n\nExperimenter, press the "{}" key when ready.'.format(ready_key)))
- #rate_likabilities('pre')
- o.instructions('voting_begins', html = True, string = "And on to the first round of voting. Who do you want to send home? And who do you want to continue with on to the next island? You will now vote to kick out or keep each player. You have {voting_time_limit} seconds to vote. The player with the greatest percentage of votes to be sent home will be kicked off the island, with ties broken randomly.<br><br>Each time you vote, you will then find out how that player voted for you.".format(**globals()))
- o.okay_screen('feedback_explanation',
- o.text(0, .7, "For each player, after you've made your own vote, you'll see an icon that shows their vote."),
- accept_icon(-.5, .1),
- o.text(-.5, -.2, "This means a vote to keep you.",
- vAlign = 'top', wrap = .5),
- neutral_icon(0, .1),
- o.text(0, -.2, "This means no vote (possibly due to a network error).",
- vAlign = 'top', wrap = .5),
- reject_icon(.5, .1),
- o.text(.5, -.2, "This means a vote to kick you out.",
- vAlign = 'top', wrap = .5))
- with o.dkey_prefix('voting_practice'):
- o.instructions('intro', "First, you'll see two examples of how voting works.")
- voting(None)
- o.instructions('done', 'Now for the first round of real voting.')
- voting(0)
- write('voting-round-0')
- # ------------------------------------------------------------
- # * All other rounds
- # ------------------------------------------------------------
- for i, (r, (poll_question)) in enumerate(zip(round_descriptions, poll)):
- nround = i + 1
- with o.dkey_prefix(('round', nround)), background(r['background']):
- message(round_wait, 'Round {}: {}'.format(nround + 1, r['place']))
- o.instructions('fluff', r['fluff'])
- #o.text_entry_screen('poll_question',
- # "Now on to the next round!.\n\n")
- #for p, resp in zip(coplayers, shuffled(poll_responses)):
- # p['poll_response'][nround] = resp
- #varwait = max(expovariate(2) for _ in coplayers)
- #o.save('poll_varwait', varwait)
- #lag(varwait)
- #responses = shuffled(
- # [(p['id'], p['name'], p['poll_response'][nround]) for p in coplayers] +
- # [('SUBJECT', subject_name, o.data['round'][nround]['poll_question'])])
- #o.save('poll_response_order', [r[0] for r in responses])
- #o.okay_screen('poll_results',
- # o.text(0, .8, "Here are your responses:"),
- # o.text(0, .65,
- # "\n".join(["{}: {}".format(r[1], r[2]) for r in responses]),
- # height = .06,
- # wrap = 1.4, vAlign = 'top'))
- voting(nround)
- write('voting-round-' + str(nround))
- # ------------------------------------------------------------
- # * A winner is you!
- # ------------------------------------------------------------
- with background('Rainbow_over_palms_at_Big_Island_of_Hawaii.jpg'):
- message(3, 'You made it to the Big Island of Hawaii!\nLet the vacation begin!')
- #rate_likabilities('post')
- # ------------------------------------------------------------
- # * Post-game questionnaire
- # ------------------------------------------------------------
- #refuse = 'I prefer not\nto answer'
- #scale_levels = ('Not at all', 'Somewhat', 'Extremely', refuse)
- #na_scale_level = scale_levels.index(refuse) + 1
- #questions = [
- # {'id': ('need threat', 1), 'text': 'I felt as one with the other players.'},
- # {'id': ('task disengagement', 5), 'text': 'I really wanted to stay in the game.'},
- # {'id': ('need threat', 5), 'text': 'I felt like an outsider during the game.'},
- # {'id': ('task disengagement', 2), 'text': 'After a while I lost interest in staying in the game.'},
- # {'id': ('need threat', 3), 'text': 'I did not feel accepted by the other players.'},
- # {'id': ('need threat', 2), 'text': 'I had the feeling that I belonged to the group during the game.'},
- # {'id': ('need threat', 4), 'text': 'During the game I felt connected with one or more other players.'},
- # {'id': ('task disengagement', 3), 'text': "I would've liked to play this game again."}]
- #with o.dkey_prefix('postgame_questionnaire'), background('Rainbow_over_palms_at_Big_Island_of_Hawaii.jpg'):
- #for q in questions:
- #o.scale_screen(q['id'],
- #o.text(0, .5, 'In this questionnaire, pick the options that best represent the feelings you were experiencing during the game.'),
- #o.text(0, 0, q['text']),
- #rating_scale(y = -.2,
- #num_options = len(scale_levels),
- #choices = scale_levels,
- #textSize = .8,
- #transform = lambda v:
- #'NA' if v == refuse else scale_levels.index(v) + 1),
- #rating_scale_controls_text(num_options = len(scale_levels)))
- # ------------------------------------------------------------
- # * Done!
- # ------------------------------------------------------------
- o.done()
- write('done')
- o.wait_screen(1,
- o.text(0, 0, color = 'white', string = 'Done!\n\nPlease let the experimenter know you are done.'))
- finally:
- try:
- o.trigger_worker.terminate()
- except:
- pass
IG_Task_Code.py at commit d0e26e7, no license · at the source
Overview
- Department of Psychology and Human Development Vanderbilt University Nashville Tennessee USA
- Department of Psychology Virginia Tech Blacksburg Virginia USA
- Department of Psychiatry University of Pittsburgh School of Medicine Pittsburgh Pennsylvania USA
Abstract
Background: The present pilot study aimed to (1) Characterize neural markers of reward sensitivity during periods of social stress; (2) Evaluate clinical relations between neural reward markers and anhedonia; and (3) Investigate if peer victimization was associated with ventral striatum (VS) suppression and anhedonia symptoms during social stress.
Methods: A total of 28 adolescents between the ages of 13 and 17 (M age = 15.31; SD = 1.51; 55.2% cisgender girls) were included in analyses and completed a semi‐structured interview, self‐report questionnaires regarding social anxiety, stress, depression, and anhedonia, and a magnetic resonance imaging (MRI) scan while engaging in the Island Getaway task. VS BOLD signal activation estimates were then extracted during discrete phases of the task (e.g., anticipation of social feedback and outcome of social feedback) and statistically compared within‐subjects.
Results: Results revealed that when in the presence of social stress (defined as the potential for negative feedback), socially anxious adolescents demonstrated significantly suppressed VS activation relative to feedback anticipation. Additionally, the reduced VS activation during the outcome phase was significantly correlated with anhedonia. Moreover, relational peer victimization was associated with suppressed VS activation.
Conclusions: Findings identify novel mechanisms associated with anhedonia and blunted reward processing in socially anxious youth that could be improved via interventions that target positive‐valence systems.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 3 matches between paragraphs and lines of code.
daisylabhub/ARSA
d0e26e75253a8350e8afce7eaea32fdb3e5620e3, 3 May 2023Availability: 1 check, the latest on 26 September 2026: the link answers
- 26 September 2026: the link answers
6 files
- 1_dicom_parser.sh, Shell, 94 lines
- 2_watershedandANTS.sh, Shell, 19 lines, 1 match
- 3_reconall.sh, Shell, 13 lines
- 4_ARSA.firstlevel.py, Python, 542 lines
- IG_Task_Code.py, Python, 877 lines, 2 matches
- JSON Cleaning & 3 column Script.sas, SAS, 534 lines
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 6 scripts, each with its path and the digest of its content;
- 3 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data Availability Statement
Data are available upon request.
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 6 keywords, 15 MeSH terms, 4 funders, 78 references.
Cite
This paper
Carlton, C. N., Antezana, L., & Richey, J. A. (2026). Blunted Reward Responsiveness During Social Feedback: Associations with Peer Victimization and Anhedonia in Socially Anxious Adolescents. Brain and behavior, 16(8), e71581. https://
BibTeX
@article{carlton2026blun
author = {Carlton, Corinne N. and Antezana, Ligia and Richey, John A.},
title = {{Blunted Reward Responsiveness During Social Feedback: Associations with Peer Victimization and Anhedonia in Socially Anxious Adolescents}},
journal = {Brain and behavior},
year = {2026},
month = aug,
volume = {16},
number = {8},
pages = {e71581},
publisher = {Wiley},
issn = {2162-3279},
doi = {10.1002/
url = {https://
pmid = {42518193},
pmcid = {PMC13411298}
}
RIS
TY - JOUR
AU - Carlton, Corinne N.
AU - Antezana, Ligia
AU - Richey, John A.
TI - Blunted Reward Responsiveness During Social Feedback: Associations with Peer Victimization and Anhedonia in Socially Anxious Adolescents
T2 - Brain and behavior
J2 - Brain Behav
PY - 2026
DA - 2026/
VL - 16
IS - 8
SP - e71581
SN - 2162-3279
PB - Wiley
DO - 10.1002/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1002/
"type": "article-journal",
"title": "Blunted Reward Responsiveness During Social Feedback: Associations with Peer Victimization and Anhedonia in Socially Anxious Adolescents",
"container-title": "Brain and behavior",
"author": [
{
"family": "Carlton",
"given": "Corinne N."
},
{
"family": "Antezana",
"given": "Ligia"
},
{
"family": "Richey",
"given": "John A."
}
],
"container-title-short":
"volume": "16",
"issue": "8",
"page": "e71581",
"DOI": "10.1002/
"PMID": "42518193",
"PMCID": "PMC13411298",
"ISSN": "2162-3279",
"publisher": "Wiley",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
1
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1162/netn.a.547 [code]
- An evaluation of the efficacy of single-echo and multi-echo fMRI denoising strategies.Journal: Network neuroscience (Cambridge, Mass.)In common: dcm2niix, Nipype, ANTs, 4 other tools, 2 references
- [2] doi:10.1002/hbm.70512 [code]
- Precision Imaging for Intraindividual Investigation of the Reward Response.Journal: Human brain mappingIn common: dcm2niix, PsychoPy, ANTs, 2 other tools, 3 references
- [3] doi:10.1038/s41467-026-71568-9 [code]
- Convergent and selective representations of pain, appetitive processes, aversive processes, and cognitive control in the insula.Journal: Nature communicationsIn common: Nipype, ANTs, FreeSurfer, 4 other tools, 1 reference
- [4] doi:10.1038/s41467-026-72605-3 [code]
- Resolving mesoscale brainstem-prefrontal-str
iatal pathways underlying decisions upon salient events using submillimeter-resolution fMRI. Journal: Nature communicationsIn common: PsychoPy, ANTs, FreeSurfer, 3 other tools, 2 references - [5] doi:10.1038/s41467-026-71151-2 [code]
- Common and distinct neural correlates of social interaction processing and theory of mind in narratives.Journal: Nature communicationsIn common: Nipype, ANTs, FreeSurfer, 4 other tools, 1 reference
- [6] doi:10.1186/s13293-026-00891-z [code]
- Sex differences in dynamic and static measures of brain integration derived from resting-state functional magnetic resonance imaging.Journal: Biology of sex differencesIn common: Nipype, ANTs, FreeSurfer, 4 other tools, 1 reference
- [7] doi:10.21203/rs.3.rs-9326213/v1 [code]
- Multi-task fMRI outperforms resting-state fMRI for revealing task-invariant organization of the human brainJournal: Research Square (preprint)In common: PsychoPy, ANTs, FreeSurfer, 4 other tools, 1 reference
- [8] doi:10.64898/2026.03.09.710558 [code]
- Multi-task fMRI outperforms resting-state fMRI for revealing task-invariant organization of the human brainJournal: bioRxiv (preprint)In common: PsychoPy, ANTs, FreeSurfer, 4 other tools, 1 reference
- [9] doi:10.1038/s41597-026-06869-1 [code]
- Individual Brain Charting: fifth release of high-resolution fMRI data for cognitive mapping.Journal: Scientific dataIn common: Nipype, PsychoPy, ANTs, 4 other tools
- [10] doi:10.1038/s41467-026-71918-7 [code]
- Developmental disinhibition gates language lateralization in childhood.Journal: Nature communicationsIn common: dcm2niix, ANTs, FreeSurfer, 4 other tools
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 6 scripts, and 3 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:c5e4a0ae495fd479…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
