DSI Studio is able to export ODF data for further processing and visualization. To visualize ODF, you need a .fib file with ODF data exported. To
know how to export ODF in a .fib file, please refer to the reconstruction document. You may need to check the "record ODF" box to enable the ODF output. Load the .fib in DSI Studio. The ODF panel is now ready to present the ODFs. The ODFs will be presented along the slice, and you can switch rendering option in the window to the right. There are several important notes you may need to know to visualize ODF using Matlab. 1) A FIB file with ODF exported is needed to visualize the ODFs. To know how to export ODF in a FIB file, please refer to the reconstruction document. 2) Extract the ".fib.gz" file to ".fib" file and rename it as a ".mat" file. This mat file is ready to be loaded in Matlab by double click or using the "load" command. 3) The sampling directions of an ODF is stored in the "odf_vertices" matrix. To learn more about the meaning of each matrix in the .fib file, please refer to the "data exchange between DSI Studio and Matlab" page. 4) Since ODF values is symmetric regarding the origin, we need only to record the non-redundant part. Thus, an ODF with 642 sampling directions can be represented using a vector with a dimension of 321. The elements of this ODF vector are scalar values. For example, if an ODF is isotropic, then its representing vector is [1,1,1,1,...., 1]. 5) The surface potins of an ODF can be calculated by
multiplying the ODF vector with "odf_vertices". 6) The odfs matrix stores ALL ODFs. It is a concatenation of all ODF vectors obtained from voxels in the brain mask. Thus, you may found out the dimension of this odfs matrix is N-by-321, where N is the total number of voxels in the mask, and 321 is the half of the sampling directions. 7) If you want to visualize a voxel at a specific cooredinate, say, (x,y,z), you may need to obtain the ODF vector first using the following codes. Accessing the ODF at coordinate x,y,z function odf=get_odf_at(odfs,fa0,dimension,x,y,z)% the odfs, fa, and dimension matrixs are stored in fib file% to load fib file in matlab, extract it and rename it as a .mat filenon_zero_index = find(fa0(:) > 0.00);odf_full=zeros(1,prod(dimension));odf_full(:,non_zero_index) = 1:length(non_zero_index);odf_full = reshape(odf_full(:),1,dimension(1),dimension(2),dimension(3));% 321 is for odf order of 8. If the order is 6, use 181 odfs = reshape(odfs,321,length(odfs)/321);odf = odfs(:,odf_full(:,x,y,z));end3D presentation of the ODFs in Matlab
|

