Jong Sung Park
@pjsjongsung
Hi @rtaiello, have you tried just replacing the data in the examples to the 2d data you have? The functions in the examples should also work with 2D images.
rtaiello
@rtaiello
Hi @pjsjongsung many thanks for your answer, actually I had a problem of finding the right configuration, but now it's working. A thing that I cannot find it, a SSD affine image registration, as it is for now in imaffine.py is only available MutualInformation, am I right?
Jong Sung Park
@pjsjongsung
@rtaiello You are correct. If you by any chance want to implement it, we are also open to contributions!
Roberto Toro
@r03ert0
hello! I'm trying to import Dipy from Blender :p
I get to pip install nibabel just fine, but not dipy. My Blender (v3.20) uses python 3.10. Is that ok for Dipy?
Serge Koudoro
@skoudoro
yes, python 3.10 is ok with the last version of DIPY @r03ert0
I am curious, what are you trying to do with blender and DIPY @r03ert0 ?
Jong Sung Park
@pjsjongsung
@r03ert0 Just in case, I also tried installing the latest version of dipy in a python3.10 conda env and it worked well. What error are you getting when you run pip install dipy?
Roberto Toro
@r03ert0
@skoudoro: I'd like to try to use some fancy render :p
I've been using Blender's geometry nodes lately, and there's so much cool stuff to try!
this is the error I'm getting... (from inside Blender)
Collecting dipy
Using cached dipy-1.5.0.tar.gz (11.8 MB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: nibabel>=3.0.0 in /Applications/_Graph/Blender320.app/Contents/Resources/3.2/python/lib/python3.10/site-packages (from dipy) (4.0.1)
Requirement already satisfied: h5py>=2.8.0 in /Applications/_Graph/Blender320.app/Contents/Resources/3.2/python/lib/python3.10/site-packages (from dipy) (3.7.0)
Requirement already satisfied: tqdm>=4.30.0 in /Applications/_Graph/Blender320.app/Contents/Resources/3.2/python/lib/python3.10/site-packages (from dipy) (4.64.0)
Requirement already satisfied: numpy>=1.14.5 in /Applications/_Graph/Blender320.app/Contents/Resources/3.2/python/lib/python3.10/site-packages (from h5py>=2.8.0->dipy) (1.22.0)
Requirement already satisfied: setuptools in /Applications/_Graph/Blender320.app/Contents/Resources/3.2/python/lib/python3.10/site-packages (from nibabel>=3.0.0->dipy) (58.1.0)
Requirement already satisfied: packaging>=17.0 in /Applications/_Graph/Blender320.app/Contents/Resources/3.2/python/lib/python3.10/site-packages (from nibabel>=3.0.0->dipy) (21.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /Applications/_Graph/Blender320.app/Contents/Resources/3.2/python/lib/python3.10/site-packages (from packaging>=17.0->nibabel>=3.0.0->dipy) (3.0.9)
Using legacy 'setup.py install' for dipy, since package 'wheel' is not installed.
Installing collected packages: dipy
Running setup.py install for dipy: started
Running setup.py install for dipy: finished with status 'error'
nadya-58
@nadya-58
Hello, I am trying denoising algorithms on DWI data using CPU and it takes VERY long time. Are there system requirements to run denoising?
Serge Koudoro
@skoudoro
I do not know why blender is trying to compile DIPY and not use the wheels. What is your environment @r03ert0 ? you can see that we have the wheels for python 3.10 in win linux macOS: https://pypi.org/project/dipy/#files . Are you sure about the python version ?
Serge Koudoro
@skoudoro
not particularly @nadya-58, what is your Data size? are you using a mask (it can helps a bit)? @ShreyasFadnavis might give you a better answer concerning the performance of all the denoising algorithms
Jong Sung Park
@pjsjongsung
@r03ert0 Can you try pip install wheel first and try it again?
Roberto Toro
@r03ert0
thank you @pjsjongsung!
pip installing wheel worked all fine. Now the error when installing dipy is this:
Collecting dipy
  Using cached dipy-1.5.0.tar.gz (11.8 MB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: nibabel>=3.0.0 in /Applications/_Graph/Blender320.app/Contents/Resources/3.2/python/lib/python3.10/site-packages (from dipy) (4.0.1)
Requirement already satisfied: h5py>=2.8.0 in /Applications/_Graph/Blender320.app/Contents/Resources/3.2/python/lib/python3.10/site-packages (from dipy) (3.7.0)
Requirement already satisfied: tqdm>=4.30.0 in /Applications/_Graph/Blender320.app/Contents/Resources/3.2/python/lib/python3.10/site-packages (from dipy) (4.64.0)
Requirement already satisfied: numpy>=1.14.5 in /Applications/_Graph/Blender320.app/Contents/Resources/3.2/python/lib/python3.10/site-packages (from h5py>=2.8.0->dipy) (1.22.0)
Requirement already satisfied: setuptools in /Applications/_Graph/Blender320.app/Contents/Resources/3.2/python/lib/python3.10/site-packages (from nibabel>=3.0.0->dipy) (58.1.0)
Requirement already satisfied: packaging>=17.0 in /Applications/_Graph/Blender320.app/Contents/Resources/3.2/python/lib/python3.10/site-packages (from nibabel>=3.0.0->dipy) (21.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /Applications/_Graph/Blender320.app/Contents/Resources/3.2/python/lib/python3.10/site-packages (from packaging>=17.0->nibabel>=3.0.0->dipy) (3.0.9)
Building wheels for collected packages: dipy
  Building wheel for dipy (setup.py): started
  Building wheel for dipy (setup.py): finished with status 'error'
  Running setup.py clean for dipy
Failed to build dipy
Installing collected packages: dipy
  Running setup.py install for dipy: started
  Running setup.py install for dipy: finished with status 'error'
python --version prints Python 3.10.2
I'm running MacOS Monterey 12.3.1 on an M1 laptop.
Serge Koudoro
@skoudoro
ok, that's why, we do not have wheels for python3.10 arm64, there is only a package for python3.9 so 2 solutions:
  • either downgrade python to 3.9 and it should work.
  • use a blender version that runs on Rosetta (x86_64) part on the M1 and not the arm64. in this case, it will work for python 3.10.
  • we might have wheels for python 3.10 arm64 a bit later this month, there is still an issue to fix
I forgot to tag you @r03ert0, see my answer above
Roberto Toro
@r03ert0
👍
rtaiello
@rtaiello
Hi, I've a question regarding the functionality of Dipy, I'm interested to know if it's possible to apply the SSD as a metric using Affine Image Registration, and if it is possible to apply the Mutual Information using Symmetric Diffeomorphic Registration. Thanks in advance!
1350339182
@1350339182
Hello, is there any way to obtain the resample point of ‘Resample Feature’ in dipy? I want to use them for other functions.
Serge Koudoro
@skoudoro
Hi @rtaiello, we do not have yet SSD for Affine Image Registration. You can look at my personal branch where the ssd integration started and give me a feedback if it works as expected. it is a bit messy, but should be functional: https://github.com/skoudoro/dipy/tree/ssd/doc/examples. It is not possible to apply Mutual Information metric on SYN
1 reply
Serge Koudoro
@skoudoro
Hi @1350339182, when you do my_new_points = ResampleFeature(nb_points=20).extract(my_list_of_point), you should get your resample point. There is also another function named my_new_points = set_number_of_points(points, nb_pts).
1350339182
@1350339182
@skoudoro Hello, thank you for your help! But I still encountered some new problems.
my_ new_ points = ResampleFeature(nb_points=20).extract(my_list_of_point)
A series of errors will be caused:
my new points = ResampleFeature(nb_points=20).extract(streamlines)
File "dipy\segment\featurespeed.pyx", line 140, in dipy.segment.featurespeed.CythonFeature.extract
File "dipy\segment\featurespeed.pyx", line 157, in dipy.segment.featurespeed.CythonFeature.extract
AttributeError: 'ArraySequence' object has no attribute 'flags'

In addition, how do I import set_number_of_points
Serge Koudoro
@skoudoro
Please, create a new discussion on dipy forum and then provides your version of DIPY and NiBABEL.
Your problem sounds like a version issue @1350339182 . https://github.com/dipy/dipy/discussions
Serge Koudoro
@skoudoro
concerning set_number_of_points, I answered you here @1350339182 : https://github.com/dipy/dipy/discussions/2642#discussioncomment-3526967
1350339182
@1350339182
@skoudoro It's working. Thank you very much!
LiYuan
@Nanyiliyuan
Hi, I find a small mistake in Documentation 1.5.0 dipy_fit_dti
https://dipy.org/documentation/1.5.0/reference_cmd/dipy_fit_dti/ , in which some optional arguments(sigma, b0_threshold, bvecs_tol) didn't match the explanation. By the way, it will be much better if user can define the order of tensor. Thank you for your outstanding work!
1 reply
Serge Koudoro
@skoudoro
Thank you for letting us know @Nanyiliyuan! Can you create an issue here https://github.com/dipy/dipy/issues to not forget? Thank you in advance
Steven Meisler
@smeisler
Hi, I wanted to experiment with surface seeding tractography on HCP data. The only WM surfaces I have are the ones output by FreeSurfer and the associated .gii files, neither of which are compatible with FURY. The surface tractography tutorial on DIPY uses VTK files. How would I be able to get VTK meshes from either the FreeSurfer or Gifti outputs? Thanks.
1 reply
Chandana Kodiweera
@kodiweera
Is there an established method to determine the optimal parameters used with the tractography models. For example, in the case of PFT pft_front_trackingdist. Can we do some sort of cross-validation across subjects to obtain the optimal combination of params? As we know, these parameters are sensitive to the ROI/s we are interested in. Everytime we handle a new ROI, we should optimize the model, right? @gabknight
1 reply
boudig
@boudig
Hello, can someone help me by explaining what are the params for in RigidTransform3D?
1 reply
Chandana Kodiweera
@kodiweera
It looks like dipy is based on RAS ( right handed / neurological coordinate system) . Is this correct? Thanks.
Serge Koudoro
@skoudoro
yes, it is correct @kodiweera
Hi @boudig, 6 params for RigidTransform3D:
theta[0] : rotation about the x axis
theta[1] : rotation about the y axis
theta[2] : rotation about the z axis
theta[3] : translation along the x axis
theta[4] : translation along the y axis
theta[5] : translation along the z axis
Chandana Kodiweera
@kodiweera
@skoudoro Thank you for the reply. Does this mean data has to be in RAS coordinates for dipy ? Is dipy capable of fitting LAS data ( output from FSL) without manualy trasforming into RAS? Thanks.
Chandana Kodiweera
@kodiweera

@skoudoro Thank you for the reply. Does this mean data has to be in RAS coordinates for dipy ? Is dipy capable of fitting LAS data ( output from FSL) without manualy trasforming into RAS? Thanks.

if dipy thinks data is in RAS orientation, it sounds like flipping/swapping bvecs is all it needs, right?

Serge Koudoro
@skoudoro
yes
Chandana Kodiweera
@kodiweera
@gabknight What would be a better stopping criteria when tracking from cerebelum to Thalamus? Is that possible just to track from a seed to a target or even better streamlines between a network of ROIs?
Chandana Kodiweera
@kodiweera
When tracking using msmt-csd coefficients, can we use all the coefficients? Examples shown only used white matter coefficnets. Will there be a diffference if I use all the coefficients incluging gm and csf, specially when tracking gm to gm regions? @gabknight thanks!
AlexBadea
@portokalh
@Garyfallidis @skoudoro - can you pls help with the units for fiber to bundle coherence? many thanks!
erickirby12
@erickirby12
Hello, I'm looking into some more quantitative ways to measure an increase of "fanning" in tracts over time. However, I don't know ways I can do this in Dipy. I was thinking measurements such as tract volume, endpoint volume, endpoint radius, or even a tract profile with volume as the measurement at each node. For now I'm looking at pulling the density map into a nifti file and doing some type of analysis on that to try to get some quantitative measurements. Are there any better ideas to look at what I'm trying to look at or ways to implement this more efficiently in Dipy, specifically a tract profile of the volume at each node? I believe that would be the most useful.
David Romero-Bascones
@drombas
Hi @erickirby12 , an easy approach is to compute the distance from each streamline to the tract centroid. Tracts with higher fanning should have a higher distance from streamlines to the centroid. See this script to check if it's what you are looking for: https://drive.google.com/drive/folders/1Ci-Gkcy1FLJtlLwxvKxoKZnvbvil2ocb?usp=sharing
erickirby12
@erickirby12
@drombas good idea! I'll play with this for a bit, I think it should be useful and hopefully do what I need it to. Thank you!
1 reply
iPsych
@iPsych
Hi, how can I average trackvis .trk of multiple subjects? Not like single ‘mean streamline’ but the ‘averaged tract’. (i.e. generate mean_cst_l.trk from cst_l.trk of 3 subjects.)
6 replies
Julio Villalon
@villalonreina
Hi there. I was wondering if the code for "Bayesian uncertainty quantification in linear models for diffusion MRI" was ever implemented/merged in DIPY? https://doi.org/10.1016/j.neuroimage.2018.03.059. There was once a weekly meeting about two years ago where this was presented.
zzcSeek
@zzcpage
Hello, everyone. I have a question. When I use save_trk, I need to use Stateful Tractogram to save streamlines. This leads to the problem of insufficient memory. Is there a better way to save streamlines directly? Instead of keeping two streams of data in memory?