OSCR

Differential Effects of Balanced and Imbalanced Binocular Stimulation on Visual Cortex Responses in Amblyopic Children.

Code ↔ Paper

9 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

8 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.

The 9 matches
  1. [1] § Materials and Methods › MRI Sequence ↔ mripy/dicom.py, lines 80 to 155 · score 0.96 · phase encoding direction, gradient recalled, echo planar, GE EPI, distortion correction, FOV · block oscr:b:Q4PCW55QEGVB6-7 · Report a mismatch
  2. [2] § Materials and Methods › MRI Sequence ↔ mripy/dicom_report.py, lines 23 to 80 · score 0.79 · distortion correction, MPRAGE, TE, FA, FOV, Siemens · block oscr:b:X4MN1058WNSWQ-1 · Report a mismatch
  3. [3] § Materials and Methods › fMRI Data Analysis › Preprocessing ↔ mripy/preprocess.py, lines 1888 to 2011 · score 0.70 · rigid body, AFNI, lpc, preprocessed, EPI, transformations · block oscr:b:KQT78DF08B4F8-A · Report a mismatch
  4. [4] § Materials and Methods › Visual Stimuli for Cortical Activation ↔ stimuli/gratingStimulus.m, lines 1 to 121 · score 0.63 · square wave, temporal frequency, sinusoidally, modulated, deg, SF · block oscr:b:K6QNGTST55J3P-8 · Report a mismatch
  5. [5] § Materials and Methods › Visual Stimuli for Cortical Activation ↔ stimuli/colourGratingStimulus.m, lines 1 to 133 · score 0.61 · square wave, temporal frequency, sinusoidally, deg, SF, angle · block oscr:b:CHAK6DDB4SK2A-I · Report a mismatch
  6. [6] § Materials and Methods › Apparatus ↔ calibration/calibrateLuminance.m, lines 1 to 81 · score 0.56 · SpectroCal, instructed, monitored, Linux, luminance, asked · block oscr:b:13RG707Y96SZX-T · Report a mismatch
  7. [7] § Materials and Methods › Apparatus ↔ calibration/calibrateLuminanceNew.m, lines 1 to 81 · score 0.56 · SpectroCal, instructed, monitored, Linux, luminance, asked · block oscr:b:7DYFJN0S2TNFB-8 · Report a mismatch
  8. [8] § Materials and Methods › Retinotopic Mapping ↔ stimuli/colourGratingStimulus.m, lines 1 to 133 · score 0.56 · square wave, phase reversed, ratio, background, setup · block oscr:b:CHAK6DDB4SK2A-I · Report a mismatch
  9. [9] § Materials and Methods › Retinotopic Mapping ↔ stimuli/polarGratingStimulus.m, lines 1 to 144 · score 0.56 · square wave, phase reversed, ratio, background, setup · block oscr:b:D6AFQY3D1WDYV-S · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

MATLAB · 612 lines · 22 KB · LGPL-3.0 · 2 matches

  1. % ========================================================================
  2. %> @brief colour grating stimulus, inherits from baseStimulus
  3. %> COLOURGRATINGSTIMULUS colour grating stimulus, inherits from baseStimulus
  4. %> The basic properties are:
  5. %> type = 'sinusoid' or 'square', if square you should set sigma which
  6. %> smoothes the interface and stops pixel motion artifacts that normally
  7. %> inflict square wave gratings, set sigma to 0 to remove smoothing.
  8. %> colour = first grating colour
  9. %> colour2 = second grating colour
  10. %> baseColour = the midpoint between the two from where contrast works,
  11. %> defult just inherits the background colour from screenManager
  12. %> correctBaseColour = automatically generate baseColour as the average
  13. %> of colour and colour2
  14. %> contrast = contrast from 0 - 1
  15. %> sf = spatial frequency in degrees
  16. %> tf = temporal frequency in degs/s
  17. %> angle = angle in degrees
  18. %> rotateTexture = do we rotate the grating texture (true) or the patch itself (false)
  19. %> phase = phase of grating
  20. %> mask = use circular mask (true) or not (false)
  21. %>
  22. %> See docs for more property details.
  23. %>
  24. %> @todo phase appears different to gratingStimulus, work out why
  25. %>
  26. %> Copyright ©2014-2022 Ian Max Andolina — released: LGPL3, see LICENCE.md
  27. % ========================================================================
  28. classdef colourGratingStimulus < baseStimulus
  29. properties %--------------------PUBLIC PROPERTIES----------%
  30. %> family type, can be 'sinusoid' or 'square'
  31. type char = 'sinusoid'
  32. %> spatial frequency of the grating
  33. sf(1,1) double = 1
  34. %> temporal frequency of the grating
  35. tf(1,1) double = 1
  36. %> second colour of a colour grating stimulus
  37. colour2(1,:) double = [0 1 0 1]
  38. %> base colour from which colour and colour2 are blended via contrast value
  39. %> if empty [default], uses the background colour from screenManager
  40. baseColour(1,:) double = []
  41. %> rotate the grating patch (false) or the grating texture within the patch (default = true)?
  42. rotateTexture logical = true
  43. %> phase of grating
  44. phase(1,1) double = 0
  45. %> contrast of grating (technically the contrast from the baseColour)
  46. contrast(1,1) double = 0.5
  47. %> use a circular mask for the grating (default = true).
  48. mask logical = true
  49. %> direction of the drift; default = false means drift left>right when angle is 0deg.
  50. %This switch can be accomplished simply setting angle, but this control enables
  51. %simple reverse direction protocols.
  52. reverseDirection logical = false
  53. %> the direction of the grating object if moving.
  54. direction double = 0
  55. %> Do we need to correct the phase to be relative to center not edge? This enables
  56. %> centre surround stimuli are phase matched, and if we enlarge a grating object its
  57. %> phase stays identical at the centre of the object (where we would imagine our RF)
  58. correctPhase logical = false
  59. %> In certain cases the base colour should be calculated
  60. %> dynamically from colour and colour2, and this enables this to
  61. %> occur blend
  62. correctBaseColour logical = false
  63. %> Reverse phase of grating X times per second? Useful with a static grating for linearity testing
  64. phaseReverseTime(1,1) double = 0
  65. %> What phase to use for reverse?
  66. phaseOfReverse(1,1) double = 180
  67. %> sigma of square wave smoothing, use -1 for sinusoidal gratings
  68. sigma(1,1) double = -1
  69. %> aspect ratio of the grating
  70. aspectRatio(1,1) double = 1;
  71. %> turn stimulus on/off at X hz, [] diables this
  72. visibleRate = []
  73. end
  74. properties (SetAccess = protected, GetAccess = public)
  75. %stimulus family
  76. family char = 'grating'
  77. %> scale is used when changing size as an independent variable to keep sf accurate
  78. scale double = 1
  79. %> the phase amount we need to add for each frame of animation
  80. phaseIncrement double = 0
  81. end
  82. properties (Constant)
  83. typeList cell = {'sinusoid';'square'}
  84. end
  85. properties (SetAccess = protected, GetAccess = {?baseStimulus})
  86. %> properties to not show in the UI panel
  87. ignorePropertiesUI = 'alpha';
  88. end
  89. properties (SetAccess = protected, GetAccess = protected)
  90. %> as get methods are slow, we cache sf, then recalculate sf whenever
  91. %> changeScale event is called
  92. sfCache = []
  93. %>to stop a loop between set method and an event
  94. sfRecurse = false
  95. %> allowed properties passed to object upon construction
  96. allowedProperties = {'type','colour2', 'sf', 'tf', 'angle', 'direction', 'phase', 'rotateTexture', ...
  97. 'contrast', 'mask', 'reverseDirection', 'speed', 'startPosition', 'aspectRatio', ...
  98. 'sigma', 'correctPhase', 'phaseReverseTime', 'phaseOfReverse','visibleRate',...
  99. 'correctBaseColour'}
  100. %> properties to not create transient copies of during setup phase
  101. ignoreProperties = {'type', 'scale', 'phaseIncrement', 'correctPhase', 'contrastMult', 'mask', 'typeList'}
  102. %> how many frames between phase reverses
  103. phaseCounter = 0
  104. %> mask value (radius for the procedural shader)
  105. maskValue
  106. %> the raw shader, we can try to change colours.
  107. shader
  108. %> these store the current colour so we can check if update needs
  109. %to regenerate the shader
  110. colourCache
  111. colour2Cache
  112. visibleTick = 0
  113. visibleFlip = Inf
  114. end
  115. %=======================================================================
  116. methods %------------------PUBLIC METHODS
  117. %=======================================================================
  118. % ===================================================================
  119. %> @brief Class constructor
  120. %>
  121. %> More detailed description of what the constructor does.
  122. %>
  123. %> @param args are passed as a structure of properties which is
  124. %> parsed.
  125. %> @return instance of class.
  126. % ===================================================================
  127. function me = colourGratingStimulus(varargin)
  128. args = optickaCore.addDefaults(varargin,...
  129. struct('name','colour-grating','colour',[1 0 0 1],'colour2',[0 1 0 1]));
  130. me=me@baseStimulus(args); %we call the superclass constructor first
  131. me.parseArgs(args, me.allowedProperties);
  132. me.isRect = true; %uses a rect for drawing
  133. me.ignoreProperties = [me.ignorePropertiesBase me.ignoreProperties];
  134. me.salutation('constructor method','Stimulus initialisation complete');
  135. end
  136. % ===================================================================
  137. %> @brief Setup this object in preparation for use
  138. %> When displaying a stimulus object, the main properties that are to be
  139. %> modified are copied into cache copies of the property, both to convert from
  140. %> visual description (c/d, Hz, degrees) to
  141. %> computer metrics, and to be animated and modified as independant
  142. %> variables. So xPosition is copied to xPositionOut and converted from
  143. %> degrees to pixels. The animation and drawing functions use these modified
  144. %> properties, and when they are updated, for example to change to a new
  145. %> xPosition, internal methods ensure reconversion and update any dependent
  146. %> properties. This method initialises the object with all the cache properties
  147. %> for display.
  148. %>
  149. %> @param sM screenManager object to use
  150. % ===================================================================
  151. function setup(me,sM)
  152. reset(me); %reset object back to its initial state
  153. me.inSetup = true; me.isSetup = false;
  154. if isempty(me.isVisible); show(me); end
  155. me.sM = sM;
  156. if ~sM.isOpen; error('Screen needs to be Open!'); end
  157. me.ppd=sM.ppd;
  158. me.screenVals = sM.screenVals;
  159. me.texture = []; %we need to reset this
  160. fn = sort(properties(me));
  161. for j=1:length(fn)
  162. if ~matches(fn{j}, me.ignoreProperties)
  163. p=me.addprop([fn{j} 'Out']);
  164. if strcmp(fn{j}, 'sf'); p.SetMethod = @set_sfOut; end
  165. if strcmp(fn{j}, 'tf')
  166. p.SetMethod = @set_tfOut; p.SetObservable = true;
  167. addlistener(me, [fn{j} 'Out'], 'PostSet', @me.calculatePhaseIncrement);
  168. end
  169. if strcmp(fn{j}, 'reverseDirection')
  170. p.SetMethod = @set_reverseDirectionOut; p.SetObservable = true;
  171. addlistener(me, [fn{j} 'Out'], 'PostSet', @me.calculatePhaseIncrement);
  172. end
  173. if strcmp(fn{j}, 'size')
  174. p.SetMethod = @set_sizeOut; p.SetObservable = true;
  175. addlistener(me, [fn{j} 'Out'], 'PostSet', @me.calculateScale);
  176. end
  177. if strcmp(fn{j}, 'xPosition'); p.SetMethod = @set_xPositionOut; end
  178. if strcmp(fn{j}, 'yPosition'); p.SetMethod = @set_yPositionOut; end
  179. if strcmp(fn{j}, 'colour')
  180. p.SetMethod = @set_cOut; p.SetObservable = true;
  181. addlistener(me, [fn{j} 'Out'], 'PostSet', @me.fixBaseColour);
  182. end
  183. if strcmp(fn{j}, 'colour2')
  184. p.SetMethod = @set_c2Out; p.SetObservable = true;
  185. addlistener(me, [fn{j} 'Out'], 'PostSet', @me.fixBaseColour);
  186. end
  187. me.([fn{j} 'Out']) = me.(fn{j}); %copy our property value to our temporary copy
  188. end
  189. end
  190. addRuntimeProperties(me);
  191. if ~isprop(me,'rotateMode'); addprop(me,'rotateMode'); end
  192. if me.rotateTexture
  193. me.rotateMode = kPsychUseTextureMatrixForRotation;
  194. else
  195. me.rotateMode = [];
  196. end
  197. if ~isprop(me,'gratingSize'); addprop(me,'gratingSize'); end
  198. me.gratingSize = round(me.ppd*me.size); %virtual support larger than initial size
  199. if ~isprop(me,'driftPhase'); addprop(me,'driftPhase'); end
  200. if me.correctPhase
  201. ps = me.calculatePhase;
  202. me.driftPhase = me.phaseOut-ps;
  203. else
  204. me.driftPhase = me.phaseOut;
  205. end
  206. if ~isprop(me,'res'); addprop(me,'res'); end
  207. switch length(me.aspectRatio)
  208. case 1
  209. me.res = round([me.gratingSize*me.aspectRatio me.gratingSize]);
  210. case 2
  211. me.res = round([me.gratingSize*me.aspectRatio(1) me.gratingSize*me.aspectRatio(2)]);
  212. end
  213. if max(me.res) > me.sM.screenVals.width %scale to be no larger than screen width
  214. me.res = floor( me.res / (max(me.res) / me.sM.screenVals.width));
  215. end
  216. if me.mask == true
  217. me.maskValue = floor((me.ppd*me.size))/2;
  218. else
  219. me.maskValue = [];
  220. end
  221. if me.phaseReverseTime > 0
  222. me.phaseCounter = round(me.phaseReverseTime / me.sM.screenVals.ifi);
  223. end
  224. if isempty(me.baseColour)
  225. if me.correctBaseColour
  226. me.baseColourOut = (me.colourOut(1:3) + me.colour2Out(1:3)) / 2;
  227. me.baseColourOut(4) = me.alpha;
  228. else
  229. me.baseColourOut = me.sM.backgroundColour;
  230. me.baseColourOut(4) = me.alpha;
  231. end
  232. end
  233. if strcmpi(me.type,'square')
  234. if me.sigma < 0; me.sigma = 0.05; me.sigmaOut = me.sigma; end
  235. else
  236. me.salutation('SETUP', 'Reset sigma to -1 as type=squarewave', true)
  237. me.sigmaOut = -1; %just make sure type overrides sigma if conflict
  238. end
  239. % this is a two color grating, passing in colorA and colorB.
  240. [me.texture, ~, me.shader] = CreateProceduralColorGrating(me.sM.win, me.res(1),...
  241. me.res(2), me.colourOut, me.colour2Out, me.maskValue);
  242. me.colourCache = me.colourOut; me.colour2Cache = me.colour2Out;
  243. if ~isempty(me.visibleRateOut) && isnumeric(me.visibleRateOut)
  244. me.visibleTick = 0;
  245. me.visibleFlip = round((me.screenVals.fps/2) / me.visibleRateOut);
  246. else
  247. me.visibleFlip = Inf; me.visibleTick = 0;
  248. end
  249. me.inSetup = false; me.isSetup = true;
  250. computePosition(me);
  251. setRect(me);
  252. if me.doAnimator
  253. me.animator.setup(me.sM);
  254. me.syncAnimator();
  255. end
  256. function set_cOut(me, value)
  257. len=length(value);
  258. switch len
  259. case {4,3}
  260. c = [value(1:3) me.alpha]; %force our alpha to override
  261. case 1
  262. c = [value value value me.alpha]; %construct RGBA
  263. otherwise
  264. c = [1 1 1 me.alpha]; %return white for everything else
  265. end
  266. c(c<0)=0; c(c>1)=1;
  267. me.colourOut = c;
  268. end
  269. function set_c2Out(me, value) %#ok<*MCSGP>
  270. len=length(value);
  271. switch len
  272. case {4,3}
  273. c = [value(1:3) me.alpha]; %force our alpha to override
  274. case 1
  275. c = [value value value me.alpha]; %construct RGBA
  276. otherwise
  277. c = [1 1 1 me.alpha]; %return white for everything else
  278. end
  279. c(c<0)=0; c(c>1)=1;
  280. me.colour2Out = c;
  281. end
  282. function set_sfOut(me,value)
  283. if me.sfRecurse == false
  284. me.sfCache = (value / me.ppd);
  285. me.sfOut = me.sfCache * me.scale;
  286. else
  287. me.sfOut = value;
  288. me.sfRecurse = false;
  289. end
  290. %fprintf('\nSET SFOut: %d | cache: %d | in: %d\n', me.sfOut, me.sfCache, value);
  291. end
  292. function set_tfOut(me,value)
  293. me.tfOut = value;
  294. end
  295. function set_reverseDirectionOut(me,value)
  296. me.reverseDirectionOut = value;
  297. end
  298. function set_sizeOut(me,value)
  299. me.sizeOut = value*me.ppd;
  300. me.szPx = me.sizeOut;
  301. end
  302. function set_xPositionOut(me, value)
  303. me.xPositionOut = value * me.ppd;
  304. end
  305. function set_yPositionOut(me,value)
  306. me.yPositionOut = value*me.ppd;
  307. end
  308. end
  309. % ===================================================================
  310. %> @brief Update this stimulus object for display
  311. %>
  312. % ===================================================================
  313. function update(me)
  314. me.rewindAnimator();
  315. resetTicks(me);
  316. if me.correctPhase
  317. ps=me.calculatePhase;
  318. me.driftPhase=me.phaseOut-ps;
  319. else
  320. me.driftPhase=me.phaseOut;
  321. end
  322. if ~all(me.colourCache(1:3) == me.colourOut(1:3)) || ...
  323. ~all(me.colour2Cache(1:3) == me.colour2Out(1:3))
  324. glUseProgram(me.shader);
  325. glUniform4f(glGetUniformLocation(me.shader, 'color1'),...
  326. me.colourOut(1),me.colourOut(2),me.colourOut(3),me.alphaOut);
  327. glUniform4f(glGetUniformLocation(me.shader, 'color2'),...
  328. me.colour2Out(1),me.colour2Out(2),me.colour2Out(3),me.alphaOut);
  329. if me.mask == true
  330. me.maskValue = me.sizeOut/2;
  331. else
  332. me.maskValue = 0;
  333. end
  334. glUniform1f(glGetUniformLocation(me.shader, 'radius'), me.maskValue);
  335. glUseProgram(0);
  336. me.colourCache = me.colourOut; me.colour2Cache = me.colour2Out;
  337. end
  338. if ~isempty(me.visibleRateOut) && isnumeric(me.visibleRateOut)
  339. me.isVisible = true;
  340. me.visibleTick = 0;
  341. me.visibleFlip = round((me.screenVals.fps/2) / me.visibleRateOut);
  342. else
  343. me.visibleFlip = Inf; me.visibleTick = 0;
  344. end
  345. computePosition(me);
  346. setRect(me);
  347. end
  348. % ===================================================================
  349. %> @brief Draw this stimulus object for display
  350. %>
  351. %>
  352. % ===================================================================
  353. function draw(me)
  354. if me.isVisible && me.tick >= me.delayTicks && me.tick < me.offTicks
  355. Screen('DrawTexture', me.sM.win, me.texture, [], me.mvRect,...
  356. me.angleOut, [], [], me.baseColourOut, [], me.rotateMode,...
  357. [me.driftPhase, me.sfOut, me.contrastOut, me.sigmaOut]);
  358. me.drawTick = me.drawTick + 1;
  359. end
  360. if me.isVisible; me.tick = me.tick + 1; end
  361. end
  362. % ===================================================================
  363. %> @brief Animate this object for runExperiment
  364. %>
  365. % ===================================================================
  366. function animate(me)
  367. if (me.isVisible || ~isempty(me.visibleRate)) && me.tick >= me.delayTicks
  368. if me.mouseOverride
  369. getMousePosition(me);
  370. if me.mouseValid
  371. me.mvRect = CenterRectOnPointd(me.mvRect, me.mouseX, me.mouseY);
  372. end
  373. end
  374. if me.doAnimator
  375. me.applyAnimator();
  376. elseif me.doMotion
  377. me.mvRect=OffsetRect(me.mvRect,me.dX_,me.dY_);
  378. end
  379. if me.doDrift
  380. me.driftPhase = me.driftPhase + me.phaseIncrement;
  381. end
  382. if mod(me.tick,me.phaseCounter) == 0
  383. me.driftPhase = me.driftPhase + me.phaseOfReverse;
  384. end
  385. me.visibleTick = me.visibleTick + 1;
  386. if me.visibleTick == me.visibleFlip
  387. me.isVisible = ~me.isVisible;
  388. me.visibleTick = 0;
  389. end
  390. end
  391. end
  392. % ===================================================================
  393. %> @brief Reset an structure for runExperiment
  394. %>
  395. %> @param rE runExperiment object for reference
  396. %> @return stimulus structure.
  397. % ===================================================================
  398. function reset(me)
  399. resetTicks(me);
  400. me.inSetup = false; me.isSetup = false;
  401. if ~isempty(me.texture) && Screen(me.texture,'WindowKind') == -1
  402. try Screen('Close',me.texture); end %#ok<*TRYNC>
  403. end
  404. me.visibleFlip = Inf; me.visibleTick = 0;
  405. me.texture=[];
  406. me.shader=[];
  407. if me.mask > 0
  408. me.mask = true;
  409. end
  410. me.maskValue = [];
  411. me.removeTmpProperties;
  412. list = {'res','gratingSize','driftPhase','rotateMode'};
  413. for l = list; if isprop(me,l{1});delete(me.findprop(l{1}));end;end
  414. end
  415. % ===================================================================
  416. %> @brief calculate phase offset
  417. %>
  418. % ===================================================================
  419. function phase = calculatePhase(me)
  420. phase = 0;
  421. if me.correctPhase > 0
  422. ppd = me.ppd;
  423. size = (me.sizeOut / 2); %divide by 2 to get the 0 point
  424. sfTmp = (me.sfOut / me.scale) * ppd;
  425. md = size / (ppd / sfTmp);
  426. md = md - floor(md);
  427. % note for some reason colourgratings are 180° different to
  428. % gratings, so we compensate here so they should align if
  429. % correctPhase is true
  430. phase = (360 * md) + 180;
  431. end
  432. end
  433. % ===================================================================
  434. %> @brief sf Set method
  435. %>
  436. % ===================================================================
  437. function set.sf(me,value)
  438. if value <= 0
  439. value = 0.05;
  440. end
  441. me.sf = value;
  442. me.salutation(['set sf: ' num2str(value)],'Custom set method')
  443. end
  444. % ===================================================================
  445. %> @brief SET Colour2 method
  446. %> Allow 1 (R=G=B) 3 (RGB) or 4 (RGBA) value colour
  447. % ===================================================================
  448. function set.colour2(me,value)
  449. len=length(value);
  450. switch len
  451. case 4
  452. c = value;
  453. case 3
  454. c = [value(1:3) me.alpha]; %force our alpha to override
  455. case 1
  456. c = [value value value me.alpha]; %construct RGBA
  457. otherwise
  458. c = [1 1 1 me.alpha]; %return white for everything else
  459. end
  460. c(c<0)=0; c(c>1)=1;
  461. me.colour2 = c;
  462. if isprop(me, 'baseColour') && me.correctBaseColour %#ok<*MCSUP>
  463. me.baseColour = (me.colour(1:3) + me.colour2(1:3))/2;
  464. end
  465. end
  466. % ===================================================================
  467. %> @brief SET baseColour method
  468. %> Allow 1 (R=G=B) 3 (RGB) or 4 (RGBA) value colour
  469. % ===================================================================
  470. function set.baseColour(me,value)
  471. len=length(value);
  472. switch len
  473. case 4
  474. c = value;
  475. case 3
  476. c = [value(1:3) me.alpha]; %force our alpha to override
  477. case 1
  478. c = [value value value me.alpha]; %construct RGBA
  479. otherwise
  480. c = [1 1 1 me.alpha]; %return white for everything else
  481. end
  482. c(c<0)=0; c(c>1)=1;
  483. me.baseColour = c;
  484. end
  485. % ===================================================================
  486. %> @brief sfOut Pseudo Get method
  487. %>
  488. % ===================================================================
  489. function sf = getsfOut(me)
  490. sf = 0;
  491. if ~isempty(me.sfCache)
  492. sf = me.sfCache * me.ppd;
  493. end
  494. end
  495. end %---END PUBLIC METHODS---%
  496. %=======================================================================
  497. methods ( Access = protected ) %-------PROTECTED METHODS-----%
  498. %=======================================================================
  499. % ===================================================================
  500. %> @brief setRect
  501. %> setRect makes the PsychRect based on the texture and screen values
  502. %> this is modified over parent method as gratings have slightly different
  503. %> requirements.
  504. % ===================================================================
  505. function setRect(me)
  506. %me.dstRect=Screen('Rect',me.texture);
  507. me.dstRect=ScaleRect([0 0 me.res(1) me.res(2)],me.scale,me.scale);
  508. if me.mouseOverride && me.mouseValid
  509. me.dstRect = CenterRectOnPointd(me.dstRect, me.mouseX, me.mouseY);
  510. else
  511. if isprop(me, 'directionOut')
  512. [sx, sy]=pol2cart(me.d2r(me.directionOut),me.startPosition);
  513. else
  514. [sx, sy]=pol2cart(me.d2r(me.direction),me.startPosition);
  515. end
  516. me.dstRect=CenterRectOnPointd(me.dstRect,me.sM.xCenter,me.sM.yCenter);
  517. if isprop(me, 'xPositionOut')
  518. me.dstRect=OffsetRect(me.dstRect,me.xPositionOut+(sx*me.ppd),me.yPositionOut+(sy*me.ppd));
  519. else
  520. me.dstRect=OffsetRect(me.dstRect,(me.xPosition)*me.ppd,(me.yPosition)*me.ppd);
  521. end
  522. end
  523. me.mvRect=me.dstRect;
  524. me.szPx = RectWidth(me.dstRect);
  525. setAnimationDelta(me);
  526. end
  527. % ===================================================================
  528. %> @brief calculateScale
  529. %> Use an event to recalculate scale as get method is slower (called
  530. %> many more times), than an event which is only called on update
  531. % ===================================================================
  532. function calculateScale(me,~,~)
  533. me.scale = me.sizeOut/(me.size*me.ppd);
  534. me.maskValue = me.sizeOut / 2;
  535. me.sfRecurse = true;
  536. me.sfOut = me.sfCache * me.scale;
  537. %fprintf('\nCalculate SFOut: %d | in: %d | scale: %d\n', me.sfOut, me.sfCache, me.scale);
  538. end
  539. % ===================================================================
  540. %> @brief calculatePhaseIncrement
  541. %> Use an event to recalculate as get method is slower (called
  542. %> many more times), than an event which is only called on update
  543. % ===================================================================
  544. function calculatePhaseIncrement(me,~,~)
  545. if isprop(me,'tfOut')
  546. me.phaseIncrement = (me.tfOut * 360) * me.sM.screenVals.ifi;
  547. if isprop(me,'reverseDirectionOut')
  548. if me.reverseDirectionOut == false
  549. me.phaseIncrement = -me.phaseIncrement;
  550. end
  551. end
  552. end
  553. end
  554. % ===================================================================
  555. %> @brief fixBaseColour POST SET
  556. %>
  557. % ===================================================================
  558. function fixBaseColour(me,varargin)
  559. if me.correctBaseColour %#ok<*MCSUP>
  560. if isprop(me, 'baseColourOut')
  561. me.baseColourOut = (me.getP('colour',[1:3]) + me.getP('colour2',[1:3])) / 2;
  562. else
  563. me.baseColour = (me.getP('colour',[1:3]) + me.getP('colour2',[1:3])) / 2;
  564. end
  565. end
  566. end
  567. end
  568. end

colourGratingStimulus.m at commit f7d7a20, under LGPL-3.0 · at the source

Overview

Authors: Yuanyang Huang1, Shu Wang1, Yazhu Qian2, Linghan Kong3, Peijun Zhao3, Yan Liu4, Shahab Aldin Zarei5, Peng Zhang2, Ian Max Andolina5, Hong Liu1,6
  1. Department of Ophthalmology, Shanghai Children’s Medical Center, School of Medicine, Shanghai Jiao Tong University, Shanghai, People’s Republic of China
  2. State Key Laboratory of Brain and Cognitive Science, Institute of Biophysics, Chinese Academy of Sciences, Beijing, People’s Republic of China
  3. School of Biomedical Engineering, Shanghai Jiao Tong University, Shanghai, 200030, People’s Republic of China
  4. Department of Ophthalmology and Visual Science, Eye and ENT Hospital, Shanghai Medical College, Fudan University, Shanghai, People’s Republic of China
  5. Center for Excellence in Brain Science and Intelligence Technology, State Key Laboratory of Brain Cognition and Brain-inspired Intelligence Technology, Institute of Neuroscience, Chinese Academy of Sciences, Shanghai, People’s Republic of China
  6. College of Clinical Medicine for Obstetrics and Gynecology and Pediatrics, Fujian Medical University, Fuzhou, Fujian, People’s Republic of China
Journal: Clinical ophthalmology (Auckland, N.Z.), volume 20, article 590186
Dates: received 19 December 2025; accepted 5 April 2026; published online 23 April 2026
Type: Research article · Language: English
License: CC BY-NC
Identifiers: DOI 10.2147/opth.s590186 · PMID 42052216 · PMCID PMC13117856 · OpenAlex W7155367740
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: fMRI (modality), human (organism), other condition (population)
Methods: Statistics, Connectivity, fMRI & imaging
Keywords: anisometropic amblyopia, fMRI, dichoptic, pediatric
Topic: Visual perception and processing mechanisms (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Natural Science Foundation of Shanghai (23ZR1459200); National Natural Science Foundation of China (32070 992, 81770957)
Citations: not cited yet (Europe PMC); 86 references in the paper

Abstract

Purpose: To investigate the changes in neural activity in V1, V2, and V3 visual cortical areas of control participants and amblyopic patients during visual stimulation under four differing visual inputs.

Patients and Methods: A total of 14 children with monocular amblyopia and 11 age-matched healthy controls were recruited for the study. A fast meridional retinotopic mapping paradigm was employed to efficiently localize regions of interest (ROIs) within the visual cortex. Four types of visual stimulation were achieved using a spatiotemporally modulating checkerboard paired with anaglyph red-blue glasses: amblyopic or non-dominant eye only (AE), fellow or dominant eye only (FE), balanced dichoptic (BE), and imbalanced-dichoptic stimulation (DE).

Results: Amblyopic patients exhibit significantly reduced neural activity across V1, V2, and V3 compared to control participants. DE resulted in the most significant reductions in cortical responses for amblyopes. In the control group, significant differences were observed between AE and BE, FE and BE, and BE and DE, while no significant differences were found between AE and DE. In the amblyopic group, significant differences were identified between AE and DE, FE and DE, AE and BE, FE and BE, as well as between BE and DE.

Conclusion: Imbalanced dichoptic stimulation produced the largest and most significant reductions in cortical responses, observed exclusively in the patient group, indicating a suppressive influence from the fellow eye. These exploratory data support the view that imbalanced dichoptic stimulation may offer greater potential for neural response recovery compared to monocular approaches. The experimental protocols and findings reported here provide a comparative framework to inform the development of more effective rehabilitation strategies for children with amblyopia.

Reproduced under the paper's license (CC BY-NC), from the paper cited above.

Repositories

Its files are read in the Code ↔ Paper reader above, with 9 matches between paragraphs and lines of code.

CogPlatform/binocularMRI

License: MIT
State: the link answers, verified on 29 September 2026
Evidence: files inventoried
Commit: 3e1faabdf18ee50cf6eaeac658aa77dba468e387, 8 May 2026
Languages: MATLAB (1)
Size: 5 files, 1 script
Software Heritage: not archived
Found in: the text, “Visual Stimuli for Cortical Activation”
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: Psychtoolbox (1 file)
Availability: 1 check, the latest on 29 September 2026: the link answers
  • 29 September 2026: the link answers
3 files

herrlich10/mripy

License: MIT
State: the link answers, verified on 31 October 2026
Evidence: files inventoried
Commit: db1324a1a712c1948cc10ea3c629e74e7d2ea430, 17 April 2025
Languages: Python (48), MATLAB (19), Shell (1)
Size: 112 files, 68 scripts
Software Heritage: archived
Found in: the text, “Preprocessing”
Holds: README, license file, environment (requirements.txt, setup.py, docs/requirements.txt), tests, documentation
Not found: CITATION.cff, continuous integration
Tools: NumPy (29 files), SciPy (12 files), Matplotlib (9 files), pandas (8 files), AFNI (4 files), Statistics and Machine Learning Toolbox (3 files), scikit-learn (3 files), seaborn (3 files), SPM (2 files), CoSMoMVPA (1 file), CuPy (1 file), FreeSurfer (1 file), NiBabel (1 file)
Availability: 2 checks, the latest on 31 October 2026: the link answers
  • 31 October 2026: the link answers
  • 29 September 2026: the link answers
70 files

Zenodo 592253

License: CC-BY-4.0
State: the link answers, verified on 29 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: the references
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 29 September 2026: the link answers (HTTP 200)
  • 29 September 2026: the link answers (HTTP 200)
231 files
At the source:

iandol/opticka

License: LGPL-3.0
State: the link answers, verified on 17 November 2026
Evidence: files inventoried
Commit: f7d7a20c1dc4790918f998db6953e780df2c41e6, 13 November 2026
Languages: MATLAB (293), Shell (1), Perl (1)
Size: 573 files, 295 scripts
Software Heritage: archived
Found in: the Zenodo archive record
Holds: README, license file, CITATION.cff, tests, continuous integration
Not found: environment file, documentation
Availability: 2 checks, the latest on 17 November 2026: the link answers
  • 17 November 2026: the link answers
  • 29 September 2026: the link answers
297 files

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:

  • 4 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 593 scripts, each with its path and the digest of its content;
  • 9 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.

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, 29 September 2026: the first record

Recorded: type, language, journal, volume, pages, dates, 10 authors, 4 keywords, 2 funders, 81 references.

Cite

This paper

Huang, Y., Wang, S., Qian, Y., Kong, L., Zhao, P., Liu, Y., Zarei, S. A., Zhang, P., Andolina, I. M., & Liu, H. (2026). Differential Effects of Balanced and Imbalanced Binocular Stimulation on Visual Cortex Responses in Amblyopic Children. Clinical ophthalmology (Auckland, N.Z.), 20, 590186. https://doi.org/10.2147/opth.s590186

BibTeX

@article{huang2026differential,
author = {Huang, Yuanyang and Wang, Shu and Qian, Yazhu and Kong, Linghan and Zhao, Peijun and Liu, Yan and Zarei, Shahab Aldin and Zhang, Peng and Andolina, Ian Max and Liu, Hong},
title = {{Differential Effects of Balanced and Imbalanced Binocular Stimulation on Visual Cortex Responses in Amblyopic Children}},
journal = {Clinical ophthalmology (Auckland, N.Z.)},
year = {2026},
month = apr,
volume = {20},
pages = {590186},
publisher = {Dove Press},
issn = {1177-5467},
doi = {10.2147/opth.s590186},
url = {https://doi.org/10.2147/opth.s590186},
pmid = {42052216},
pmcid = {PMC13117856}
}

RIS

TY - JOUR
AU - Huang, Yuanyang
AU - Wang, Shu
AU - Qian, Yazhu
AU - Kong, Linghan
AU - Zhao, Peijun
AU - Liu, Yan
AU - Zarei, Shahab Aldin
AU - Zhang, Peng
AU - Andolina, Ian Max
AU - Liu, Hong
TI - Differential Effects of Balanced and Imbalanced Binocular Stimulation on Visual Cortex Responses in Amblyopic Children
T2 - Clinical ophthalmology (Auckland, N.Z.)
J2 - Clin Ophthalmol
PY - 2026
DA - 2026/04/23
VL - 20
SP - 590186
SN - 1177-5467
PB - Dove Press
DO - 10.2147/opth.s590186
UR - https://doi.org/10.2147/opth.s590186
LA - en
ER -

CSL-JSON

{
"id": "10.2147/opth.s590186",
"type": "article-journal",
"title": "Differential Effects of Balanced and Imbalanced Binocular Stimulation on Visual Cortex Responses in Amblyopic Children",
"container-title": "Clinical ophthalmology (Auckland, N.Z.)",
"author": [
{
"family": "Huang",
"given": "Yuanyang"
},
{
"family": "Wang",
"given": "Shu"
},
{
"family": "Qian",
"given": "Yazhu"
},
{
"family": "Kong",
"given": "Linghan"
},
{
"family": "Zhao",
"given": "Peijun"
},
{
"family": "Liu",
"given": "Yan"
},
{
"family": "Zarei",
"given": "Shahab Aldin"
},
{
"family": "Zhang",
"given": "Peng"
},
{
"family": "Andolina",
"given": "Ian Max"
},
{
"family": "Liu",
"given": "Hong"
}
],
"container-title-short": "Clin Ophthalmol",
"volume": "20",
"page": "590186",
"DOI": "10.2147/opth.s590186",
"PMID": "42052216",
"PMCID": "PMC13117856",
"ISSN": "1177-5467",
"publisher": "Dove Press",
"URL": "https://doi.org/10.2147/opth.s590186",
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
23
]
]
}
}

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.7554/elife.93171 [code]
Mesoscale functional organization and connectivity of color, disparity, and naturalistic texture in human second visual area.
Journal: eLife
In common: CoSMoMVPA, CuPy, AFNI, 10 other tools, 5 references
[2] doi:10.1371/journal.pbio.3003159 [code]
The superficial layers of the primary visual cortex create a saliency map that feeds forward to the parietal cortex.
Journal: PLoS biology
In common: CoSMoMVPA, CuPy, AFNI, 10 other tools, fMRI, 3 references
[3] doi:10.1038/s42003-025-08871-6 [code]
Spatially global effects of feature-based attention in functional subdivisions of human subcortical nuclei.
Journal: Communications biology
In common: CoSMoMVPA, CuPy, AFNI, 10 other tools, 3 references
[4] doi:10.1038/s41562-025-02320-4 [code]
Mesoscale cortical mechanisms of perceptual conflict resolution in binocular rivalry.
Journal: Nature human behaviour
In common: CoSMoMVPA, CuPy, AFNI, 10 other tools, 1 reference
[5] doi:10.1016/j.cell.2025.11.039 [code]
Stimulant medications affect arousal and reward, not attention networks.
Journal: Cell
In common: Chronux, FieldTrip, FreeSurfer, 12 other tools, fMRI
[6] doi:10.1162/imag_a_00311 [code]
Laminar multi-contrast fMRI at 7T allows differentiation of neuronal excitation and inhibition underlying positive and negative BOLD responses.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: CoSMoMVPA, CuPy, AFNI, 10 other tools, fMRI, 1 reference
[7] doi:10.1162/imag_a_00256 [code]
The relationship between visual acuity loss and GABAergic inhibition in amblyopia.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: other condition, 9 references
[8] doi:10.7554/elife.107111 [code]
The distinct role of human PIT in attention control.
Journal: eLife
In common: CoSMoMVPA, CuPy, AFNI, 10 other tools, fMRI
[9] doi:10.1038/s42003-025-08914-y [code]
Two opposing yet complementary ocular dominance plasticities: thalamus strengthens the weak channel while higher cortex listens to the strong signal.
Journal: Communications biology
In common: 7 references, author Yazhu Qian
[10] doi:10.1073/pnas.2216942120 [code]
Different roles of response covariability and its attentional modulation in the sensory cortex and posterior parietal cortex.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: CoSMoMVPA, CuPy, AFNI, 10 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.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.2147/opth.s590186.svg)](https://openscicode.org/badge/doi/10.2147/opth.s590186)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.2147/opth.s590186.svg
   :target: https://openscicode.org/badge/doi/10.2147/opth.s590186
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.2147/opth.s590186"><img src="https://openscicode.org/badge/doi/10.2147/opth.s590186.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.

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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.