GithubHelp home page GithubHelp logo

pyprf's People

Contributors

dependabot[bot] avatar ingo-m avatar ofgulban avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pyprf's Issues

Area under Gaussian

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.)

Hdf5 mode

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.

Improve parallelisation

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

Log folder needs to be included in repository. Or created automatically when presenting stimuli.

Stimulus Presentation Create Design Matrix Error

I am receiving an error when I run create_design_matrix.py with the default values entered.

Here is the full error message:

Running: C:\pyprf-master\pyprf\stimulus_presentation\code\create_design_matrix.py

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

Experiment ended.

Parallelisation of pRF model creation

The parallelisation of pRF model creation has to be updated (according to the improved parallelisation scheme used by all other functions in the library).

JSON instead of pickle

In stimulus_presentation, the information on stimulus shape & timing is saved in pickles. Should be JSON instead.

ImportError: No module named pyprf.analysis.__main__

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__

Avoid changes to model time courses in parallel processes

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.

pRF stimulus logging

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).

Full GPU mode functionality.

The following features are currently not available in GPU mode:

  • Handling of multiple predictors (e.g. contrast levels).
  • Export of parameter estimates.
  • Hdf5 mode.

Cython setup

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.

Handling of multi-run experiments

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.)

Document input data type

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).

Reduce dependencies.

Possible improvement: remove cython dependency (and numpy dependency before setup) by precompilling cython code and including compiled c code in pypi distribution. Commits 99cbe02 and 3c6fb92 are a first step into this direction.

PEP 8

The analysis and stimulation scripts need to be cleaned up & PEP 8 violations have to be corrected.

Cython 0.28

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:

mcedit/mcedit2#399 (comment)

cython/cython@0961b9a

Readme references

Since this project is already public, I think it would be nice to put the related references for visitors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.