Load atlas and Freesurfer ROIs in command line

261 views
Skip to first unread message

sandrah...@gmail.com

unread,
Jan 24, 2019, 5:37:35 PM1/24/19
to DSI Studio
Hi,

Thank you for developing such a great tool. I greatly appreciate how user-friendly and interactive it is. 

I have a question about what the best method is to load ROIs in subject space as well as from a (mni) atlas to perform tractography using the command line. 

I'm performing ROI 2 ROI tractography. I'm using ROIs from each subject's Freesurfer segmentation as well as from the atlases in DSI studio. Freesurfer ROIs were converted to nii using other software. The fib file is reconstructed using the T1 from Freesurfer (mgz converted to nii). In the GUI this is giving great results and tractography is fast, but in the command line DSI studio crashes or gets stuck during tracking.

I've tried the following:
- In the GUI, I'm using Region>Load from atlas to use the atlas ROIs and I use Region>Open region to load my Freesurfer ROIs. 
- To do the same in the command line, I'm using (for instance) --roi=JHU-WhiteMatter-labels-1mm:Posterior_limb_of_internal_capsule_L and to load a Freesurfer segmented ROI I use the complete path to the ROI of my participant. 
See also complete command below my message. 

I've noticed that it doesn't crash when I remove the --t1t2 line. However, it still doesn't finish tracking and seems stuck in the command line. For one participant it eventually did finish tracking after one night. In the GUI it finishes tracking in a few minutes. 

I've included the seed count in the command line to prevent it getting stuck trying to find fibers, however it doesn't seem to help. I have also tried to use the parameter_id from the GUI, but the same happens. If I only use ROIs from the atlas tractography runs fine and fast as well. It only seems to happen when I include or try to load my Freesurfer ROIs in the command line. However, my Freesurfer ROIs are better aligned with the data so I would like to use the ROIs from Freesurfer as well.

So long story short, my question is: what is the best way (if any) to load regions from an (mni) atlas as well as load regions in subject space from the command line. Is that possible in the command line or only from the GUI?

Best,
Sandra

dsi_studio \
--action=trk \
--source=T1_fs_QBI.fib.gz \
--method=0 \
--fa_threshold=0 \
--turning_angle=90 \
--step_size=0 \
--smoothing=1 \
--min_length=20 \
--max_length=80 \
--tracking_method=0 \
--initial dir=0 \
--interpolation=0 \
--seed_plan=0 \
--default_otsu=0.6 \
--tip_iteration=1 \
--fiber_count=20000 \
--seed_count=50000000 \
--thread_count=12 \ (I have 12 cores)
--end=path/to/my/freesurfer/thalamus/roi.nii \
--roi=JHU-WhiteMatter-labels-1mm:Posterior_limb_of_internal_capsule_L \
--seed=Motor_atlas_mni_Sandra:Motor_4 \
--t1t2=/path/to/T1_fs.nii \
--output=L_Motor_Thalamus_fs.trk.gz 

Fang-Cheng Yeh

unread,
Jan 25, 2019, 12:32:35 AM1/25/19
to dsi-s...@googlegroups.com
Hi,

I recently fixed a bug in the command line that may cause a
problem with --t1t2. Could you try updating DSI Studio and see if it
works for you?

If the problem persists, I will fix it as soon as possible.

Best regards,
Frank
> --
> You received this message because you are subscribed to the Google Groups "DSI Studio" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dsi-studio+...@googlegroups.com.
> To post to this group, send email to dsi-s...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

sandrah...@gmail.com

unread,
Jan 25, 2019, 11:36:41 AM1/25/19
to DSI Studio
Hi Frank,

Thank you for you fast reply! I've updated DSI Studio and so far I have not encountered an error or a crash. It's still running the tractography, so I'm not sure whether it is stuck or tracking. 
Perhaps it would be possible to add a feature in the command line that displays the number of tracts it has found so far to check on its progress?

Sandra

Fang-Cheng Yeh

unread,
Jan 25, 2019, 4:26:54 PM1/25/19
to dsi-s...@googlegroups.com
I will explore the way to implement this feature, but may not be
available in the near future.

Do you mind posting the immediate screen output of the command?

It may help give a hint of where the problem is.

sandrah...@gmail.com

unread,
Jan 25, 2019, 5:02:19 PM1/25/19
to DSI Studio
It just finished tracking and the resulting fiber track is the same as using the GUI. It still took longer than using the GUI, but it finished tracking successfully so the update worked! 

I have attached a screenshot of the screen output, but it seems to be solved now :)

Sandra
Screen Shot 2019-01-25 at 5.01.42 PM.png

Fang-Cheng Yeh

unread,
Jan 25, 2019, 5:34:46 PM1/25/19
to dsi-s...@googlegroups.com
Glad to know it works out!
Frank

Fang-Cheng Yeh

unread,
Jan 25, 2019, 5:39:46 PM1/25/19
to dsi-s...@googlegroups.com
It seems that you are using track count as the goal and it will always
give you 20,000 tracks. You may need to check if the tracks are the
same as the GUI.

Another tip here is checking whether the parameter id is the same. If
not, assign the parameter id you get from GUI to make sure all
parameters are correct.

Thirds, I would recommend GQI over QBI as the reconstruction method.
GQI +deterministic fiber tracking got good accuracy in a recent paper
(Maier-Hein et al, 2017).

sandrah...@gmail.com

unread,
Jan 29, 2019, 2:16:57 PM1/29/19
to DSI Studio
Hi Frank,

Thank you so much for your tips. It is greatly appreciated. I have read about GQI and reconstructed the data now using it. After tractography, I will compare my tracts side by side for a comparison between reconstructions. I've also checked the parameter ID. 

I'm running different options currently for tract count and seed count. I had initially chosen --fiber_count 20,000 because it could reach it in most participants using QBI (on average 13000 tracts) and I wanted to keep it consistent between participants. Using --seed_count=50000000 using GQI gives varying results between participants (ranging from 10 till 47.000). What would be recommended for ROI 2 ROI tractography (for instance for the CST) in regards to seed count and fiber count?

Sandra

Fang-Cheng Yeh

unread,
Jan 29, 2019, 8:19:15 PM1/29/19
to dsi-s...@googlegroups.com
Hi Sandra,

There is essentially no correct answer to your question, but my
experience is that the count should be at least 10K. The 50M count you
used is also good as long as your computer can handle it.

Best regards,
Frank

sandrah...@gmail.com

unread,
Jan 31, 2019, 2:08:55 PM1/31/19
to DSI Studio
Yes, that was also what I was thinking. Thank you for sharing your thoughts on it, good to hear. I'll continue with the count as I had. 

Many thanks,
Sandra
Reply all
Reply to author
Forward
0 new messages