Adding a new ROI to Atlas

Hi there,

I am attempting to add a subthalamic nucleus ROI (LH and RH) to an atlas created by QSIprep.

My workflow is as follows:

  1. Preprocess the DWI and anatomical via QSIprep
  2. Run the reconstruction pipeline from QSI prep and extract the brainnetome atlas and LUTs.
  3. Create a mask of the subthalamic nucleus for the LH and RH and register the mask to the subject’s preprocessed DWI (the atlas is also registered to this).
  4. Use mri_concat --sum from freesurfer to append the subthalamic nucleus mask in the subject’s DWI space to the atlas. The result looks great!
  5. Append the new subthalamic nucleus ROI to the original LUT and the MRtrix LUT
  6. Create the connectome for individual subject using labelconvert and tck2connectome

However, the new ROI is not included in the connectome.

Not sure why this is. Any advice or solutions would be greatly appreciated!

Hi @Benjamin_Deck,

Not sure exactly what the problem is, but my guess would be some glitch in the LUT files. Can you copy / paste both of them in your response? Make sure to include the contents between code markers, like this:

```
contents of file
```

This will make it much easier for us to navigate…

All the best,
Donald

Hi @jdtournier ,

Thanks for checking this out!

This is for the brainnetome246 parcellation.

Orig LUT

0 Unknown 25 5 25 0
1 A8m_L 0 255 0 0
2 A8m_R 0 0 255 0
3 A8dl_L 255 0 0 0
4 A8dl_R 0 246 255 0
5 A9l_L 255 123 220 0
6 A9l_R 255 220 123 0
7 A6dl_L 0 141 255 0
8 A6dl_R 0 106 9 0
9 A6m_L 158 70 53 0
10 A6m_R 62 0 106 0
11 A9m_L 255 237 255 0
12 A9m_R 141 255 158 0
13 A10m_L 229 0 255 0
14 A10m_R 79 123 141 0
15 A9/46d_L 220 255 0 0
16 A9/46d_R 255 0 106 0
17 IFJ_L 237 132 0 0
18 IFJ_R 123 88 246 0
19 A46_L 141 0 88 0
20 A46_R 123 106 0 0
21 A9/46v_L 158 185 141 0
22 A9/46v_R 141 106 176 0
23 A8vl_L 97 185 0 0
24 A8vl_R 255 158 176 0
25 A6vl_L 0 44 97 0
26 A6vl_R 62 193 255 0
27 A10l_L 62 79 44 0
28 A10l_R 167 9 167 0
29 A44d_L 97 62 79 0
30 A44d_R 0 185 141 0
31 IFS_L 255 211 0 0
32 IFS_R 255 106 79 0
33 A45c_L 0 0 158 0
34 A45c_R 70 0 0 0
35 A45r_L 237 185 255 0
36 A45r_R 202 149 106 0
37 A44op_L 255 0 167 0
38 A44op_R 220 255 123 0
39 A44v_L 44 70 176 0
40 A44v_R 158 167 0 0
41 A14m_L 149 211 220 0
42 A14m_R 176 149 167 0
43 A12/47o_L 202 132 255 0
44 A12/47o_R 0 255 114 0
45 A11l_L 167 0 0 0
46 A11l_R 132 0 229 0
47 A11m_L 44 0 44 0
48 A11m_R 255 255 202 0
49 A13_L 229 79 141 0
50 A13_R 176 255 211 0
51 A12/47l_L 0 176 79 0
52 A12/47l_R 88 53 0 0
53 A4hf_L 0 106 167 0
54 A4hf_R 149 167 229 0
55 A6cdl_L 141 193 97 0
56 A6cdl_R 35 123 97 0
57 A4ul_L 176 97 132 0
58 A4ul_R 176 0 62 0
59 A4t_L 167 88 0 0
60 A4t_R 255 62 229 0
61 A4tl_L 0 62 70 0
62 A4tl_R 149 255 62 0
63 A6cvl_L 132 106 88 0
64 A6cvl_R 0 255 202 0
65 A1/2/3ll_L 202 149 44 0
66 A1/2/3ll_R 255 0 62 0
67 A4ll_L 106 132 62 0
68 A4ll_R 0 62 255 0
69 A38m_L 0 167 176 0
70 A38m_R 202 88 255 0
71 A41/42_L 255 202 185 0
72 A41/42_R 106 44 106 0
73 TE1.0/TE1.2_L 255 158 97 0
74 TE1.0/TE1.2_R 132 70 185 0
75 A22c_L 176 70 158 0
76 A22c_R 149 149 255 0
77 A38l_L 255 106 123 0
78 A38l_R 0 106 255 0
79 A22r_L 114 9 176 0
80 A22r_R 176 167 79 0
81 A21c_L 229 79 0 0
82 A21c_R 0 0 70 0
83 A21r_L 53 35 18 0
84 A21r_R 88 141 0 0
85 A37dl_L 0 35 9 0
86 A37dl_R 26 211 18 0
87 aSTS_L 123 44 62 0
88 aSTS_R 88 88 132 0
89 A20iv_L 237 237 70 0
90 A20iv_R 0 62 0 0
91 A37elv_L 211 229 211 0
92 A37elv_R 114 0 0 0
93 A20r_L 202 246 167 0
94 A20r_R 167 211 9 0
95 A20il_L 246 141 123 0
96 A20il_R 26 141 79 0
97 A37vl_L 114 141 123 0
98 A37vl_R 193 0 132 0
99 A20cl_L 0 18 44 0
100 A20cl_R 106 220 202 0
101 A20cv_L 70 79 0 0
102 A20cv_R 149 97 44 0
103 A20rv_L 185 114 106 0
104 A20rv_R 0 26 141 0
105 A37mv_L 0 255 158 0
106 A37mv_R 255 176 9 0
107 A37lv_L 123 202 141 0
108 A37lv_R 123 237 97 0
109 A35/36r_L 79 88 88 0
110 A35/36r_R 220 132 193 0
111 A35/36c_L 114 0 114 0
112 A35/36c_R 211 193 141 0
113 TL_L 185 193 220 0
114 TL_R 79 97 176 0
115 A28/34_L 88 0 53 0
116 A28/34_R 193 79 97 0
117 TI_L 70 53 123 0
118 TI_R 220 193 53 0
119 TH_L 185 167 149 0
120 TH_R 220 97 229 0
121 rpSTS_L 141 123 70 0
122 rpSTS_R 0 141 185 0
123 cpSTS_L 9 62 211 0
124 cpSTS_R 114 106 229 0
125 A7r_L 255 193 229 0
126 A7r_R 70 149 229 0
127 A7c_L 0 149 0 0
128 A7c_R 44 9 18 0
129 A5l_L 193 79 44 0
130 A5l_R 255 193 132 0
131 A7pc_L 44 44 53 0
132 A7pc_R 53 220 255 0
133 A7ip_L 211 53 62 0
134 A7ip_R 141 106 141 0
135 A39c_L 106 176 149 0
136 A39c_R 35 0 202 0
137 A39rd_L 211 220 123 0
138 A39rd_R 123 53 0 0
139 A40rd_L 167 0 211 0
140 A40rd_R 18 79 114 0
141 A40c_L 9 79 62 0
142 A40c_R 246 158 255 0
143 A39rv_L 114 176 211 0
144 A39rv_R 106 62 53 0
145 A40rv_L 53 106 53 0
146 A40rv_R 220 62 185 0
147 A7m_L 0 202 70 0
148 A7m_R 62 44 79 0
149 A5m_L 246 9 132 0
150 A5m_R 185 149 202 0
151 dmPOS_L 220 18 18 0
152 dmPOS_R 176 255 246 0
153 A31_L 62 220 149 0
154 A31_R 167 202 70 0
155 A1/2/3ulhf_L 132 141 176 0
156 A1/2/3ulhf_R 88 53 185 0
157 A1/2/3tonIa_L 193 149 237 0
158 A1/2/3tonIa_R 97 114 0 0
159 A2_L 255 132 185 0
160 A2_R 185 0 97 0
161 A1/2/3tru_L 167 237 123 0
162 A1/2/3tru_R 255 246 0 0
163 G_L 255 193 79 0
164 G_R 220 106 35 0
165 vIa_L 123 0 35 0
166 vIa_R 193 255 88 0
167 dIa_L 158 185 176 0
168 dIa_R 185 70 132 0
169 vId/vIg_L 202 123 70 0
170 vId/vIg_R 176 106 202 0
171 dIg_L 79 149 62 0
172 dIg_R 0 62 141 0
173 dId_L 88 44 211 0
174 dId_R 246 79 176 0
175 A23d_L 158 141 9 0
176 A23d_R 123 123 132 0
177 A24rv_L 132 53 97 0
178 A24rv_R 106 158 106 0
179 A32p_L 149 97 106 0
180 A32p_R 106 202 88 0
181 A23v_L 211 158 158 0
182 A23v_R 158 88 149 0
183 A24cd_L 26 35 123 0
184 A24cd_R 62 9 79 0
185 A23c_L 220 193 202 0
186 A23c_R 149 62 237 0
187 A32sg_L 167 97 237 0
188 A32sg_R 97 79 44 0
189 cLinG_L 0 106 106 0
190 cLinG_R 255 246 123 0
191 rCunG_L 88 255 229 0
192 rCunG_R 211 237 255 0
193 cCunG_L 97 35 255 0
194 cCunG_R 106 9 141 0
195 rLinG_L 132 62 149 0
196 rLinG_R 106 114 79 0
197 vmPOS_L 132 255 193 0
198 vmPOS_R 158 0 132 0
199 mOccG_L 97 158 158 0
200 mOccG_R 202 0 202 0
201 V5/MT+_L 35 106 220 0
202 V5/MT+_R 35 44 0 0
203 OPC_L 220 97 88 0
204 OPC_R 114 123 185 0
205 iOccG_L 149 18 70 0
206 iOccG_R 211 202 255 0
207 msOccG_L 185 0 255 0
208 msOccG_R 0 158 141 0
209 lsOccG_L 211 149 185 0
210 lsOccG_R 44 88 0 0
211 mAmyg_L 97 35 9 0
212 mAmyg_R 123 97 193 0
213 lAmyg_L 255 176 149 0
214 lAmyg_R 132 158 62 0
215 rHipp_L 26 18 62 0
216 rHipp_R 167 211 255 0
217 cHipp_L 97 255 79 0
218 cHipp_R 246 158 62 0
219 vCa_L 0 176 211 0
220 vCa_R 62 0 141 0
221 GP_L 220 114 141 0
222 GP_R 88 53 149 0
223 NAC_L 0 114 202 0
224 NAC_R 167 132 53 0
225 vmPu_L 70 26 53 0
226 vmPu_R 70 106 88 0
227 dCa_L 229 53 106 0
228 dCa_R 26 0 26 0
229 dlPu_L 158 0 26 0
230 dlPu_R 255 70 97 0
231 mPFtha_L 158 176 106 0
232 mPFtha_R 158 220 193 0
233 mPMtha_L 106 70 114 0
234 mPMtha_R 0 132 149 0
235 Stha_L 211 246 202 0
236 Stha_R 149 44 0 0
237 rTtha_L 246 229 202 0
238 rTtha_R 149 220 70 0
239 PPtha_L 79 123 167 0
240 PPtha_R 176 246 0 0
241 Otha_L 167 158 114 0
242 Otha_R 237 70 255 0
243 cTtha_L 167 62 202 0
244 cTtha_R 246 229 158 0
245 lPFtha_L 88 237 123 0
246 lPFtha_R 114 229 237 0
247 subth_L 110 150 10 0
248 subth_R 0 150 200 0

MRtrix

0 Unknown 25 5 25 255
1 A8m_L 255 255 255 255
2 A8m_R 255 255 255 255
3 A8dl_L 255 255 255 255
4 A8dl_R 255 246 255 255
5 A9l_L 255 123 220 255
6 A9l_R 255 220 123 255
7 A6dl_L 255 141 255 255
8 A6dl_R 255 106 9 255
9 A6m_L 158 70 53 255
10 A6m_R 62 255 106 255
11 A9m_L 255 237 255 255
12 A9m_R 141 255 158 255
13 A10m_L 229 255 255 255
14 A10m_R 79 123 141 255
15 A9/46d_L 220 255 255 255
16 A9/46d_R 255 255 106 255
17 IFJ_L 237 132 255 255
18 IFJ_R 123 88 246 255
19 A46_L 141 255 88 255
20 A46_R 123 106 255 255
21 A9/46v_L 158 185 141 255
22 A9/46v_R 141 106 176 255
23 A8vl_L 97 185 255 255
24 A8vl_R 255 158 176 255
25 A6vl_L 255 44 97 255
26 A6vl_R 62 193 255 255
27 A10l_L 62 79 44 255
28 A10l_R 167 9 167 255
29 A44d_L 97 62 79 255
30 A44d_R 255 185 141 255
31 IFS_L 255 211 255 255
32 IFS_R 255 106 79 255
33 A45c_L 255 255 158 255
34 A45c_R 70 255 255 255
35 A45r_L 237 185 255 255
36 A45r_R 202 149 106 255
37 A44op_L 255 255 167 255
38 A44op_R 220 255 123 255
39 A44v_L 44 70 176 255
40 A44v_R 158 167 255 255
41 A14m_L 149 211 220 255
42 A14m_R 176 149 167 255
43 A12/47o_L 202 132 255 255
44 A12/47o_R 255 255 114 255
45 A11l_L 167 255 255 255
46 A11l_R 132 255 229 255
47 A11m_L 44 255 44 255
48 A11m_R 255 255 202 255
49 A13_L 229 79 141 255
50 A13_R 176 255 211 255
51 A12/47l_L 255 176 79 255
52 A12/47l_R 88 53 255 255
53 A4hf_L 255 106 167 255
54 A4hf_R 149 167 229 255
55 A6cdl_L 141 193 97 255
56 A6cdl_R 35 123 97 255
57 A4ul_L 176 97 132 255
58 A4ul_R 176 255 62 255
59 A4t_L 167 88 255 255
60 A4t_R 255 62 229 255
61 A4tl_L 255 62 70 255
62 A4tl_R 149 255 62 255
63 A6cvl_L 132 106 88 255
64 A6cvl_R 255 255 202 255
65 A1/2/3ll_L 202 149 44 255
66 A1/2/3ll_R 255 255 62 255
67 A4ll_L 106 132 62 255
68 A4ll_R 255 62 255 255
69 A38m_L 255 167 176 255
70 A38m_R 202 88 255 255
71 A41/42_L 255 202 185 255
72 A41/42_R 106 44 106 255
73 TE1.0/TE1.2_L 255 158 97 255
74 TE1.0/TE1.2_R 132 70 185 255
75 A22c_L 176 70 158 255
76 A22c_R 149 149 255 255
77 A38l_L 255 106 123 255
78 A38l_R 255 106 255 255
79 A22r_L 114 9 176 255
80 A22r_R 176 167 79 255
81 A21c_L 229 79 255 255
82 A21c_R 255 255 70 255
83 A21r_L 53 35 18 255
84 A21r_R 88 141 255 255
85 A37dl_L 255 35 9 255
86 A37dl_R 26 211 18 255
87 aSTS_L 123 44 62 255
88 aSTS_R 88 88 132 255
89 A20iv_L 237 237 70 255
90 A20iv_R 255 62 255 255
91 A37elv_L 211 229 211 255
92 A37elv_R 114 255 255 255
93 A20r_L 202 246 167 255
94 A20r_R 167 211 9 255
95 A20il_L 246 141 123 255
96 A20il_R 26 141 79 255
97 A37vl_L 114 141 123 255
98 A37vl_R 193 255 132 255
99 A20cl_L 255 18 44 255
100 A20cl_R 106 220 202 255
101 A20cv_L 70 79 255 255
102 A20cv_R 149 97 44 255
103 A20rv_L 185 114 106 255
104 A20rv_R 255 26 141 255
105 A37mv_L 255 255 158 255
106 A37mv_R 255 176 9 255
107 A37lv_L 123 202 141 255
108 A37lv_R 123 237 97 255
109 A35/36r_L 79 88 88 255
110 A35/36r_R 220 132 193 255
111 A35/36c_L 114 255 114 255
112 A35/36c_R 211 193 141 255
113 TL_L 185 193 220 255
114 TL_R 79 97 176 255
115 A28/34_L 88 255 53 255
116 A28/34_R 193 79 97 255
117 TI_L 70 53 123 255
118 TI_R 220 193 53 255
119 TH_L 185 167 149 255
120 TH_R 220 97 229 255
121 rpSTS_L 141 123 70 255
122 rpSTS_R 255 141 185 255
123 cpSTS_L 9 62 211 255
124 cpSTS_R 114 106 229 255
125 A7r_L 255 193 229 255
126 A7r_R 70 149 229 255
127 A7c_L 255 149 255 255
128 A7c_R 44 9 18 255
129 A5l_L 193 79 44 255
130 A5l_R 255 193 132 255
131 A7pc_L 44 44 53 255
132 A7pc_R 53 220 255 255
133 A7ip_L 211 53 62 255
134 A7ip_R 141 106 141 255
135 A39c_L 106 176 149 255
136 A39c_R 35 255 202 255
137 A39rd_L 211 220 123 255
138 A39rd_R 123 53 255 255
139 A40rd_L 167 255 211 255
140 A40rd_R 18 79 114 255
141 A40c_L 9 79 62 255
142 A40c_R 246 158 255 255
143 A39rv_L 114 176 211 255
144 A39rv_R 106 62 53 255
145 A40rv_L 53 106 53 255
146 A40rv_R 220 62 185 255
147 A7m_L 255 202 70 255
148 A7m_R 62 44 79 255
149 A5m_L 246 9 132 255
150 A5m_R 185 149 202 255
151 dmPOS_L 220 18 18 255
152 dmPOS_R 176 255 246 255
153 A31_L 62 220 149 255
154 A31_R 167 202 70 255
155 A1/2/3ulhf_L 132 141 176 255
156 A1/2/3ulhf_R 88 53 185 255
157 A1/2/3tonIa_L 193 149 237 255
158 A1/2/3tonIa_R 97 114 255 255
159 A2_L 255 132 185 255
160 A2_R 185 255 97 255
161 A1/2/3tru_L 167 237 123 255
162 A1/2/3tru_R 255 246 255 255
163 G_L 255 193 79 255
164 G_R 220 106 35 255
165 vIa_L 123 255 35 255
166 vIa_R 193 255 88 255
167 dIa_L 158 185 176 255
168 dIa_R 185 70 132 255
169 vId/vIg_L 202 123 70 255
170 vId/vIg_R 176 106 202 255
171 dIg_L 79 149 62 255
172 dIg_R 255 62 141 255
173 dId_L 88 44 211 255
174 dId_R 246 79 176 255
175 A23d_L 158 141 9 255
176 A23d_R 123 123 132 255
177 A24rv_L 132 53 97 255
178 A24rv_R 106 158 106 255
179 A32p_L 149 97 106 255
180 A32p_R 106 202 88 255
181 A23v_L 211 158 158 255
182 A23v_R 158 88 149 255
183 A24cd_L 26 35 123 255
184 A24cd_R 62 9 79 255
185 A23c_L 220 193 202 255
186 A23c_R 149 62 237 255
187 A32sg_L 167 97 237 255
188 A32sg_R 97 79 44 255
189 cLinG_L 255 106 106 255
190 cLinG_R 255 246 123 255
191 rCunG_L 88 255 229 255
192 rCunG_R 211 237 255 255
193 cCunG_L 97 35 255 255
194 cCunG_R 106 9 141 255
195 rLinG_L 132 62 149 255
196 rLinG_R 106 114 79 255
197 vmPOS_L 132 255 193 255
198 vmPOS_R 158 255 132 255
199 mOccG_L 97 158 158 255
200 mOccG_R 202 255 202 255
201 V5/MT+_L 35 106 220 255
202 V5/MT+_R 35 44 255 255
203 OPC_L 220 97 88 255
204 OPC_R 114 123 185 255
205 iOccG_L 149 18 70 255
206 iOccG_R 211 202 255 255
207 msOccG_L 185 255 255 255
208 msOccG_R 255 158 141 255
209 lsOccG_L 211 149 185 255
210 lsOccG_R 44 88 255 255
211 mAmyg_L 97 35 9 255
212 mAmyg_R 123 97 193 255
213 lAmyg_L 255 176 149 255
214 lAmyg_R 132 158 62 255
215 rHipp_L 26 18 62 255
216 rHipp_R 167 211 255 255
217 cHipp_L 97 255 79 255
218 cHipp_R 246 158 62 255
219 vCa_L 255 176 211 255
220 vCa_R 62 255 141 255
221 GP_L 220 114 141 255
222 GP_R 88 53 149 255
223 NAC_L 255 114 202 255
224 NAC_R 167 132 53 255
225 vmPu_L 70 26 53 255
226 vmPu_R 70 106 88 255
227 dCa_L 229 53 106 255
228 dCa_R 26 255 26 255
229 dlPu_L 158 255 26 255
230 dlPu_R 255 70 97 255
231 mPFtha_L 158 176 106 255
232 mPFtha_R 158 220 193 255
233 mPMtha_L 106 70 114 255
234 mPMtha_R 255 132 149 255
235 Stha_L 211 246 202 255
236 Stha_R 149 44 255 255
237 rTtha_L 246 229 202 255
238 rTtha_R 149 220 70 255
239 PPtha_L 79 123 167 255
240 PPtha_R 176 246 255 255
241 Otha_L 167 158 114 255
242 Otha_R 237 70 255 255
243 cTtha_L 167 62 202 255
244 cTtha_R 246 229 158 255
245 lPFtha_L 88 237 123 255
246 lPFtha_R 114 229 237 255
247 subth_L 110 150 10 255
248 subth_R 0 150 200 255

Thanks for sending that through. I’m not sure what I’m looking at though: these two LUT look more or less identical. Both have the same number of entries, labelled identically with the same indices, and the only differences seems to relate to the RGB components, which are mostly unused anyway… (?)

I assume the last two entries correspond to the regions you’ve added (subth_L & subth_R)? But these are present in both LUTs, so I’m not sure in what sense your orig LUT is original?

Finally, when you say these nodes don’t show up in the connectome, how does this manifest? What does wc connectome.csv report (where connectome.csv is the output of your tck2connectome call)?

Finally, if you could point out exactly which regions you’ve added in your screenshots, that would be helpful – my anatomy is a bit lacking on that front… One of the issues to look out for is whether your new nodes lie in regions that streamlines can’t reach or can’t terminate in (assuming you used SIFT with a 5TT image that did not include your new regions, for example). In which case you can’t expect tck2connectome to report any connectivity for those regions – though there should still be rows & columns in the connectome matrix that correspond to these nodes. It depends on exactly what you mean when you say the new ROI is not included in the connectome.

Hopefully some of the above will point you in the right direction…
All the best,
Donald.

Hey @jdtournier,

I solved the issue.

Freesurfer has a mergeseg argument which allows you to add a new volume to an already existing segmentation, and I was able to add the segmentation to the LUT. The original LUT I was using had 246 ROIs and the new one has 248, one new ROI/ assignment for each hemi of the subthalamic nucleus.

The original LUT comes out of QSI prep (just for context and why they look a bit funny).

Thanks for your thoughts and suggestions!