AFQ_RenderFibers Issues?

165 views
Skip to first unread message

Jamie Hanson

unread,
May 12, 2013, 11:44:19 PM5/12/13
to automated-fiber-q...@googlegroups.com

HI AFQ Folks,

I was just starting to test drive AFQ and was having some issues with AFQ_RenderFibers (which may be indicative of some other larger issues). 

I was using matlab-R2010a and when I did whole brain tractography with 'test' settings (just to see look at my 48 direction DTI data acquired at UW-Madison), visualizing fibers was taking an incredibly long time. I initially set the numfibers at 1000 but no display window popped up (after waiting sometime 20-30 minutes). When I put the numfibers lower (to 100), I get an odd output (screenshot attached). 

Any thoughts on what I might be doing wrong? 
I can send over my dt6.mat or other files if that helps for diagnostic purposes. 
Thanks much!

Best,
jamie.


--
Jamie L. Hanson
Waisman Laboratory for Brain Imaging & Behavior | Child Emotion Research Lab
University of Wisconsin - Madison
1500 Highland Avenue
Madison, WI 53705
Email: jamiela...@gmail.com
Homepage: http://brainimaging.waisman.wisc.edu/~hanson/

Screenshot-Figure 1.png

Jason Yeatman

unread,
May 13, 2013, 12:47:58 AM5/13/13
to automated-fiber-q...@googlegroups.com
Hi Jamie,

I should put some of this explicitly in the documentation. 3D graphics through MATLAB is extremely slow. Hence rendering a huge fiber group will not work. This is actually an issue that I am really hoping mathworks will adress (maybe user emails will prompt them). Hence it is not surprising that you are having a problem rendering the full brain. However rendering smaller groups should not be a problem. Typically I render 100 to 500 fibers as this is plenty to get a nice view of the group and it is not too slow. For example:

AFQ_RenderFibers(fg, 'numfibers',100)

It looks like in your rendering only 1 fiber is being rendered. I have never seen this issue before. What is your call to AFQ_RenderFibers? Have you been able to run it on the practice data that is distributed with AFQ? For example try out the begining of this tutorial. This will give me an idea if it is something wrong with a) the data or b) how the code interacts with your local matlab setup. Either way it should be a straightforward problem to fix and once we figure it out I will make sure to document the issue for other users. I have run AFQ on matlab 2010a on both linux and mac so I doubt that would be the issue.

Best,

Jason


--
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 post to this group, send email to automated-fiber-q...@googlegroups.com.
Visit this group at http://groups.google.com/group/automated-fiber-quantification-afq?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jamie Hanson

unread,
May 13, 2013, 1:10:01 AM5/13/13
to automated-fiber-q...@googlegroups.com
Hi Jason-

Silly me for not trying the demo first... I also get a similar wacky result (perhaps speaking to something off with my local matlab). A result from the first few steps in AFQ_example.m is attached. Here is what went into my matlab to produce this. (note the matlab error, but i thought that wasn't a big issue?).

=============

>> [AFQbase AFQdata AFQfunc AFQutil AFQdoc AFQgui] = AFQ_directories;
>> sub_dir = fullfile(AFQdata, 'control_01', 'dti30');
>> dt = dtiLoadDt6(fullfile(sub_dir,'dt6.mat'));
>> wholebrainFG = AFQ_WholebrainTractography(dt,'test');

scale=[2.0,2.0,2.0]mm, track=1, interp=1, step=1.0mm, fa=0.20, angle=30.0deg, puncture=0.20, minLength=50.0mm, maxLength=250.0mm
Tracking 124442 fibers (1556 fibers per tick):
................................................................................
32704 fibers passed length threshold of 50.0 (out of 124442 seeds).
Elapsed time is 79.600158 seconds.
32704 fibers, mean length 94mm (max 251mm; min 50mm).
>> AFQ_RenderFibers(wholebrainFG, 'numfibers',200, 'color', [1 .6 .2]);
Warning: Could not find an exact (case-sensitive) match for 'randsample'.
/home/hanson/vistasoft/external/pyrTools/RandSample.m is a case-insensitive match and will
be used instead.
You can improve the performance of your code by using exact
name matches and we therefore recommend that you update your
usage accordingly. Alternatively, you can disable this warning using
warning('off','MATLAB:dispatcher:InexactCaseMatch').
This warning will become an error in future releases.
> In AFQ_RenderFibers at 288

mesh can be rotated with arrow keys

=========

Thoughts on where I might have gone awry?  (Non-suppressed Matlab output also attached as a txt file). Thanks much for the help!

Best,

--
You received this message because you are subscribed to a topic in the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/automated-fiber-quantification-afq/Ys1vVCixC50/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to automated-fiber-quantif...@googlegroups.com.
Full_Matlab_Out.txt
AFQ_Test.png

Jason Yeatman

unread,
May 13, 2013, 1:41:19 AM5/13/13
to automated-fiber-q...@googlegroups.com
Ok this was very helpful. My guess is that there are multiple versions of the function randsample drifting around out there. This prompted me to get rid of that code as the function I was relying on was from the stats toolbox which not everyone has and costs extra money anyway. Will you try replacting line 302 of AFQ_RenderFibers with:

fibindx = ceil(rand(numfib,1).*length(fg.fibers));

This should retain the same functionality and not rely on the stats toolbox. It worked for my test cases and if it works for you then I will check the change into the master repository.

Jamie Hanson

unread,
May 13, 2013, 2:47:29 AM5/13/13
to automated-fiber-q...@googlegroups.com
That seems to do the trick! 
Thanks much!
Figure1.png

Jason Yeatman

unread,
May 13, 2013, 2:49:48 AM5/13/13
to automated-fiber-q...@googlegroups.com
Great. I'll check it into the master
Reply all
Reply to author
Forward
0 new messages