Skip to content

Commit

Permalink
Merge branch 'glDraw' into glDraw
Browse files Browse the repository at this point in the history
  • Loading branch information
czuba authored Nov 18, 2020
2 parents 315cf5e + e69dede commit 74cde8a
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 19 deletions.
38 changes: 28 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PLDAPS 4.4.0
==========

**PL**exon **DA**tapixx **PS**ychtoolbox - Neurophysiology experiment toolbox for MATLAB
---
### New developments with version 4.4.0
Expand All @@ -26,35 +26,53 @@
- OOP-based `p.static.display` object is automatically synced to the standard `p.trial.display`; No manual changes to experiment code are necessary to use
- OOP allows for automated communication between different experimental elements through event & listener triggers


---

#### A Wiki is coming!
An effort to develop [at least basic] documentation is being made in [the Wiki](https://github.com/HukLab/PLDAPS/wiki)

---

#### [glDraw] Branch

The glDraw branch is now the default PLDAPS branch, and also the only branch under active development. *Continued use of the `openreception` branch is discouraged.*

As new features are written & tested on the [czuba's] development fork, they will be transferred to stable release status here on the main HukLab PLDAPS project page.

=======


Version 4.3.0 (glDraw commit 354b233) brings additional low-level OpenGL drawing functionality, improved compatibility with various stereo drawing modes, and overall refinements.

##### *Changes to Overlay drawing functionality soon...*
> The ability to draw elements to the overlay pointer *once*, then have them magically show up on both the overlay/experimenter display *&* the subject display is a cute feature, but it's time is coming to an end. **Very soon, things rendered to the Overlay pointer will only appear on the overlay window**. Dealing with the ambiguity of 'which eye should the overlay render to during stereomodes?' is a major reason for this change. I can see of no current solution that doesn't require tedious piles of checks & drawBuffer changes that wouldn't outweigh their utility. In most all cases, the things being rendered this way are not so computationally intensive that there is a large benefit to only rendering them once in code, and the inherent limitations of indexd drawing (no alpha blending or smooth motion) make it unsuitable for many experimental stimulus applications anyway.
##### *Changes to Overlay drawing functionality...*
> The ability to draw elements to the overlay pointer *once*, then have them magically show up on both the overlay/experimenter display *&* the subject display is a cute feature, but it's time is coming to an end. Going forward, expect that **things rendered to the Overlay pointer will only appear on the overlay window**. Dealing with the ambiguity of 'which eye should the overlay render to during stereomodes?' is a major reason for this change. I can see of no current solution that doesn't require tedious piles of checks & drawBuffer changes that wouldn't outweigh their utility. In most all cases, the things being rendered this way are not so computationally intensive that there is a large benefit to only rendering them once in code, and the inherent limitations of indexd drawing (no alpha blending or smooth motion) make it unsuitable for many experimental stimulus applications anyway.
> This may break/change functionality of some code (e.g. eyelink calibration targets), but fixes are being implemented as they come up. If you do come across an unfixed instance, feel free to contribute a solution. --czuba, 2018-05-11
---

**Spring 2020 Note:**

* minimal updates have been made to the text below to ensure the first few steps are at least *'not wrong'*. Improved documentation is being made in the repo Wiki (...also slowly making its way over from the development branch)

...for now, on with the [outdated] readme!

---

## Before we start
- PLDAPS is primarily developed/tested/supported on OSX (ver 10.10) and Ubuntu (ver 16.04)
- Most modern Matlab versions should suffice; >=2016b is recommended
- PLDAPS is primarily developed/tested/supported on OSX (ver ~~10.10~~ 10.15) and Ubuntu (ver >= 16.04)
- Most modern Matlab versions should suffice; ~~>=2016b~~ 2019a is recommended
- Psychtoolbox needs to be installed
- If you are planning to use Datapixx, you should download a current version of the datapixx toolbox from vpixx.com and place it in the matlab path above PTB. The toolbox provided with PTB tends to be outdated.
- If you are planning to use Datapixx, you should download a current version of the datapixx toolbox from vpixx.com *and place it in the matlab path above[shadowing] the PTB copy*. The datapixx code provided with PTB should be thought of as only a placeholder and is totally outdated.
- For a recording rig, all basic testing should be done (e.g. VBLSyncTest with and without datapixx, etc)

## Getting started / installation

Create a local copy of PLDAPS by cloning the git repository and select the version 4.2 branch (openreception).
Create a local copy of PLDAPS by cloning the git repository ~~and select the version 4.2 branch (openreception)~~.
In a terminal window, first go to the directory in which you want the PLDAPS directory to reside in.

```
git clone https://github.com/HukLab/PLDAPS.git
git checkout openreception
git clone https://github.com/HukLab/PLDAPS.git ~/MLtoolbox/PLDAPS
```

Now start Matlab and copy the function `loadPLDAPS_template.m` to a place in your path (e.g. your Matlab start folder), rename it to `loadPLDAPS.m` and edit the 'dirs' to include at least the path you just installed PLDAPS in.
Expand Down
99 changes: 90 additions & 9 deletions loadPLDAPS_template.m
Original file line number Diff line number Diff line change
@@ -1,17 +1,98 @@
function loadPLDAPS()
%loadPLDAPS load the pldaps folders into the matlab path
%loadPLDAPS load the pldaps folders from into the matlab path

%add the path to you PLDAPS code and other Dirs you want to have added
%(your stimuli
dirs{1}='~/Documents/PLDAPS';
% dirs{2}='~/Documents/stimuli';
% Set unified location for Matlab toolboxes
toolRoot = fullfile('~','MLtoolbox');

for j=1:length(dirs)
a=genpath(dirs{j});

%% Setup the path
% remove other/conflicting copies from path
scrubPath({'PLDAPS','VPixx','Psychtoolbox'});

% PLDAPS stuff (with additional excludes)
addToPathWithoutGit( fullfile(toolRoot, 'Psychtoolbox')); %, {'Octave','R2007a','EyelinkDemos'});
addToPathWithoutGit( fullfile(toolRoot, 'PLDAPS'), '/PLDAPS/doc');

% Place OS-dependent copy of datapixx.mex AHEAD of PTB version (shadowing it)
if ismac
osStr = 'macosx64';
elseif isunix
osStr = 'linux64';
else
osStr = 'win64';
end
vpixxTrunk = fullfile(toolRoot,'VPixx_Software_Tools','DatapixxToolbox_trunk');
addToPathWithoutGit( fullfile(vpixxTrunk, 'mexdev','build','matlab',osStr) );

% cd(toolRoot);

end %main function



% % % % % %
% % % % % %
%% Sub-function dependencies
% ** These are normal parts of PLDAPS **
% Sub-function copies are needed here so they can be used while setting up the path
% % % % % %
% % % % % %

%% scrubPath.m
function scrubPath(excludes)

a=path;
b=textscan(a,'%s','delimiter',':');
b=b{1};
keepers = true(size(b));
if ischar(excludes), excludes = {excludes}; end
for i = 1:numel(excludes)
keepers = keepers & cellfun(@isempty,strfind(b, excludes{i}));
end

b = setdiff(b, b(keepers));
if numel(b)>0
rmpath( b{:} )
end
fprintf('Removing path directories containing keywords:\n\t[%s\b]\n', sprintf('''%s''\t',excludes{:}));
end


%% addToPathWithoutGit.m
function addToPathWithoutGit(dir, excludes, withSubdirs)
% function addToPathWithoutGit(dir, excludes, withSubdirs)
%
% Add [dir] to Matlab path without including all the hidden versioning junk (.git, .svn)
% -- Optionally also exclude subdirs matching any entries in [excludes] string (or cell of strings)
% -- by default includes all subdirectories, set [withSubdirs] to false to only add the main [dir]
%

if nargin<3 || withSubdirs
a = genpath(dir);
withSubdirs = ' and subdirectories';
else
a = dir;
withSubdirs = [];
end

if isempty(a)
fprintf('%s not found...attempting to continue\n', dir);
else
b=textscan(a,'%s','delimiter',':');
b=b{1};
b(~cellfun(@isempty,strfind(b,'.git')))=[];
b(~cellfun(@isempty,strfind(b,'.svn')))=[];
if nargin>1
if ~iscell(excludes), excludes = {excludes}; end
for i = 1:numel(excludes)
if ~isempty(excludes{i})
b(~cellfun(@isempty,strfind(b, excludes{i})))=[];
end
end
end
addpath(b{:})
display([dirs{j} ' added to the path\n']);
disp([dir, withSubdirs, ' added to the path']);
end
end
end


0 comments on commit 74cde8a

Please sign in to comment.