Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 02:32
    jacobdr commented #2589
  • 02:28
    codecov[bot] commented #2589
  • 02:27
    codecov[bot] commented #2589
  • 02:27
    pep8speaks commented #2589
  • 02:27
    jacobdr synchronize #2589
  • 02:27
    codecov[bot] commented #2589
  • 02:27
    codecov[bot] commented #2589
  • 02:27
    pep8speaks commented #2589
  • 02:27
    jacobdr synchronize #2589
  • May 15 21:00
    codecov[bot] commented #2531
  • May 15 21:00
    codecov[bot] commented #2531
  • May 15 21:00
    pep8speaks commented #2531
  • May 15 21:00
    tomdelahaije synchronize #2531
  • May 13 20:19
    codecov[bot] commented #2593
  • May 13 19:39
    codecov[bot] commented #2593
  • May 13 19:39
    codecov[bot] commented #2593
  • May 13 19:39
    pep8speaks commented #2593
  • May 13 19:39
    arokem synchronize #2593
  • May 13 19:15
    codecov[bot] commented #2593
  • May 13 19:15
    codecov[bot] commented #2593
Eleftherios Garyfallidis
@Garyfallidis
The question is what you want to do next.
Do you want to use these tensors to generate metrics such as FA etc?
araikes
@araikes
That's the plan (at the moment)
Eleftherios Garyfallidis
@Garyfallidis
Here is how to decompose the tensor https://github.com/dipy/dipy/blob/master/dipy/reconst/dti.py#L1960 into eigen values and eigen vectors.
Then you can use those to create FA etc. See function to use here https://github.com/dipy/dipy/blob/master/dipy/reconst/dti.py#L54
araikes
@araikes
Makes sense. I'll see if I can get something up and working. Thanks
Eleftherios Garyfallidis
@Garyfallidis
You are welcome.
araikes
@araikes
@Garyfallidis It looks like I can't load them back in DIPY. If I use load_nifti (even on the unmodified tensor image produced by dipy_fit_dti) and then dti.decompose_tensor I get: LinAlgError: Last 2 dimensions of the array must be square
araikes
@araikes
data,affine = load_nifti('tensors.nii.gz')

test = dti.from_lower_triangular(data)

evals, evecs = dti.decompose_tensor(test)
fa = dti.fractional_anisotropy(evals)
That produces an FA map of 0s. The tensor data when read back in is a 64x128x64x1x6 array of 0s.
Eleftherios Garyfallidis
@Garyfallidis
Not sure if that will work but can you remove the extra dimensions? Use np.squeeze? To go to 64x128x64x6?
licataae
@licataae

Hi all, I am working with a script that generates peaks using dipy's peaks_from_model() to track white matter pathways. I am attempting to save these peaks to a nifti from the .PAM5 file they are saved in using save_peaks(). My PeaksandMetrics object does not have the affine attribute, however even if I specify it in save_peaks() as the docs suggest it still fails to recognize it and gives the error: AttributeError: 'PeaksAndMetrics' object has no attribute 'affine'. I am using dipy 0.15, python 2.7 . Here is my code, any advice is helpful since I am still fairly new to dipy:
`csapeaks = peaks_from_model(model=csa_model,
data=maskdata,
sphere=sphere,
relative_peak_threshold=.25,
min_separation_angle=40, mask=mask,
return_odf=True, normalize_peaks=True)

print('csa_peaks generated')
pam = savepeaks(os.path.join(Diffusion, 'peaks.pam5'), csapeaks, affine=np.eye(4))

peaks_toniftis(pam, Diffusion+'/'+PIDN+'peaksSH.nii',
Diffusion
+'/'+PIDN+'peaksdirections.nii',
Diffusion
+'/'+PIDN+'peaksindices.nii',
Diffusion
+'/'+PIDN+'peaksvalues.nii',
Diffusion
+'/'+PIDN+'GFA.nii', reshape_dirs=False)`

Serge Koudoro
@skoudoro
Hi @licataae, Sorry for the late answer. I would recommend switching to python 3 and a recent version of DIPY. Indeed, python2.7 is deprecated and this issue has been fixed quite a long time ago. However, If you have really no choice, I would recommend looking at the current codebase where we updated the save_peaks function: https://github.com/dipy/dipy/blob/master/dipy/io/peaks.py. it might help you a lot to rewrite the save function.
licataae
@licataae
Thank you very much! Yes I must update my python/dipy versions... I greatly appreciate your help.
kenebene
@kenebene

Hi, a question for the community: I would need to cluster streamline pairs rather than streamlines whilst still using QuickBundles. By this I mean that I have one streamline pair [A B], where A and B are individual streamlines, and one streamline pair [C D], where C and D are individual streamlines. What I want to do is calculate the distance between A and C, and B and D and cluster based on the total distance between the pairs as: totalDistance = distanceBetween(A, C) +distanceBetween(B, D).

If anyone has any idea of how to achieve this I would be very thankful to hear it!

erickirby12
@erickirby12
Hello, I'm still newer to DIPY and coding in general. How would one go about creating an average whole brain tractogram in dipy that is a combination of all subjects' datasets in a group? My current idea is combining all bvec and bval files, transforming all raw dti data to standard space, merge all dti data, then put the resulting file through my dipy pipeline like it was a single subjects data. However, this will create a massive file and I don't think my computer can handle it. Any ideas on a better way to do this?
Basically you will need to design properly your feature and metric distance. But I think what you want to do is possible.
kenebene
@kenebene
@Garyfallidis thank you specifically for this input and generally for your great work, much appreciated. I will work with the material you suggested.
Elie Abi Aoun
@Elie-AAA
Hello everyone,
has anyone tried DIPY for fibre tracking in a fibre reinforced composite? If yes, was it successful?
Thanks in advance,
Elie
Surendra Maharjan
@surendra116083
Hello, Thank you very much for designing this awesome package.
irfnt
@irfnt
Do we have FFT in DIPY?
Serge Koudoro
@skoudoro
hi @irfnt, there is not FFT in DIPY, we use scipy or numpy fft implementation usually
Serge Koudoro
@skoudoro

Dear DIPY Community (@/all),

Do you need help to add a new feature on DIPY?

Do you want to share ideas or a moment with DIPY users and developers? or Do you have any questions about your DIPY code?

Feel free to join us on December 16th-17th during our Brainhack event! (https://brainhack.luddy.indiana.edu/)

Whatever your background or level of expertise is, you are encouraged to join us and participate: propose and discuss ideas, showcase demos, or contribute to activities initiated by others.

This free online event will be a good opportunity to connect with each other (registration is mandatory).
.
Some users already have proposed projects that you might be interested in:

  • Add new features to image registration
  • Sphinx Gallery Integration in DIPY
  • Improve Patch2self
  • Sprint to fix issues on DIPY
  • Implementation of the generalized volumetric atlas-based method for tractogram segmentation
  • Convert python 2 dipy script to python 3
  • Your project!

You will find all the information (schedule, registration, ...) at https://brainhack.luddy.indiana.edu/

Chandana Kodiweera
@kodiweera
Postdoctoral position available to work on A2CPS DWI data: https://twitter.com/fMRIstats/status/1480974031855652864.
Please spread the word. Thank you.
Ondřej Burkot
@gruntik97_twitter
Hi all,
I have one question, is it possible to call function patch2self.py from MATLAB? Yesterday I tried it, I'D like to filter MRI data, but it didn't work.
Paolo Avesani
@Paolopost
Hi all, did anyone try to compile dipy on Apple Silicon?
Serge Koudoro
@skoudoro
Hi @Paolopost, I did not try it yet but it should NOT work because some cython functions are not compatible with ARM64. I do not think it needs a lot of work since DIPY was compatible with ARM64 for quite a long time before. We need to find a machine to have regular test and check which functions go wrong.
Of course, DIPY works well with rosetta on the apple silicon but it does not take advantage of the full machine capabilities.
Serge Koudoro
@skoudoro
Travis CI was proposing a ARM64 machine, but we do not have access anymore. If someone can provide access to a arm64 machine for DIPY project, please feel free to contact me!
Paolo Avesani
@Paolopost
@skoudoro a ssh access to a M1 Macbook Pro would be enough? Do you need admin profile? Is the Xcode compiler the only precondition?
Shreyas Fadnavis
@ShreyasFadnavis
Hi @gruntik97_twitter ! Thank you for your question. One way that I can think of is --> Calling the command line of patch2self via Matlab. After doing pip install dipy --upgrade --user, the patch2self command line should be available in your system. You can go to your terminal and run: dipy_denoise_patch2self your_data.nii.gz your_data.bval --out_denoised denoised_your_data.nii.gz.
and a video tutorial for the same: https://youtu.be/S4MoCox98M8
Khazar Ahmadi
@khAzArAhmAdi_twitter
Hi all, I'm trying to run FW-DTI on a dataset using 'fwdtimodel.fit'. The diffusion data has 102 directions with bvals = 100, 1000 and 2500 (no B0 volumes). The code finishes with this warning ' RuntimeWarning: Mean of empty slice'. When I save the FW-FA and MD as nii file, the image is empty with min and max values of 0. There is no NaN value neither in the dwi nor in the mask images. As a sanity check, I tried both conventional DTI and DKI in DIPY on the same data and mask, and all the outputs look fine. Any ideas what is going wrong with FW-DTI modeling in this case? Happy to share my code and files if necessary. Many thanks in advance for your help!
1 reply
Ariel Rokem
@arokem
@skoudoro : all the CI are now GREEN! :clap: :tada:
Serge Koudoro
@skoudoro
Yeah !!! it is good to see a bit of green :-) @arokem . Now Packaging task and Registration module
Serge Koudoro
@skoudoro
Yes @Paolopost, ssh access to a M1 Macbook Pro should be enough. No need for admin profile if compilation tools are installed.
It seems that CircleCI offers some Machine on ARM64. Feel free to contact me in private for machine access. This is not a high priority, I might be slow on that because there is rosetta alternative, but for sure I will look into it. I am really confident for DIPY, it should be fast to make it compatible, I am more afraid by all the dependencies.....
Eleftherios Garyfallidis
@Garyfallidis
image.png
@/all Registration for the DIPY workshop is now available. Please visit and register here https://dipy.org/workshops/latest
hybazg123
@hybazg123
Hi all,
I want to calculate the Fractional Anisotropy and Radial Diffusivity in a bundle.
Any guidance is appreciated.
Like, share, subscribe!
and retweet :)
hybazg123
@hybazg123
@BramshQamar Thank you so much for your help!
Gabriele
@gamorosino
hi, I was interested in a feature of the bundle_profile function. As I understand it, to estimate the bundle profile, the tool creates a sort of skeletonization of the bundle (an average path of the streamlines). Is it possible to just use the command that returns this middle bundle path?
thank you
4 replies
Eleftherios Garyfallidis
@Garyfallidis
Can you provide more details @gamorosino ? Also you should consider attending the DIPY workshop this year. It has a large section on bundle analytics, tractometry etc (among other topics).
Arnavdeep
@arnav_:matrix.org
[m]
HI everyone
needed some help