Bizzare Tractogram

Hmmm. I’m not sure. I suggest you contact Jakob (he created Tractseg):

j.wasserthal@dkfz-heidelberg.de

Jerome

Hello Jerome,

Finally I could launch TractSeg in python3 venv after pip Install nightly version of pytorch in python3 venv.

Thanks much.

Best Regards,
Amit.

TractSeg: error: unrecognized arguments: --bundle_specific_thr

TractSeg: error: unrecognized arguments: --postprocess

Getting the errors as above and then Tracking generates empty tractograms.

PFA log below and advice.

Thank you.

Best Regards,
Amit.

(p3_env) amitjc@AMiT:~$ TractSeg -i ~/NiFTi/peaks.nii.gz --bundle_specific_thr 
usage: TractSeg [-h] -i filepath [-o directory] [--single_output_file]
                [--csd_type csd|csd_msmt|csd_msmt_5tt]
                [--output_type tract_segmentation|endings_segmentation|TOM|dm_regression]
                [--bvals filename] [--bvecs filename] [--brain_mask filename]
                [--raw_diffusion_input] [--keep_intermediate_files]
                [--preview] [--flip] [--single_orientation]
                [--get_probabilities] [--super_resolution] [--uncertainty]
                [--no_postprocess] [--preprocess] [--nr_cpus n]
                [--tract_segmentation_output_dir folder_name]
                [--TOM_output_dir folder_name] [--exp_name folder_name]
                [--tract_definition TractQuerier+|AutoPTX] [--rescale_dm]
                [--tract_segmentations_path path] [--test] [--verbose]
                [--version]
TractSeg: error: unrecognized arguments: --bundle_specific_thr
(p3_env) amitjc@AMiT:~$ TractSeg -i ~/NiFTi/peaks.nii.gz
/home/amitjc/p3_env/bin/TractSeg:251: DeprecationWarning: get_data() is deprecated in favor of get_fdata(), which has a more predictable return type. To obtain get_data() behavior going forward, use numpy.asanyarray(img.dataobj).

* deprecated from version: 3.0
* Will raise <class 'nibabel.deprecator.ExpiredDeprecationError'> as of version: 5.0
  data_img_shape = data_img.get_data().shape
/home/amitjc/p3_env/bin/TractSeg:272: DeprecationWarning: get_data() is deprecated in favor of get_fdata(), which has a more predictable return type. To obtain get_data() behavior going forward, use numpy.asanyarray(img.dataobj).

* deprecated from version: 3.0
* Will raise <class 'nibabel.deprecator.ExpiredDeprecationError'> as of version: 5.0
  data = data_img.get_data()
Loading weights from: /home/amitjc/.tractseg/pretrained_weights_tract_segmentation_v3.npz
Downloading pretrained weights (~140MB) ...
Processing direction (1 of 3)
100%|█████████████████████████████████████████| 144/144 [00:26<00:00,  5.44it/s]
Processing direction (2 of 3)
100%|█████████████████████████████████████████| 144/144 [00:29<00:00,  4.95it/s]
Processing direction (3 of 3)
100%|█████████████████████████████████████████| 144/144 [00:24<00:00,  5.79it/s]
(p3_env) amitjc@AMiT:~$ TractSeg -i ~/NiFTi/peaks.nii.gz --output_type endings_segmentation --postprocess
usage: TractSeg [-h] -i filepath [-o directory] [--single_output_file]
                [--csd_type csd|csd_msmt|csd_msmt_5tt]
                [--output_type tract_segmentation|endings_segmentation|TOM|dm_regression]
                [--bvals filename] [--bvecs filename] [--brain_mask filename]
                [--raw_diffusion_input] [--keep_intermediate_files]
                [--preview] [--flip] [--single_orientation]
                [--get_probabilities] [--super_resolution] [--uncertainty]
                [--no_postprocess] [--preprocess] [--nr_cpus n]
                [--tract_segmentation_output_dir folder_name]
                [--TOM_output_dir folder_name] [--exp_name folder_name]
                [--tract_definition TractQuerier+|AutoPTX] [--rescale_dm]
                [--tract_segmentations_path path] [--test] [--verbose]
                [--version]
TractSeg: error: unrecognized arguments: --postprocess
(p3_env) amitjc@AMiT:~$ TractSeg -i ~/NiFTi/peaks.nii.gz --output_type endings_segmentation
/home/amitjc/p3_env/bin/TractSeg:251: DeprecationWarning: get_data() is deprecated in favor of get_fdata(), which has a more predictable return type. To obtain get_data() behavior going forward, use numpy.asanyarray(img.dataobj).

* deprecated from version: 3.0
* Will raise <class 'nibabel.deprecator.ExpiredDeprecationError'> as of version: 5.0
  data_img_shape = data_img.get_data().shape
/home/amitjc/p3_env/bin/TractSeg:272: DeprecationWarning: get_data() is deprecated in favor of get_fdata(), which has a more predictable return type. To obtain get_data() behavior going forward, use numpy.asanyarray(img.dataobj).

* deprecated from version: 3.0
* Will raise <class 'nibabel.deprecator.ExpiredDeprecationError'> as of version: 5.0
  data = data_img.get_data()
Loading weights from: /home/amitjc/.tractseg/pretrained_weights_endings_segmentation_v4.npz
Downloading pretrained weights (~140MB) ...
Processing direction (1 of 3)
100%|█████████████████████████████████████████| 144/144 [00:27<00:00,  5.20it/s]
Processing direction (2 of 3)
100%|█████████████████████████████████████████| 144/144 [00:31<00:00,  4.60it/s]
Processing direction (3 of 3)
100%|█████████████████████████████████████████| 144/144 [00:28<00:00,  5.05it/s]
(p3_env) amitjc@AMiT:~$ TractSeg -i ~/NiFTi/peaks.nii.gz --output_type TOM
/home/amitjc/p3_env/bin/TractSeg:251: DeprecationWarning: get_data() is deprecated in favor of get_fdata(), which has a more predictable return type. To obtain get_data() behavior going forward, use numpy.asanyarray(img.dataobj).

* deprecated from version: 3.0
* Will raise <class 'nibabel.deprecator.ExpiredDeprecationError'> as of version: 5.0
  data_img_shape = data_img.get_data().shape
/home/amitjc/p3_env/bin/TractSeg:272: DeprecationWarning: get_data() is deprecated in favor of get_fdata(), which has a more predictable return type. To obtain get_data() behavior going forward, use numpy.asanyarray(img.dataobj).

* deprecated from version: 3.0
* Will raise <class 'nibabel.deprecator.ExpiredDeprecationError'> as of version: 5.0
  data = data_img.get_data()
Loading weights from: /home/amitjc/.tractseg/pretrained_weights_peak_regression_part1_v2.npz
Downloading pretrained weights (~140MB) ...
100%|█████████████████████████████████████████| 144/144 [00:23<00:00,  6.02it/s]
Loading weights from: /home/amitjc/.tractseg/pretrained_weights_peak_regression_part2_v2.npz
Downloading pretrained weights (~140MB) ...
100%|█████████████████████████████████████████| 144/144 [00:24<00:00,  5.99it/s]
Loading weights from: /home/amitjc/.tractseg/pretrained_weights_peak_regression_part3_v2.npz
Downloading pretrained weights (~140MB) ...
100%|█████████████████████████████████████████| 144/144 [00:23<00:00,  6.07it/s]
Loading weights from: /home/amitjc/.tractseg/pretrained_weights_peak_regression_part4_v2.npz
Downloading pretrained weights (~140MB) ...
100%|█████████████████████████████████████████| 144/144 [00:23<00:00,  6.04it/s]
(p3_env) amitjc@AMiT:~$ Tracking -i ~/NiFTi/peaks.nii.gz --tracking_dir TOM_trackings_filt --tracking_format tck
  6%|██▍                                         | 4/72 [02:58<48:05, 42.43s/it]WARNING: tract mask of CA empty. Creating empty tractogram.
WARNING: tract beginnings mask of CA empty. Creating empty tractogram.
WARNING: tract endings mask of CA empty. Creating empty tractogram.
 10%|████▎                                       | 7/72 [04:14<40:49, 37.68s/it]WARNING: tract beginnings mask of CC_3 empty. Creating empty tractogram.
WARNING: tract endings mask of CC_3 empty. Creating empty tractogram.
WARNING: tract beginnings mask of CC_4 empty. Creating empty tractogram.
 21%|████████▉                                  | 15/72 [08:45<38:32, 40.57s/it]WARNING: tract beginnings mask of CST_right empty. Creating empty tractogram.
WARNING: tract endings mask of CST_right empty. Creating empty tractogram.
 28%|███████████▉                               | 20/72 [11:44<36:24, 42.02s/it]WARNING: tract mask of FX_left empty. Creating empty tractogram.
WARNING: tract beginnings mask of FX_left empty. Creating empty tractogram.
 29%|████████████▌                              | 21/72 [11:44<25:02, 29.47s/it]WARNING: tract mask of FX_right empty. Creating empty tractogram.
WARNING: tract beginnings mask of FX_right empty. Creating empty tractogram.
WARNING: tract endings mask of FX_right empty. Creating empty tractogram.
WARNING: tract endings mask of ICP_left empty. Creating empty tractogram.
 32%|█████████████▋                             | 23/72 [11:44<16:52, 20.65s/it]WARNING: tract endings mask of ICP_right empty. Creating empty tractogram.
^CProcess ForkPoolWorker-2617:
Process ForkPoolWorker-2619:
Process ForkPoolWorker-2620:
 33%|██████████████▎                            | 24/72 [12:25<24:51, 31.08s/it]
Process ForkPoolWorker-2618:
Traceback (most recent call last):

Try putting a space and semi-colon at the end. e.g. – bundle_specific_thr ;

Jerome

Hello Jerome,

Can’t get it to work.

PFA the log below and advice.

Thanks,

Best Regards,
Amit.

(p3_env) amitjc@AMiT:~$ TractSeg -i ~/NiFTi/peaks.nii.gz --bundle_specific_thr ;
usage: TractSeg [-h] -i filepath [-o directory] [--single_output_file]
                [--csd_type csd|csd_msmt|csd_msmt_5tt]
                [--output_type tract_segmentation|endings_segmentation|TOM|dm_regression]
                [--bvals filename] [--bvecs filename] [--brain_mask filename]
                [--raw_diffusion_input] [--keep_intermediate_files]
                [--preview] [--flip] [--single_orientation]
                [--get_probabilities] [--super_resolution] [--uncertainty]
                [--no_postprocess] [--preprocess] [--nr_cpus n]
                [--tract_segmentation_output_dir folder_name]
                [--TOM_output_dir folder_name] [--exp_name folder_name]
                [--tract_definition TractQuerier+|AutoPTX] [--rescale_dm]
                [--tract_segmentations_path path] [--test] [--verbose]
                [--version]
TractSeg: error: unrecognized arguments: --bundle_specific_thr

I think Tractseg has been updated/revised recently so there are new commands (https://github.com/MIC-DKFZ/TractSeg):

TractSeg -i peaks.nii.gz --output_type tract_segmentation
TractSeg -i peaks.nii.gz --output_type endings_segmentation
TractSeg -i peaks.nii.gz --output_type TOM
Tracking -i peaks.nii.gz

Jerome

The tractogram post dwigradcheck can be found in the reply to Jerome.

dwigradcheck does not automatically modify the gradient table, and will therefore not have influenced your results in any way. If you wish to utilise the permutation that it estimates to be the most likely correct, you would need to explicitly export that gradient table to file, and then either utilise that table explicitly in subsequent commands or explicitly load it into your image header for subsequent automatic use.

The primary result of this script should be considered to be the summary information that is produced on the terminal. That information needs to be assessed critically, hence why it does not modify the gradient table information in-place.