Binarizing cleaned and clipped streamlines

103 views
Skip to first unread message

Qi Yang

unread,
Jan 16, 2020, 12:12:38 PM1/16/20
to Automated Fiber Quantification (AFQ)

Hello,

I want to create a binarized mask of each of the reconstructed pathways. How would you create this as a .mat matrix with the same size and field of view as my original dataset (or as a NIFTI file), with 1's where streamlines exists, and 0's elsewhere? I can see that the pathway is stored as a structure with "fibers" as a variable that appear to be in world-space coordinates (units of mm), but am unsure how to binarize! 

Also, we want to do this both for the full fiber profile (in the AFQ_Example.m this is stored as uf_clean for example, or all fibers are stored in the variable fg_clean) AND we also want to be able to do this for the "clipped" fibers, although we are unsure of how these are stored (but can see that this operation happens somewhere in AFQ_COmputeTractProperties.m)

Thank you!
Qi

Jason Yeatman

unread,
Jan 16, 2020, 5:10:33 PM1/16/20
to automated-fiber-q...@googlegroups.com
the vistasoft function 
dtiComputeFiberDensityNoGUI
will do what you want

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantif...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/automated-fiber-quantification-afq/bd04bd11-f797-45a3-a6da-da2823288faa%40googlegroups.com.

Qi Yang

unread,
Jan 16, 2020, 11:13:52 PM1/16/20
to Automated Fiber Quantification (AFQ)
Thanks! It works very well. 

Best,
Qi

On Thursday, January 16, 2020 at 4:10:33 PM UTC-6, Jason wrote:
the vistasoft function 
dtiComputeFiberDensityNoGUI
will do what you want

On Thu, Jan 16, 2020 at 9:12 AM Qi Yang <qiyan...@gmail.com> wrote:

Hello,

I want to create a binarized mask of each of the reconstructed pathways. How would you create this as a .mat matrix with the same size and field of view as my original dataset (or as a NIFTI file), with 1's where streamlines exists, and 0's elsewhere? I can see that the pathway is stored as a structure with "fibers" as a variable that appear to be in world-space coordinates (units of mm), but am unsure how to binarize! 

Also, we want to do this both for the full fiber profile (in the AFQ_Example.m this is stored as uf_clean for example, or all fibers are stored in the variable fg_clean) AND we also want to be able to do this for the "clipped" fibers, although we are unsure of how these are stored (but can see that this operation happens somewhere in AFQ_COmputeTractProperties.m)

Thank you!
Qi

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantification-afq+unsub...@googlegroups.com.
Message has been deleted

Jason Yeatman

unread,
Jan 17, 2020, 3:48:01 PM1/17/20
to automated-fiber-q...@googlegroups.com
The clipped fibers aren’t saved

But you can use the clip to rois function to clip and save them

On Fri, Jan 17, 2020 at 12:37 PM Qi Yang <qiyan...@gmail.com> wrote:
Hi Jason, 

I am very glad and happy to what you mention the function of visualizing the volume. But I still have a ittle question. As I mentioned, I am also interested in getting clipped version of fibers. But how should I get the ROI areas from corresponding scan ? I think the examples AFQ provided already have the ROI to clip. For our own data, we don't have such a folder. Do you know which funtion can help us to calculate the ROI of each fiber ?

Thanks,
Qi

On Thursday, January 16, 2020 at 4:10:33 PM UTC-6, Jason wrote:
--
Sent from a mobile device. Please excuse typos
Message has been deleted
Message has been deleted

Qi Yang

unread,
Jan 28, 2020, 4:37:21 PM1/28/20
to Automated Fiber Quantification (AFQ)
Hi Jason, 

Thanks for your help! Currently, I am processing HCP database. I already pre-aligned T1 image to ac-pc space. And then I can run the whole dtiInit preprocess. Also, I can track the whole brain tracography. The visualization image is the attached file. However, when I call function  AFQ_SegmentFiberGroups. There is 14 of 20 empty. I have been trying it for such a long time. But I still cannot get a useful solution. So I am not sure do you have some ideas about that ?

Thanks,
Qi



On Friday, January 17, 2020 at 2:48:01 PM UTC-6, Jason wrote:
The clipped fibers aren’t saved

But you can use the clip to rois function to clip and save them
On Fri, Jan 17, 2020 at 12:37 PM Qi Yang <qiyan...@gmail.com> wrote:
Hi Jason, 

I am very glad and happy to what you mention the function of visualizing the volume. But I still have a ittle question. As I mentioned, I am also interested in getting clipped version of fibers. But how should I get the ROI areas from corresponding scan ? I think the examples AFQ provided already have the ROI to clip. For our own data, we don't have such a folder. Do you know which funtion can help us to calculate the ROI of each fiber ?

Thanks,
Qi

On Thursday, January 16, 2020 at 4:10:33 PM UTC-6, Jason wrote:
the vistasoft function 
dtiComputeFiberDensityNoGUI
will do what you want

On Thu, Jan 16, 2020 at 9:12 AM Qi Yang <qiyan...@gmail.com> wrote:

Hello,

I want to create a binarized mask of each of the reconstructed pathways. How would you create this as a .mat matrix with the same size and field of view as my original dataset (or as a NIFTI file), with 1's where streamlines exists, and 0's elsewhere? I can see that the pathway is stored as a structure with "fibers" as a variable that appear to be in world-space coordinates (units of mm), but am unsure how to binarize! 

Also, we want to do this both for the full fiber profile (in the AFQ_Example.m this is stored as uf_clean for example, or all fibers are stored in the variable fg_clean) AND we also want to be able to do this for the "clipped" fibers, although we are unsure of how these are stored (but can see that this operation happens somewhere in AFQ_COmputeTractProperties.m)

Thank you!
Qi

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantification-afq+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantification-afq+unsub...@googlegroups.com.
HCP_Fiber_Visualize_acpc.png

Jason Yeatman

unread,
Jan 28, 2020, 6:44:20 PM1/28/20
to automated-fiber-q...@googlegroups.com
Check if the ROIs end up in the right place

Also track some fiber groups manually using the dtiFiberUI interface to make sure there isn’t a flip in the gradient directions

To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantif...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantif...@googlegroups.com.
--
Sent from a mobile device. Please excuse typos

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantif...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/automated-fiber-quantification-afq/b442ae9e-f3ce-4755-8490-647d82a98ee6%40googlegroups.com.

Qi Yang

unread,
Feb 3, 2020, 4:06:57 PM2/3/20
to Automated Fiber Quantification (AFQ)
Hi Jason, 

Yes, it works. The gradient is flipped. Thanks for your effort. But I'd like to ask have your guys tried AFQ on BLSA dataset. I already try the ac-pc alignment. But the it doesn't bring improvement to final results. There are still so many empty fiber results. For now, I think that it might be caused by strict ROI constraint in AFQ_SegmentFiberGroups and hard to get real whole brain tractography.  I am not sure do you have some ideas about that ?

Thanks,
Qi 
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantification-afq+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantification-afq+unsub...@googlegroups.com.
--
Sent from a mobile device. Please excuse typos

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantification-afq+unsub...@googlegroups.com.

Jason Yeatman

unread,
Feb 4, 2020, 12:31:00 PM2/4/20
to automated-fiber-q...@googlegroups.com
I haven't seen AFQ fail like that for any data unless there is an issue with how the data was processed or aligned. The ROIs are huge, covering (in some cases) almost a full coronal plane. .They can be off by 2-3cm and the segmentation is still okay. This even works in newborn infants. I don't know that dataset but I suspect it is a separate issue

To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantif...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantif...@googlegroups.com.
--
Sent from a mobile device. Please excuse typos

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantif...@googlegroups.com.
--
Sent from a mobile device. Please excuse typos

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantif...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/automated-fiber-quantification-afq/e8a57e9a-ee9e-4fb2-acdc-4a64335d2550%40googlegroups.com.
Message has been deleted
Message has been deleted

Qi Yang

unread,
Feb 13, 2020, 2:37:42 PM2/13/20
to Automated Fiber Quantification (AFQ)
Hi Jason

I apologize for asking so many questions!

We are trying to get pathway labels as binary masks in either native diffusion space or native T1 space. We are close to accomplishing this, but have run into a problem with several subjects.

Attached is a picture of the b0 and T1, and after alignment b0 and T1 where the transformed b0 has now been cut at where the original field of view of the image existed in world space. We found that by manually doing AC/PC alignment of the T1 we can occasionally solve this issue. However, we aim to run this on 4000+ subjects and manual alignment is not feasible! Is there an alternative that could solve this problem? Either an automated alignment, or ideally a way where the new field of view is determined by the T1 space?
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantification-afq+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantification-afq+unsub...@googlegroups.com.
--
Sent from a mobile device. Please excuse typos

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantification-afq+unsub...@googlegroups.com.
--
Sent from a mobile device. Please excuse typos

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantification-afq+unsub...@googlegroups.com.
after_align.png
before_align.png

Jason Yeatman

unread,
Feb 13, 2020, 2:48:49 PM2/13/20
to automated-fiber-q...@googlegroups.com
Yes there are many automated alignment tools that would probably work fine. Also many image processing toolboxes that will resize images etc

AFQ adheres to nifti conventions so fine to use another toolbox to do whatever you like before afq

To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantif...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantif...@googlegroups.com.
--
Sent from a mobile device. Please excuse typos

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantif...@googlegroups.com.
--
Sent from a mobile device. Please excuse typos

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantif...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantif...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/automated-fiber-quantification-afq/92b6fa05-4c83-4296-9c55-0c8e8fcfa459%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages