TractSeg icon indicating copy to clipboard operation
TractSeg copied to clipboard

TypeError: 'NoneType' object is not subscriptable

Open LucSam opened this issue 3 years ago • 4 comments

Hi,

when using Tracking (default, see cmd below, according to https://github.com/MIC-DKFZ/TractSeg) I obtain the following error. However, if I add "--algorithm det" it is working. In addition, if I add "--algorithm prob", the error is reproduced:

luciusfekonja@LFMBP Diffusion % Tracking -i peaks2.nii.gz --tracking_format tck -o tractseg_output2 --tracking_format tck 0%| | 0/72 [00:02<?, ?it/s] multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/usr/local/Cellar/[email protected]/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "/usr/local/Cellar/[email protected]/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 48, in mapstar return list(map(*args)) File "/usr/local/lib/python3.9/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 "/usr/local/lib/python3.9/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 "/usr/local/lib/python3.9/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])] TypeError: 'NoneType' object is not subscriptable """

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

Traceback (most recent call last): File "/usr/local/bin/Tracking", line 169, in main() File "/usr/local/bin/Tracking", line 159, in main tracking.track(bundle, input_path, Config.PREDICT_IMG_OUTPUT, File "/usr/local/lib/python3.9/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 "/usr/local/lib/python3.9/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/local/Cellar/[email protected]/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 364, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "/usr/local/Cellar/[email protected]/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 771, in get raise self._value TypeError: 'NoneType' object is not subscriptable

LucSam avatar Jun 13 '22 09:06 LucSam

Which TractSeg version are you using? I am not really sure what the problem might be. Would it be possible to share the dataset so I can try to reproduce the error?

wasserth avatar Jun 13 '22 14:06 wasserth

I'm using TractSeg --version 2.6 with HCP subject 100610

LucSam avatar Jun 13 '22 14:06 LucSam

Unfortunately I do not have the HCP data at my computer here at the moment. Could you send me the peaks file and the brainmask? ([email protected])

wasserth avatar Jun 13 '22 14:06 wasserth

1min, thanks!

LucSam avatar Jun 13 '22 14:06 LucSam