TractSeg icon indicating copy to clipboard operation
TractSeg copied to clipboard

Error Generating tractograms in subject space

Open amitjc opened this issue 3 years ago • 6 comments

Dear experts,

I'm unable to generate tractograms in subject space.

When I execute the command:

Tracking -i tractseg_output/peaks.nii.gz -o tractseg_output,

I get the following error

/bin/sh: 1: export: Files/Microsoft/jdk-11.0.12.7-hotspot/bin:/mnt/c/Program: bad variable name
  0%|                                                                                            | 0/72 [00:00<?, ?it/s]
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/home/amitjc/.local/lib/python3.8/site-packages/tractseg/libs/tractseg_prob_tracking.py", line 157, in process_seedpoint
    streamline_part1, length_1 = process_one_way(peaks, streamline1, max_nr_steps, step_size, probabilistic,
  File "/home/amitjc/.local/lib/python3.8/site-packages/tractseg/libs/tractseg_prob_tracking.py", line 52, in process_one_way
    dir_raw = get_at_idx(peaks, (last_point[0], last_point[1], last_point[2]))
  File "/home/amitjc/.local/lib/python3.8/site-packages/tractseg/libs/tractseg_prob_tracking.py", line 43, in get_at_idx
    return img[int(idx[0]), int(idx[1]), int(idx[2])]
IndexError: index 59 is out of bounds for axis 2 with size 57
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/amitjc/.local/bin/Tracking", line 169, in <module>
    main()
  File "/home/amitjc/.local/bin/Tracking", line 159, in main
    tracking.track(bundle, input_path, Config.PREDICT_IMG_OUTPUT,
  File "/home/amitjc/.local/lib/python3.8/site-packages/tractseg/libs/tracking.py", line 220, in track
    streamlines = tractseg_prob_tracking.track(tom_peaks, max_nr_fibers=nr_fibers, smooth=5,
  File "/home/amitjc/.local/lib/python3.8/site-packages/tractseg/libs/tractseg_prob_tracking.py", line 263, in track
    streamlines_tmp = pool.map(partial(process_seedpoint, next_step_displacement_std=next_step_displacement_std,
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 364, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 771, in get
    raise self._value
IndexError: index 59 is out of bounds for axis 2 with size 57

Look forward to guidance to address the issue.

Thank you.

Best Regards, Amit.

amitjc avatar Mar 08 '22 19:03 amitjc

Which version of TractSeg are you using? And on which operating system are you running it?

wasserth avatar Mar 14 '22 10:03 wasserth

Dear Sir,

I'm using TractSeg v2.5 on WSL with Ubuntu20.04. I've also tried running this on native installation of Ubuntu 20.04, but encountered same error.

Thank you.

Best Regards, Amit.

amitjc avatar Mar 14 '22 12:03 amitjc

Would you be able to share the data so I can try to reproduce the issue?

wasserth avatar Mar 14 '22 17:03 wasserth

Dear Sir,

Please accept the invitation to my data repository.

Thank you.

Best Regards, Amit.

amitjc avatar Mar 14 '22 18:03 amitjc

Thanks for sharing the data. I ran the following commands and everything worked fine for me.

TractSeg -i Diffusion.nii.gz --raw_diffusion_input --keep_intermediate_files
TractSeg -i tractseg_output/peaks.nii.gz -o tractseg_output --output_type endings_segmentation
TractSeg -i tractseg_output/peaks.nii.gz -o tractseg_output --output_type TOM
Tracking -i tractseg_output/peaks.nii.gz -o tractseg_output --tracking_format tck

wasserth avatar Mar 15 '22 13:03 wasserth

Dear Sir,

With above commands, I face no issue generating the tracts in the MNI space.

Even the first 3 commands run perfectly fine, for generating Segmentations and TOMs in subject space viz.,

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

Following this, the above error is encountered while executing Tracking -i tractseg_output/peaks.nii.gz -o tractseg_output

Appreciate your support through the troubleshooting. Look forward to further guidance.

Thank you.

Best Regards, Amit.

amitjc avatar Mar 15 '22 14:03 amitjc