yeatmanlab / pyAFQ

Automated Fiber Quantification ... in Python
http://yeatmanlab.github.io/pyAFQ/
BSD 2-Clause "Simplified" License
57 stars 33 forks source link

Some questions about pyAFQ #145

Closed difan0224 closed 4 years ago

difan0224 commented 5 years ago
  1. Is the python version has the same effects with the Matlab code? I notice the Matlab code is still under the older version which needs the Matlab 2012, and will you give up updating the matlab code and maintain the python version from now on?
  2. I also notice that you decide to use dipy to do the tractography in this year. What is the difference between the dipy and the code you wrote before for the tractography?
  3. I check the code on the github website and find you do not update the streamline.py in pyAFQ/AFQ/utils which means the code I download from the website still does not work. In that case, I check the github and you update pyAFQ/AFQ/tests, _fixes.py and segmentation.py, so I run the pyAFQ/examples again, and got the error like this in the attached figure. Could you please help me check it and tell me which example code I should use? Btw, I use the python 3.6 under the Mac environment.
arokem commented 5 years ago

Thanks for these questions! I will take them one-by-one:

Is the python version has the same effects with the Matlab code? I notice the Matlab code is still under the older version which needs the Matlab 2012, and will you give up updating the matlab code and maintain the python version from now on?

We're not sure how the results obtained here compare to those obtained in Matlab (See #146). I'll let @jyeatman answer about Matlab versions, because I don't know anything about that.

I also notice that you decide to use dipy to do the tractography in this year. What is the difference between the dipy and the code you wrote before for the tractography?

We've always used DIPY for tractography in pyAFQ (but not in the Matlab version). DIPY implements several state-of-the-art approaches to tractography. Here, we expose both tensor-based, as well as CSD-based tractography with both a deterministic and probablistic approach. We could add other methods (e.g., using CSA for directions), if there is interest. As you can see in the examples, you can also plug in trk files that you have obtained from any other software.

I check the code on the github website and find you do not update the streamline.py in pyAFQ/AFQ/utils which means the code I download from the website still does not work. In that case, I check the github and you update pyAFQ/AFQ/tests, _fixes.py and segmentation.py, so I run the pyAFQ/examples again, and got the error like this in the attached figure. Could you please help me check it and tell me which example code I should use? Btw, I use the python 3.6 under the Mac environment.

Are you sure that you are using the current master branch? I fixed some issues in https://github.com/yeatmanlab/pyAFQ/pull/142. If that doesn't help, could you tell me what errors you are seeing? Are you using our example data? Or your own data?

difan0224 commented 5 years ago

Hi, I run this code python /Users/difan/Downloads/pyAFQ-master/examples/plot_tract_profile.py

And get error like this

Traceback (most recent call last): File "/Downloads/pyAFQ-master/examples/plot_tract_profile.py", line 134, in weights = gaussian_weights(fiber_groups[bundle]) File "/anaconda3/lib/python3.6/site-packages/dipy/stats/analysis.py", line 320, in gaussian_weights c = np.array([[c[0, 0], c[0, 1], c[0, 2]], IndexError: too many indices for array

arokem commented 5 years ago

Looks like you downloaded the code to your own machine from GitHub. Did you also separately install the software (e.g., running python setup.py install)? Did you re-install it after downloading the most recent version?

difan0224 commented 5 years ago

I just re-install it and get the same problem. And I just run your example code with the data you provided.

arokem commented 5 years ago

Interesting. I just reran this on my machine and it runs as expected. Could you please share your dti_streamlines.trk file somehow?

jyeatman commented 5 years ago

In regards to the matlab afq, it works with current matlab. Eventually we will deprecate the matlab version and focus all future development on the python version.

On Wed, Sep 18, 2019 at 6:41 AM Ariel Rokem notifications@github.com wrote:

Interesting. I just reran this on my machine and it runs as expected. Could you please share your dti_streamlines.trk file somehow?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yeatmanlab/pyAFQ/issues/145?email_source=notifications&email_token=AANRRSRCBYU4CGZVYQTOUWLQKIVXTA5CNFSM4IX6LWJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7ADEFQ#issuecomment-532689430, or mute the thread https://github.com/notifications/unsubscribe-auth/AANRRSWYERPNSK7ISGZGMNLQKIVXTANCNFSM4IX6LWJQ .

arokem commented 5 years ago

@difan0224 : could you please run a pip freeze and post your environment versions for us? In the future, we plan to have something like #148 to help figure out these kinds of things.

difan0224 commented 5 years ago

$ pip freeze absl-py==0.7.0 alabaster==0.7.12 anaconda-client==1.7.2 anaconda-navigator==1.9.6 anaconda-project==0.8.2 appdirs==1.4.3 appnope==0.1.0 appscript==1.0.1 asn1crypto==0.24.0 astor==0.7.1 astroid==2.1.0 atomicwrites==1.2.1 attrs==18.2.0 Automat==0.7.0 awscli==1.16.106 Babel==2.6.0 backcall==0.1.0 backports.os==0.1.1 backports.shutil-get-terminal-size==1.0.0 beautifulsoup4==4.6.3 bitarray==0.8.3 bleach==3.0.2 boto==2.49.0 boto3==1.9.228 botocore==1.12.228 certifi==2019.3.9 cffi==1.11.5 cftime==1.0.3.4 chardet==3.0.4 Click==7.0 cloudpickle==0.6.1 clyent==1.2.2 colorama==0.3.9 conda==4.6.14 conda-build==3.17.6 constantly==15.1.0 contextlib2==0.5.5 cryptography==2.4.2 cycler==0.10.0 Cython==0.29.2 cytoolz==0.9.0.1 dask==1.0.0 decorator==4.3.0 defusedxml==0.5.0 dipy==1.0.0 distributed==1.25.1 docutils==0.14 entrypoints==0.2.3 et-xmlfile==1.0.1 fastcache==1.0.2 filelock==3.0.10 Flask==1.0.2 Flask-Cors==3.0.7 fsspec==0.4.4 fury==0.3.0 gast==0.2.2 gevent==1.3.7 glob2==0.6 gmpy2==2.0.8 greenlet==0.4.15 grpcio==1.19.0 h5py==2.9.0 heapdict==1.0.0 html5lib==1.0.1 hyperlink==18.0.0 idna==2.8 imageio==2.5.0 imagesize==1.1.0 importlib-metadata==0.6 incremental==17.5.0 ipykernel==5.1.0 ipython==7.2.0 ipython-genutils==0.2.0 ipywidgets==7.4.2 isort==4.3.4 itsdangerous==1.1.0 jdcal==1.4 jedi==0.13.2 Jinja2==2.10 jmespath==0.9.3 joblib==0.13.2 jsonschema==2.6.0 jupyter==1.0.0 jupyter-client==5.2.4 jupyter-console==6.0.0 jupyter-core==4.4.0 jupyterlab==0.35.3 jupyterlab-launcher==0.13.1 jupyterlab-server==0.2.0 Keras==2.2.4 Keras-Applications==1.0.7 Keras-Preprocessing==1.0.9 keyring==17.0.0 kiwisolver==1.0.1 lazy-object-proxy==1.3.1 libarchive-c==2.8 lief==0.9.0 llvmlite==0.26.0 locket==0.2.0 lxml==4.2.5 Markdown==3.0.1 MarkupSafe==1.1.0 matplotlib==3.0.2 mccabe==0.6.1 mistune==0.8.4 mock==2.0.0 more-itertools==4.3.0 mpmath==1.1.0 msgpack==0.5.6 multipledispatch==0.6.0 navigator-updater==0.2.1 nbconvert==5.4.0 nbformat==4.4.0 nco==1.0.0 netCDF4==1.5.0.1 networkx==2.2 nibabel==2.5.0 nltk==3.4 nose==1.3.7 notebook==5.7.4 numpy==1.16.3 numpydoc==0.8.0 olefile==0.46 opencv-python==4.0.0.21 openpyxl==2.5.12 packaging==18.0 palettable==3.3.0 pandas==0.24.2 pandocfilters==1.4.2 parso==0.3.1 partd==0.3.9 path.py==11.5.0 pathlib2==2.3.3 pbr==5.1.3 pep8==1.7.1 pexpect==4.6.0 pickleshare==0.7.5 Pillow==5.3.0 pkginfo==1.4.2 pluggy==0.8.0 ply==3.11 prometheus-client==0.5.0 prompt-toolkit==2.0.7 protobuf==3.7.0 psutil==5.4.8 ptyprocess==0.6.0 py==1.7.0 pyAFQ==0.1.dev0 pyasn1==0.4.4 pyasn1-modules==0.2.2 pycodestyle==2.4.0 pycosat==0.6.3 pycparser==2.19 pycrypto==2.6.1 pycurl==7.43.0.2 pyflakes==2.0.0 Pygments==2.3.1 pylint==2.2.2 pyodbc==4.0.25 pyOpenSSL==18.0.0 pyparsing==2.3.0 PyQt5==5.11.3 PyQt5-sip==4.19.13 PySocks==1.6.8 pytest==4.0.2 pytest-openfiles==0.3.1 pytest-remotedata==0.3.1 python-dateutil==2.7.5 pytz==2018.7 PyWavelets==1.0.3 PyYAML==3.13 pyzmq==17.1.2 QtAwesome==0.5.3 qtconsole==4.4.3 QtPy==1.5.2 requests==2.21.0 rope==0.11.0 rsa==3.4.2 ruamel-yaml==0.15.46 s3fs==0.3.4 s3transfer==0.2.0 scikit-image==0.15.0 scikit-learn==0.20.3 scipy==1.2.0 Send2Trash==1.5.0 service-identity==18.1.0 simplegeneric==0.8.1 SimpleITK==1.2.2 singledispatch==3.4.0.3 six==1.12.0 sklearn==0.0 snowballstemmer==1.2.1 sortedcollections==1.0.1 sortedcontainers==2.1.0 Sphinx==1.8.2 sphinxcontrib-websupport==1.1.0 spyder==3.3.2 spyder-kernels==0.3.0 SQLAlchemy==1.2.15 sympy==1.3 tblib==1.3.2 tensorboard==1.13.1 tensorflow==1.13.1 tensorflow-estimator==1.13.0 termcolor==1.1.0 terminado==0.8.1 testpath==0.4.2 toolz==0.9.0 torch==1.0.1 torchvision==0.2.1 tornado==5.1.1 tqdm==4.28.1 tract-querier==0.1 traitlets==4.3.2 Twisted==17.5.0 typed-ast==1.1.0 unicodecsv==0.14.1 urllib3==1.24.1 vtk==8.1.2 wcwidth==0.1.7 webencodings==0.5.1 Werkzeug==0.14.1 widgetsnbextension==3.4.2 wrapt==1.10.11 wurlitzer==1.0.2 xlrd==1.2.0 XlsxWriter==1.1.2 xlwings==0.15.1 xlwt==1.2.0 zict==0.1.3 zope.interface==4.6.0

arokem commented 5 years ago

I am not really sure why this is not working. I can confirm that the trk file that you separately sent me fails to segment properly, but I don't understand why that is the case. The only thing that pops out at me is that I am running with scipy==1.3.0, while you have scipy==1.2.0. Would you mind updating your scipy and trying again? Sorry that this is so hard to pin down!

arokem commented 4 years ago

Given this is a pretty old issue, I am going to assume (hope!) that this has already resolved for you, and I will go ahead and close this. Feel free to reopen this issue if you are still having trouble with this.