Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix calibrations #177

Open
wants to merge 467 commits into
base: dev
Choose a base branch
from
Open

Fix calibrations #177

wants to merge 467 commits into from

Conversation

jkbhagatio
Copy link
Member

@jkbhagatio jkbhagatio commented Jul 8, 2019

Fixes for #4, #128, #164

If this type of fix looks good, let me know. I also want to improve the doc for hw.ptb.Window, make function/method names clearer, and create simple config scripts explaining how to run gamma calibration and reward valve calibration (these may share some redundancy with what goes on ReadTheDocs, but I think that's fine).

If sounds good, I'll do all of the above in this branch.

k1o0 and others added 30 commits October 23, 2018 19:30
Setting dev up-to-date with master, plus incorporating additional changes made directly to dev (that were not made to master)
added future training flag to AlyxPanel
@jkbhagatio jkbhagatio requested review from k1o0 and nsteinme July 8, 2019 17:41
@k1o0
Copy link
Contributor

k1o0 commented Jul 8, 2019

Seems the tests are failing catastrophically. How do they run on your rig?

Copy link
Contributor

@k1o0 k1o0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fancy making a test for this? :-E

% Calls PTB's `DrawFormattedText` to display text to the PTB Window
%
% Inputs:
% `text`: the text to be displaye
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

+srv/expServer.m Show resolved Hide resolved
+srv/expServer.m Show resolved Hide resolved
% `nx`:
% `ny`:
%
% Examples:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this or add a TODO (or add examples)

Copy link
Member Author

@jkbhagatio jkbhagatio Jul 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, this goes along with my comment in the initial PR where I say:

I also want to improve the doc for hw.ptb.Window

if you approve of this PR's general approach to solving #4, #128, #164 (I didn't want to waste time on documentation if you didn't approve of the code approach =D)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah looks good to me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Documenting existing code is never a waste of time! :)

% `wrapAt`: a number for the max number of characters in a line of text
%
% Outputs:
% `nx`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May as well fill this in. It's in the PTB docs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, this goes along with my comment in the initial PR where I say:

I also want to improve the doc for hw.ptb.Window

if you approve of this PR's general approach to solving #4, #128, #164 (I didn't want to waste time on documentation if you didn't approve of the code approach =D)

+hw/+ptb/Window.m Show resolved Hide resolved
@@ -197,9 +197,10 @@ function open(obj)
end
Screen('Preference', 'SuppressAllWarnings', true);
% setup screen window
%obj.PxDepth = 32;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of commenting things out with no explanation, leave some sort of description or remove entirely. Otherwise it's just clutter that will mean nothing to no one in a few month's time.

MATLAB doesn't save parameters whose defaults are unchanged. This means that you might end up breaking someone's rig by making this change. If you want to go ahead with it let everyone know on slack to check this works on their rigs before merging into master.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was a little egg for you : ) want to see if there's any reason it's set to 32?
Regarding the not saving of this property, I tested it out on the training rigs and BII and all was good, so i think should be fine, but I can send a message to the slack as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know enough about graphics tbh but there's often a good reason for things to be set as they are. It may be that controlling the bit depth is essential for generating the visual stimuli correctly. If you let the system determine the value I suppose it will vary across rigs which we don't necessarily want. I know that bit depth is important in rendering low contrasts and that there are some assumptions made in parts of the code (e.g. https://github.com/cortex-lab/signals/blob/9f4f5d068805d8dc715e332449086e42fa396da2/%2Bvis/gaussianLayer.m#L18-L22). From what I've read 32 is an odd value for bit depth, and it may simply be a carry-over from when we used a particular monitor.

Long story short, I've come to realize that one shouldn't flippantly change bits of code when you don't understand them. You should ask someone like Krumin about this and make sure everyone tests their recording rigs or at least approves this change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup fair point, I'll do this

@jkbhagatio
Copy link
Member Author

Haven't run the current tests on this yet because I wanted your general opinion on this PR. I can check tomorrow. And yeah, I'll add test(s) here too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants