TractSeg icon indicating copy to clipboard operation
TractSeg copied to clipboard

Tracking command: Different order of streamline vertices for left and ride sight

Open drs-m opened this issue 2 years ago • 6 comments

Hello everyone,

I ran into the following problem while using the Tracking command:

I supposed the Tracking command, which requires the ending segmentations to have been computed already, would result in a trackfile where the streamline vertices are arranged in the order from begin of the bundle to end of the bundle as defined by the ending segmentations.

When I executed the command this was not the case. I looked into the vertex location by converting the output .tck file to .txt format using mrtrix's tckconvert command.

Example CST

CST_left streamline vertices:

127.667 110.775 52.9779
126.36 112.427 60.0848
126.196 113.506 62.3268
125.923 115.761 66.3677
125.089 117.488 70.3891
123.409 119.131 74.7557
122.176 119.661 78.0519
121.118 120.343 80.9664
119.601 121.746 84.2786
117.835 122.891 87.5252

=> z-value is increasing (brainstem to cortex)

CST_right streamline vertices:

142.737 126.355 186.33
143.476 125.426 183.441
144.322 125.102 179.042
145.725 125.305 174.887
147.764 125.885 169.781
149.152 126.058 166.287
150.995 126.208 162.278
151.756 126.531 159.446
152.321 127.27 155.558
153.544 127.645 151.72

=> z-value is decreasing (cortex to brainstem)

Therefore the left side seems to be inverted in relation to the definition of the bundle sides.

I would like to know whether this behaviour is intentional. I found it non-reproducible between different bundles. I.e. OR is "correct" for both hemispheres (definition from begin/cortex to end/thalamic). IFO left and right are also both inverted related to the ending definitions.

Is there an option to request a specific order/direction with TractSeg's commands?

Thanks Darius

drs-m avatar Sep 26 '22 13:09 drs-m

Hi, during the tracking we simply start and random points in the track mask and run until we reach the start/end mask. Therefore it is not enforced that start is always the same. For Tractometry this is a problem. Therefore at the beginning of the Tractometry command we reorient all trackings that they start in the "start" region. This is done here: https://github.com/MIC-DKFZ/TractSeg/blob/master/tractseg/libs/tractometry.py#L50

wasserth avatar Sep 26 '22 14:09 wasserth

I tried to run tckgen myself and not using -seed bundle_segm -mask bundle_segm -include begin -include end but -seed begin -mask bundle -include end instead.

Would that be a valid approach in your opinion?

drs-m avatar Sep 26 '22 14:09 drs-m

Also with -seed_unidirectional

drs-m avatar Sep 26 '22 14:09 drs-m

In general this should work. However, the resulting tractogram will be a lot more sparse. Only starting tracking from one end it is difficult to get a full tracking. To get a full tracking you have to start everywhere.

wasserth avatar Sep 27 '22 07:09 wasserth

Thanks a lot! I will probably use the FOD Tracking with TractSeg instead then and try to find out how to get a fixed order. I can't use the Tractogram tool for now unfortunately.

drs-m avatar Sep 27 '22 08:09 drs-m

If you are a bit familiar with python you could simply run the function orient_to_same_start_region on the trackings. Then all of them have the same orientation.

wasserth avatar Sep 29 '22 09:09 wasserth