Coder Social home page Coder Social logo

mattcieslak / mittens Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 7.0 4.66 MB

A Python library for Analytic Tractography

License: BSD 2-Clause "Simplified" License

Python 0.96% Fortran 98.23% Jupyter Notebook 0.80% Shell 0.01% Dockerfile 0.01%
diffusion-trajectories fortran90 network-analysis python3

mittens's People

Contributors

clintg6 avatar mattcieslak avatar pfotiad avatar thisistegan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mittens's Issues

In README, use of MITTENS doesn't work

mitns = MITTENS(input_fib="HCP.src.gz.odf8.f5rec.fy.gqi.1.25.fib.gz")
should be
mitns = MITTENS(reconstruction="HCP.src.gz.odf8.f5rec.fy.gqi.1.25.fib.gz")

Creating VoxelGraph

Please,

I'm trying to create a VoxelGraph graph, but I got an error creating the MITTEN object:

mitns = MITTENS(reconstruction="sub-01_dwi_merged.src.gz.odf.gqi.1.25.fib.gz")
Unable to load real affine image

My fib.gz file is an ouput of the preprocessing with QSIPREP: https://qsiprep.readthedocs.io/en/latest/index.html
Anny suggestion how to fix this problem? Am I using the wrong gqi file?

Thank you.

using MITTENS

Hello! I am trying to use MITTENS and running into a number of errors.

I successfully converted the Dockerfile into Singularity and attempted it to build it. It ran into issues with cmake (I think, the errors were quite long) and did not complete set up. So I am running it locally on an Ubuntu server (20.04.5 LTS).

I am using Python 3.10, so I updated the now-depreciated numpy functions accordingly (np.float -> np.float64). After updating numpy functions and installing dependencies, I attempted to run the setup.py file. This did not run, due to errors with distutils/numpy.distutils. I wasn't sure if running this file was necessary, so I then tried to run the code in the readme.

from mittens import MITTENS
mitns = MITTENS(reconstruction="subj-id_dwi.odf.gqi.1.25.fib.gz")

This returns the error:

ModuleNotFoundError: No module named 'mittens.fortran'

I decided to try running this code first, since it creates Fortran files:

from mittens.write_solution import write_solution
write_solution("odf8", 35, 1.0)

First, there is no function write_solution in mittens/write_solution.py. I assume you meant write_files? When I run this with write_files, I get back this error:

compatible_indices = np.array([np.flatnonzero(r) for r in compatible_angles])
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (642,) + inhomogeneous part.

Let me know if I can provide any additional details. Thanks so much.

Transitional probability computation

Hi,
in the "get_transition_analysis_matrices" method inside utils. py , shouldn't the odf_vertices variable be transposed to compute the pairwise distances?
The edges probabilities in the graph doesn't match the dsi-studio output and in general the diffusion data.

Thank you

Installing MITTENS - Ubuntu or Google Colab

Dear @mattcieslak,

In my Ubuntu 20.04 I can't install MITTENS. I got the following error:

$ cd MITTENS
$ pip install -e .

error: extension 'mittens.fortran.singleODF_odf8_ss0_87_am35' has Fortran sources but no Fortran compiler found

Using colab I could install:

!pip install -e drive/MyDrive/Research/ShortestPathTools/MITTENS

ps: here, MITTENS is inside ShortestPatthTools folder, but I have tried with MITTENS in another locations;

Obtaining file:///content/drive/MyDrive/Research/ShortestPathTools/MITTENS
Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from mittens==0.0.0) (1.19.5)
Requirement already satisfied: scikit-learn in /usr/local/lib/python3.7/dist-packages (from mittens==0.0.0) (0.22.2.post1)
Requirement already satisfied: tqdm in /usr/local/lib/python3.7/dist-packages (from mittens==0.0.0) (4.41.1)
Collecting networkit
Downloading https://files.pythonhosted.org/packages/58/7a/4ef04f2b34fc81c5f2a5060b5cb989509f847d8aa6e359899922acffacf8/networkit-8.1.tar.gz (3.1MB)
|████████████████████████████████| 3.1MB 8.0MB/s
Requirement already satisfied: nibabel in /usr/local/lib/python3.7/dist-packages (from mittens==0.0.0) (3.0.2)
Collecting dipy
Downloading https://files.pythonhosted.org/packages/50/50/0b97f4ecf9b02170c4967053c34a0c08373e538295c119aadffe8d5ff235/dipy-1.4.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (7.7MB)
|████████████████████████████████| 7.7MB 12.9MB/s
Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn->mittens==0.0.0) (1.0.1)
Requirement already satisfied: scipy>=0.17.0 in /usr/local/lib/python3.7/dist-packages (from scikit-learn->mittens==0.0.0) (1.4.1)
Requirement already satisfied: h5py>=2.5.0 in /usr/local/lib/python3.7/dist-packages (from dipy->mittens==0.0.0) (3.1.0)
Requirement already satisfied: cached-property; python_version < "3.8" in /usr/local/lib/python3.7/dist-packages (from h5py>=2.5.0->dipy->mittens==0.0.0) (1.5.2)
Building wheels for collected packages: networkit
Building wheel for networkit (setup.py) ... done
Created wheel for networkit: filename=networkit-8.1-cp37-cp37m-linux_x86_64.whl size=8069839 sha256=00570305f6cfee426bf6b50057cc1b4884324b0a66f13be0b79000f0134c6921
Stored in directory: /root/.cache/pip/wheels/25/7e/59/6b58f6984b823663f6d01266ecb0306ce3d74d040acd27a818
Successfully built networkit
Installing collected packages: networkit, dipy, mittens
Running setup.py develop for mittens
Successfully installed dipy-1.4.1 mittens networkit-8.1

Bu I can't import mittens:

from mittens import MITTENS

ModuleNotFoundError Traceback (most recent call last)

in ()
----> 1 from mittens import MITTENS

ModuleNotFoundError: No module named 'mittens'

My goal is to build a voxel graph to use with ShortestPathTool.

Thank you in advance.
Eduardo

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.