TractSeg
TractSeg copied to clipboard
3d plots - Tract appearing outside of glass brain
Hi there,
I am having some trouble with the 3d visualisation as attached when running the following command:
plot_tractometry_results -i /subjects.txt -o tractometry_result.png --mc --alpha 0.05 --plot3D pval --tracking_dir /TOM_trackings --tracking_format trk
Please could I get some guidance on how to address this?
Were your input data rigidly aligned to MNI, and is the tracking_format
you specified the same as when you ran Tracking
?
Hi @smeisler thank you for your prompt response. I aligned the data to MNI space using the following commands:
for subject in cat subList.txt
; do
cd <ABSOLUTEPATH>
/Users/Downloads/TractSeg-master/build/scripts-3.8/calc_FA -i Diffusion.nii.gz -o FA.nii.gz --bvals Diffusion.bvals --bvecs Diffusion.bvecs --brain_mask nodif_brain_mask.nii.gz
/usr/local/fsl/bin/flirt -ref MNI_FA_template.nii -in FA.nii.gz -out FA_MNI.nii.gz -omat FA_2_MNI.mat -dof 6 -cost mutualinfo -searchcost mutualinfo
/usr/local/fsl/bin/flirt -ref MNI_FA_template.nii -in Diffusion.nii.gz -out Diffusion_MNI.nii.gz -applyxfm -init FA_2_MNI.mat -dof 6
/usr/local/fsl/bin/flirt -ref MNI_FA_template.nii -in nodif_brain_mask.nii.gz -out nodif_brain_mask_MNI.nii.gz -applyxfm -init FA_2_MNI.mat -dof 6
cp Diffusion.bvals Diffusion_MNI.bvals
/Users/Downloads/TractSeg-master/bin/rotate_bvecs -i Diffusion.bvecs -t FA_2_MNI.mat -o Diffusion_MNI.bvecs
done
These look fine in FSL.
I have just seen the following for rigidly aligning them to MNI space as follows:
"# in first step --raw_diffusion_input has to be used together with --preprocess TractSeg -i Diffusion.nii.gz -o tractseg_output --output_type tract_segmentation --raw_diffusion_input --preprocess TractSeg -i tractseg_output/peaks.nii.gz -o tractseg_output --output_type endings_segmentation --preprocess TractSeg -i tractseg_output/peaks.nii.gz -o tractseg_output --output_type TOM --preprocess Tracking -i tractseg_output/peaks.nii.gz -o tractseg_output"
I ran tracking as follows:
/usr/local/bin/docker run -v ${pathData}:/data -t wasserth/tractseg_container:master Tracking -i /data/tractseg_output/peaks.nii.gz -o /data/tractseg_output --nr_fibers 5000
I did not specify the tracking_format but the output of the TOM_Trackings are .trk files.
Can I run the rigidly align to MNI space with the -preprocess commands again through the docker with the current output already in each subject's folder? and if so do will the output overwrite my current TOM_Trackings folder? If possible are there some example scripts for use with docker commands as it appears only the --preprocess flag is different?
When you do the manual transformation to MNI space as you have described (using flirt) then you do not need to use the --preprocess
option. --preprocess
will simply do the same thing with flirt as you did manually.
Do you have the lastest docker container? In June I fixed a bug related to alignment of the streamlines. So make sure your docker container is from after this fix. Also you could try if it works with --tracking_format tck
.
All the normal commands in the documentation can be used with docker. Therefore there is no separate documentation for docker.
Hi @wasserth I've made sure I am using the latest docker container.
Using the following command:
/usr/local/bin/docker run -v ${pathData}:/data -t tractseg_container1:latest plot_tractometry_results -i /data/subjects.txt -o /data/tractometry_result.png --mc --alpha 0.05 --plot3D pval --tracking_format trk
I now get the followings error:
0%| | 0/50 [00:00<?, ?it/s] /usr/local/lib/python3.7/site-packages/fury/utils.py:235: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. cols_arr = np.asarray(colors)
Everything looks like it is running as before but doesn't get past 0/50.
Is there anything else I could try?
In version 2.4 I made another bug fix for alignment of the trackings. You could try again with this version.