Comments (7)
Which version of nibabel are you using and which version of TractSeg?
from tractseg.
Thank you for your reply.
The version of nibabel is 4.0.2 and the version of TractSeg seems to be 2.4. pip install TractSeg showed the following.
Requirement already satisfied: TractSeg in /home/brain/.local/lib/python3.8/site-packages (2.4)
Requirement already satisfied: nibabel>=2.3.0 in /home/brain/.local/lib/python3.8/site-packages (from TractSeg) (4.0.2)
from tractseg.
Trackvis is no longer supported by nibabel. So you can not use the output format trk_legacy
. The other output formats should work.
Otherwise you can try doing
pip install --upgrade nibabel==3.2.1
This will downgrade nibabel.
from tractseg.
Thank you for your suggestion. I tried to change to the recommended version of nibabel and conducted TractSeg module. Then the below showed.
$ TractSeg -i Diffusion.nii.gz -o tractseg_output --raw_diffusion_input --output_type tract_segmentation
Traceback (most recent call last):
File "/home/brain/.local/bin/TractSeg", line 20, in
from tractseg.libs import plot_utils
File "/home/brain/.local/lib/python3.8/site-packages/tractseg/libs/plot_utils.py", line 22, in
from tractseg.libs import fiber_utils
File "/home/brain/.local/lib/python3.8/site-packages/tractseg/libs/fiber_utils.py", line 10, in
from dipy.tracking.streamline import compress_streamlines as compress_streamlines_dipy
ImportError: cannot import name 'compress_streamlines' from 'dipy.tracking.streamline' (/home/brain/.local/lib/python3.8/site-packages/dipy/tracking/streamline.py)
Is there more appropriate way to use TractSeg?
from tractseg.
It seems that dipy does not work well with the older nibabel. I would recommend to not use trk_legacy
output format, but trk
or tck
.
from tractseg.
Hi, I am also getting the same error with trackvis. Can I just confirm, in order to not use: trk_legacy output format, but trk or tck, should we modify your plot_utils script to do this? If so how should we go about doing this? I have tried adding the option in my command as below in a bash script:
TractSeg -i "${wkdir}/input/preproc/ses-${Sessionnum}/TractSeg/S${sub_number}/TractSeg_input/Diffusion.nii.gz" \
-o my/output/directory \
--bvals "${wkdir}/input/preproc/ses-${Sessionnum}/TractSeg/S${sub_number}/TractSeg_input/Diffusion.bvals" \
--bvecs "${wkdir}/input/preproc/ses-${Sessionnum}/TractSeg/S${sub_number}/TractSeg_input/Diffusion.bvecs" \
--tracking_format tck \
--raw_diffusion_input
But it still generates the error:
Traceback (most recent call last):
File "/home/anaconda3/envs/yh/bin/TractSeg", line 20, in
from tractseg.libs import plot_utils
File "/home/anaconda3/envs/yh/lib/python3.9/site-packages/tractseg/libs/plot_utils.py", line 11, in
from nibabel import trackvis
ImportError: cannot import name 'trackvis' from 'nibabel' (/home/anaconda3/envs/yh/lib/python3.9/site-packages/nibabel/init.py)
Many thanks!
from tractseg.
While this may not be the best solution, you will need to change the source code in order to get the imports to work properly
in this file (or the equivalent location for you): /usr/local/lib/python3.10/dist-packages/tractseg/libs/fiber_utils.py
change from dipy.segment.metric import ResampleFeature
to from dipy.segment.featurespeed import ResampleFeature
change from dipy.tracking.streamline import compress_streamlines as compress_streamlines_dipy
to from dipy.tracking.streamlinespeed import compress_streamlines as compress_streamlines_dipy
for the nibabel import error, downgrading to the suggested 3.2.1 version worked for me
from tractseg.
Related Issues (20)
- Error in train endings_segmentation.
- Error in train TOM.
- Downloading pretrained weights (~140MB) seven times for every subject...can we have a better solution
- Creating peaks (1 of 3)... ; dwi2response: [ERROR] mrconvert
- bundle segmentation works but endings segmentation are all zeros HOT 1
- No tracking found for bundle. Returning zeros
- xvfbwrapper missing after pip install
- Issues creating endpoint files
- Issues with Matching the 72 reference Tract Folder number to the corresponding HCP Dataset IDs/Subject number HOT 1
- Seeking Advice on Achieving Symmetrical TOIs Using TractSeg
- plot_tractometry_results --plot3D metric gives ValueError HOT 5
- plot_tractometry_results --plot3D error: ValueError: data must be 2 dimensions HOT 1
- zsh: segmentation fault HOT 2
- Great overlap between the arcuate fasciculus (AF) and the superior longitudinal fasciculus (SLF) II HOT 2
- Can the pretrained weights download folder be specified? HOT 1
- TractSeg stopping midway with no error HOT 1
- --super_resolution flag not working HOT 2
- Using pre-downloaded pre-trained weights HOT 1
- plot3D clarification
- Problem Generating 3D Plots
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tractseg.