Comments (11)
The docker container provided in the repository is still work in progress (WIP). It does not work yet, because the FSL and Mrtrix commands are not automatically loaded (.bashrc is not automatically sourced). Apart from that the docker container is ready. I will try to fix this issue soon.
If you do not want to wait you can use TractSeg without Docker. That works.
from tractseg.
I just realized you are using the docker container from gkoehler90/tractseg. That one is out-dated. As soon as I fixed the docker issue mentioned in the previous comment I will push a new docker image to dockerhub. Until then you should use TractSeg without Docker (or build your own docker container).
from tractseg.
@wasserth Thank you for looking into the container issue. I did try to run it without it by installing various dependencies, but I couldn't get it to work after messing around for a while. I can wait for the container to be updated.
from tractseg.
@soichih I fixed the issues and now it should work using the following command:
sudo docker run -v /absolute/path/to/my/data/directory:/data \
-t wasserth/tractseg_container:v1.4 TractSeg -i /data/dwi.nii.gz -o /data
On OSX you might have to increase the Docker Memory limit from the default of 2GB to something higher.
from tractseg.
Great! Thanks!
I just tested it again (I have to use singularity for our HPC system)
$ singularity exec docker://wasserth/tractseg_container:v1.4 TractSeg -i dwi.nii.gz
...
Creating brain mask...
sh: 1: bet: not found
rm: cannot remove 'tractseg_output/nodif_brain_mask.nii.gz': No such file or directory
mv: cannot stat 'tractseg_output/nodif_brain_mask_mask.nii.gz': No such file or directory
Creating peaks (1 of 3)...
dwi2response: [ERROR] Command failed: mrconvert /home/hayashis/test/tractseg/tractseg_output/nodif_brain_mask.nii.gz /home/hayashis/test/tractseg/dwi2response-tmp-WJAF5I/mask.mif -datatype bit (dwi2response:88)
dwi2response: Output of failed command:
mrconvert: [ERROR] cannot access file "/home/hayashis/test/tractseg/tractseg_output/nodif_brain_mask.nii.gz": No such file or directory
mrconvert: [ERROR] error opening image "/home/hayashis/test/tractseg/tractseg_output/nodif_brain_mask.nii.gz"
dwi2response: Script failed while executing the command: mrconvert /home/hayashis/test/tractseg/tractseg_output/nodif_brain_mask.nii.gz /home/hayashis/test/tractseg/dwi2response-tmp-WJAF5I/mask.mif -datatype bit
dwi2response: For debugging, inspect contents of temporary directory: /home/hayashis/test/tractseg/dwi2response-tmp-WJAF5I/
Creating peaks (2 of 3)...
dwi2fod: [ERROR] cannot access file "tractseg_output/nodif_brain_mask.nii.gz": No such file or directory
dwi2fod: [ERROR] error opening image "tractseg_output/nodif_brain_mask.nii.gz"
Creating peaks (3 of 3)...
sh2peaks: [ERROR] failed to open key/value file "tractseg_output/WM_FODs.mif": No such file or directory
sh2peaks: [ERROR] error opening image "tractseg_output/WM_FODs.mif"
Traceback (most recent call last):
File "/usr/local/bin/TractSeg", line 113, in <module>
data_img = nib.load(join(HP.PREDICT_IMG_OUTPUT, "peaks.nii.gz"))
File "/usr/local/lib/python2.7/dist-packages/nibabel/loadsave.py", line 42, in load
raise FileNotFoundError("No such file or no access: '%s'" % filename)
nibabel.py3k.FileNotFoundError: No such file or no access: 'tractseg_output/peaks.nii.gz'
...
Maybe FSL is not in the PATH?
from tractseg.
When I run the docker container FSL is in the PATH. So it is strange that it does not find it when you run it with singularity.
I updated the python code so FSL is added to the path right before "bet" is called. So you could try it again. I updated the container on dockerhub (version is still v.1.4, so you might have to deleted your downloaded image first so it will download the new one)
from tractseg.
I've cleaned the ~/.singularity/docker directory and rerun, but I am still seeing the same error message.
Creating brain mask...
sh: 1: bet: not found
rm: cannot remove 'tractseg_output/nodif_brain_mask.nii.gz': No such file or directory
mv: cannot stat 'tractseg_output/nodif_brain_mask_mask.nii.gz': No such file or directory
Creating peaks (1 of 3)...
I've also tried running singularity witih -e option which prevents ENV parameter on the host to be set inside the container, but that didn't help either. I think the issue is related to singularity but I haven't really looked into it yet.
from tractseg.
Sorry for the late reply. I was on vacation last week.
I also think it is an issue with singularity as it works fine with plain Docker on several systems. I never used singularity so I do not know about its details.
from tractseg.
OK. I've created my own Dockerfile that works for our environment. Tractseg now seems to work via singularity!
The first thing I noticed though, is that it's downloading the trained model under $HOME/.tractseg. Is there anyway I could pre-stage the model and make it part of my Docker container? - maybe by doing something like RUN curl http:/somewhere/pretrained_weights_tract_segmentation -O someplace
and point Tractseg to use it?
nvm.. I found this on the official Dockerfile
RUN mkdir -p ~/.tractseg \
&& curl -SL -o ~/.tractseg/pretrained_weights_tract_segmentation_v1.npz https://www.dropbox.com/s/nygr0j2zgztedh0/TractSeg_best_weights_ep448.npz?dl=1 \
&& curl -SL -o ~/.tractseg/pretrained_weights_endings_segmentation_v2.npz https://www.dropbox.com/s/l5fa6hhtbv5npvm/EndingsSeg_best_weights_ep176.npz?dl=1 \
&& curl -SL -o ~/.tractseg/pretrained_weights_peak_regression_v1.npz https://www.dropbox.com/s/ogywkbrj3165v3e/PeakReg_best_weights_ep229.npz?dl=1 \
&& curl -SL -o ~/.tractseg/pretrained_weights_dm_regression_v1.npz https://www.dropbox.com/s/d82iv95flz8n5a2/DmReg_best_weights_ep427.npz?dl=1
from tractseg.
Great that it works. So far there is not option to change the tractseg home directory from ~/.tractseg
to another place. You would have to change it in the code. But I think inside of the docker container it does not really matter where those weights are located. So ~/.tractseg
should be fine normally.
from tractseg.
I am running it through singularity, and it mounts host's home directory by default - wiping out the container's home directory (/root for docker?).
I've done following to hack around it.
export HOME=/
TractSeg -i $dwi -o .
It's ugly.. but it seems to work for now. It would be nice to be able to specify the directory where model is stored though! :)
from tractseg.
Related Issues (20)
- Boundles output empty or not well segmented HOT 2
- Tracking issue : TypeError: 'NoneType' object is not subscriptable HOT 2
- Loading weights error HOT 2
- Import Error HOT 6
- Dice Score
- Is it possible to generate a tract that is not one of the 72? HOT 2
- Mean FA line of the group differs between the group comparison and the correlation analysis HOT 2
- New pypi package HOT 3
- How can I get "bundle_masks.nii.gz"? HOT 2
- Downloading pretrained weights (~140MB) ...Error HOT 5
- RuntimeError: unexpected EOF, expected 31322553 more bytes. The file might be corrupted HOT 2
- Error with 'sklearn'
- 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
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.