Comments (20)
Did you try the steps described here: https://github.com/MIC-DKFZ/TractSeg#small-bundles-like-the-ca-and-fx-are-incomplete ? Those tend to make the segmentations more complete.
What resolution and how many gradient directions does the dataset have? Did you make sure the peaks are flipped correctly by looking at them in mrview (Toosl->fixel plot)?
You can also add the option --get_probabilities
. Then you can choose the threshold yourself for creating binary masks from the model output. By choosing a lower threshold you can get more complete segmentations at the cost of some oversegmentation.
If you can share some of the data (without preprocessing) I could also have a look at it and see what I get using my preprocessing pipeline.
from tractseg.
Did you rigidly move the images to MNI space?
from tractseg.
Yes, I used --bundle_specific_threshold
and feeded the FA_MNI.nii.gz
.
Ok, very fine result now with flipped peaks. Thank you!
Although before and now I get INFO: Detected that peaks have wrong orientation and automatically flipped them.
from tractseg.
Great that it works now!
TractSeg is trying to automatically detect if the peaks have to be flipped. That is working correctly in most of the cases, but not all. So in the newest version of TractSeg (1.7.1) peaks are not flipped automatically anymore (because sometimes TractSeg gets it wrong). Only a warning is shown to the user telling him that TractSeg thinks that the peaks need to be flipped. Then the users has to do it manually and check it himself again.
from tractseg.
Ok, great, thanks again..
I'm encountering now a different problem, which I guess depends on the subsequent flipped peaks. If I want to perform tractometry with the FA_MNI.nii.gz
file, I get out of bounds errors
.
I tried mrtransform FA_MNI.nii.gz -flip 1 FA_flipped.nii.gz
but the problem remains.
from tractseg.
When you talk about FA_MNI.nii.gz
to you mean the FA or the peaks? Flipping the FA does not make any sense. Only the peaks have to be flipped.
from tractseg.
Yes, with the flipped peaks Tractometry -i TOM_trackings/ -o Tractome try_tx.csv -e endings_segmentations/ -s ../../FA_MNI.nii.gz --tracking_format tck
I now get the error: IndexError: index 90 is out of bounds for axis 0 with size 88
It must be related to the FA image somehow? I updated all segmentations with the newly flipped peaks.
from tractseg.
Do all of your images (the bundle segmentations, the tract orientation maps, brain mask and the FA) have the same spacing and dimensions?
from tractseg.
The segmentations,toms and mask do have the same dimensions, but not the FA images.
How come? The only thing I changed was flipping the peaks.
Image: "../../FA_MNI.nii.gz"
************************************************
Dimensions: 145 x 174 x 145
Voxel size: 1.25 x 1.25 x 1.25
Data strides: [ -1 2 3 ]
Format: NIfTI-1.1 (GZip compressed)
Data type: 32 bit float (little endian)
Intensity scaling: offset = 0, multiplier = 1
Transform: 1 0 0 -90
-0 1 0 -126
-0 0 1 -72
Image: "TOM/AF_left.nii.gz"
************************************************
Dimensions: 88 x 106 x 88 x 3
Voxel size: 2.05 x 2.05 x 2.05 x 1
Data strides: [ -1 2 3 4 ]
Format: NIfTI-1.1 (GZip compressed)
Data type: 32 bit float (little endian)
Intensity scaling: offset = 0, multiplier = 1
Transform: 1 0 0 -88.35
-0 1 0 -126
-0 0 1 -72
Image: "bundle_segmentations/AF_left.nii.gz"
************************************************
Dimensions: 88 x 106 x 88
Voxel size: 2.05 x 2.05 x 2.05
Data strides: [ -1 2 3 ]
Format: NIfTI-1.1 (GZip compressed)
Data type: signed 16 bit integer (little endian)
Intensity scaling: offset = 0, multiplier = 1
Transform: 1 0 0 -88.35
-0 1 0 -126
-0 0 1 -72
Image: "../../nodif_brain_mask.nii.gz"
************************************************
Dimensions: 88 x 106 x 88
Voxel size: 2.05 x 2.05 x 2.05
Data strides: [ -1 2 3 ]
Format: NIfTI-1.1 (GZip compressed)
Data type: signed 16 bit integer (little endian)
Intensity scaling: offset = 0, multiplier = 1
Transform: 1 0 0 -88.35
-0 1 0 -126
-0 0 1 -72
Image: "../my_peaks_flip_y.nii.gz"
************************************************
Dimensions: 88 x 106 x 88 x 9
Voxel size: 2.05 x 2.05 x 2.05 x 1
Data strides: [ -1 2 3 4 ]
Format: NIfTI-1.1 (GZip compressed)
Data type: 32 bit float (little endian)
Intensity scaling: offset = 0, multiplier = 1
Transform: 1 0 0 -88.35
-0 1 0 -126
-0 0 1 -72
from tractseg.
It seems like you used the FA_MNI.nii.gz image which is generated by TractSeg when using the option --preprocess
. This image is having the dimensions of the MNI_FA_template image (1.25mm resolution). However your Diffusion image in MNI space has the same dimensions as your input image. Therefore the peaks and also the bundle segmentations also have the same resolution as the input image. This is the behaviour you normally want.
The FA_MNI.nii.gz actually is only a temporary file used by TractSeg. It is a bit confusing because it has different dimensions than the other resulting files. You should ignore it.
If you recalculate the FA (e.g. using the calc_FA script from TractSeg) using the Diffusion image (in MNI space) as input you should be fine. It has the same dimensions then as the bundle segmentations.
Before the peak flipped you probably did not get any error because the segmentations were almost empty. But the different dimensions problem was already present at that point.
from tractseg.
Great, that works fine now, thanks!
Where can we get an overview of those different scripts like calc_FA or flip_peaks, or are those the only two?
from tractseg.
If you look into the folder bin
inside of the TractSeg repository you can see all available scripts. But normally only calc_FA, flip_peaks, TractSeg and Tractometry are of interest for most people.
from tractseg.
Hi,
did something change in the preprocessing or processing steps?
After we updated to 1.7.1 we get empty or interrupted tract segmentations in clinical cases which worked before. Furthermore, we have our own multishell data with AP-PA correction and 64 dirs per shell and 1.5mm voxel resolution which also results in non complete tract segmentations. We tested in multiple ways with flipping peaks, raw-diffusion inputs in both various subjects and patients as well as feeding our own calculated wm_fod's. Can you help, suggest hints or tips? In HCP data it still works perfectly fine.
from tractseg.
You can see all the changes for each version in the CHANGELOG.md file (https://github.com/MIC-DKFZ/TractSeg/blob/master/CHANGELOG.md). There is one change to the preprocessing in v1.7.1. Peaks are not automatically flipped anymore. You should see a warning message if TractSeg thinks the peaks need to be flipped. You have to flip them manually then. Does that solve your problem?
from tractseg.
Thanks for the changelog hint. However, after feeding various data - manually flipped and non-flipped, it seems to fail to provide non interrupted tract segmentations.
from tractseg.
Hi, we now downgraded to version 1.6. After we flip the peaks it works perfectly fine for our clinical data with version 1.6.
Unfortunately we don't get similar nice results with 1.7.1.
Peaks were flipped by flip_peaks -i peaks.nii.gz -o peaks_flipped.nii.gz -a y
from tractseg.
I did not experience such problems. It is hard to tell what might be the problem. If you send me the data of one subject where it works in 1.6 but fails in 1.7.1 I can have a look if I can reproduce the problem.
from tractseg.
ok thanks, we've sent it via wetransfer
from tractseg.
I had a look at the data. It is a bit tricky because it only works if you move it to MNI space (which you should always do) and flip it along the z dimension. TractSeg tells you to flip it along the x axis, but that is wrong. If there is a tumor in the brain TractSeg is getting it wrong quite often unfortunately. So you have to look at it manually in mrview (Tools->fixel plot) or MITK Diffusion to determine how you have to flip them so that it aligns properly with the Diffusion image. If you are not sure you can try all three options: Flip along x, y and z and see which one gives proper results.
So you get good results (using v1.7.1) if you do the following with your data (--preprocess
moves it to MNI space):
TractSeg -i Diffusion.nii.gz --raw_diffusion_input --preprocess
flip_peaks -i tractseg_output/peaks.nii.gz -o tractseg_output/peaks_flipped_z.nii.gz -a z
TractSeg -i tractseg_output/peaks_flipped_z.nii.gz -o .
from tractseg.
Ok thank you very much! We used as well --preprocess
but didn't think about flipping other axes...
Thanks again!
from tractseg.
Related Issues (20)
- loss become minus when train my own TOM model
- Definition of AF and SLF-III HOT 2
- Apply TractSeg to the study specific population template using the peaks of the spherical harmonic function at each voxel as input HOT 9
- error message when tracking HOT 10
- About trk_2_binary.py HOT 4
- No such file or no access "template/TOM/bundle_segmentations/AF_left.nii.gz HOT 1
- Very minor setup.py problem HOT 1
- About bundle_masks.nii.gz
- Plot3D error HOT 1
- CUDA error with M1 chip HOT 2
- Failed to install TractSeg in Ubuntu18 HOT 1
- [Explanation] Training slice-wise and predicting subject-wise? HOT 2
- EOFError: Ran out of input HOT 6
- download_all_pretrained_weights does not flag when it cannot download to folder HOT 1
- Tractometry results plots with negative average metric values HOT 3
- Training Process Question HOT 2
- 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
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.