ingo-m / pyprf Goto Github PK
View Code? Open in Web Editor NEWA free & open python tool for population receptive field analysis.
License: GNU General Public License v3.0
A free & open python tool for population receptive field analysis.
License: GNU General Public License v3.0
Option to set scanner trigger button in GUI.
Area under Gaussian created by funcGauss() is not normalised to one. This does not affect static pRF fitting because model selection is based on R2 and is not affected by absolute size of predictors. However, for consistency, this should be changed. (Use solution from py_pRF_motion once it becomes available there.)
Currently, hdf5 mode is only implemented for pRF time courses for the model fitting (and only partially for preprocessing), and only for preprocessing (but not model fitting) for functional data.
The parallelisation does not work with arbitrary parallelisation factors. Factors 1 and 2, and all odd numbers probably do not work as expected.
Log folder needs to be included in repository. Or created automatically when presenting stimuli.
I am receiving an error when I run create_design_matrix.py with the default values entered.
Here is the full error message:
Traceback (most recent call last):
File "C:\pyprf-master\pyprf\stimulus_presentation\code\create_design_matrix.py", line 552, in
crt_design(dicParam)
File "C:\pyprf-master\pyprf\stimulus_presentation\code\create_design_matrix.py", line 161, in crt_design
aryPosConTmp = np.vstack((aryPosTemp, aryConTmp)).T
File "<array_function internals>", line 6, in vstack
File "C:\Program Files\Python_36\lib\site-packages\numpy\core\shape_base.py", line 283, in vstack
return _nx.concatenate(arrs, 0)
File "<array_function internals>", line 6, in concatenate
ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 70 and the array at index 1 has size 14
The parallelisation of pRF model creation has to be updated (according to the improved parallelisation scheme used by all other functions in the library).
It is probably better to use a relative path here in these lines in Code/prfStim_CreateConditions.py.
In stimulus_presentation
, the information on stimulus shape & timing is saved in pickles. Should be JSON instead.
After a fresh install and following the installation descriptions in the readme, I tried to run pyprf and got the following error message:
pyprf -config '/media/sf_D_DRIVE/MotDepPrf/Analysis/S01/02_MotLoc/config_S01.csv'
Traceback (most recent call last):
File "/home/marian/miniconda2/envs/env4pyprf/bin/pyprf", line 11, in <module>
load_entry_point('pyprf==1.1.0', 'console_scripts', 'pyprf')()
File "/home/marian/miniconda2/envs/env4pyprf/lib/python2.7/site-packages/pkg_resources/__init__.py", line 572, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/marian/miniconda2/envs/env4pyprf/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2769, in load_entry_point
return ep.load()
File "/home/marian/miniconda2/envs/env4pyprf/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2422, in load
return self.resolve()
File "/home/marian/miniconda2/envs/env4pyprf/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2428, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
ImportError: No module named pyprf.analysis.__main__
PEP 8 violation in prfStim_Bars.py, line 521: "Do not use bare except
".
@ofgulban any ideas?
In order to avoid write access to model time courses in parallel processes the following operation:
# Change type to float 32:
aryFuncChnk = aryFuncChnk.astype(np.float32)
aryPrfTc = aryPrfTc.astype(np.float32)
located at pyprf/pyprf/analysis/find_prf_cpu.py
line 135 should be moved to pyprf/pyprf/analysis/pyprf_main.py
, line 149.
The logging function of the pRF stimulation script (saving them as png files for uses with the py_pRF_mapping analysis pipeline) needs to be completed. The numeric values of the resulting png files and their dimension need to be corrected to fit to the analysis pipeline. Also, the analysis pipeline needs to be updated accordingly (with respect to file names & - more importantly - the upsampling of visual space for pRF overlap needs to be adapted, or perhaps turned into a legacy function).
The following features are currently not available in GPU mode:
On branch devel
, do not use cython in setup.py
, i.e. remove
from Cython.Build import cythonize
When compiled cython code is included, this is unnecessary.
In case of multi-run experiments, preprocessing is currently performed separately for each time series (including linear trend removal), the time series are separately demeaned, and finally concatenated. Instead of demeaning, it would be better to model across-runs variance with a separate predictor in the GLM. (Not relevant for ParCon experiment, because there is only one pRF run there.)
In the config file for pRF mapping, some values need to be float (e.g varTr = 2.940), others need to be integer (e.g. varNumVol = 400). This is not documented yet, and in case of values entered as int when they should be float (e.g. varTr = 3) there will be no error message, but the operation (e.g. smoothing) will not be performed correctly. Either document this or convert data types to proper type (latter option would be better).
These variables, however are no longer specified in the exemplary config.csv file.
It works if:
tplVslSpcSze = (128,128)
is replaced by:
varVslSpcSzeX = 128
varVslSpcSzeY = 128
in the csv file
The analysis and stimulation scripts need to be cleaned up & PEP 8 violations have to be corrected.
Cython 0.28 broke backwards compatibility.
When trying to compile with cython 0.28, the following problem occurs:
# *****************************************************************************
# *** Function for fast calculation of residuals
cdef (float[:], float[:]) funcCyRes(float[:] vecPrfTc_view,
^
------------------------------------------------------------
pyprf/analysis/cython_leastsquares.pyx:120:5: C struct/union member cannot be a memory view
Traceback (most recent call last):
File "cython_leastsquares_setup.py", line 32, in <module>
setup(ext_modules=cythonize('pyprf/analysis/cython_leastsquares.pyx'),
File "/Users/john/miniconda2/envs/py_main/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1026, in cythonize
cythonize_one(*args)
File "/Users/john/miniconda2/envs/py_main/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1146, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: pyprf/analysis/cython_leastsquares.pyx
For now, the solution is to pin the cython dependency to cython==0.27.1
.
See:
Since this project is already public, I think it would be nice to put the related references for visitors.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.