Print

Print


Dear Pravesh

Den 13. dec. 2016 kl. 02.02 skrev Pravesh Parekh <[log in to unmask]>:

Dear All,

This is a pretty much 101 question but I would really be grateful for any help on the same:

Let's say I want to see my structural data in all three views using MATLAB. I do the following:

image_file = spm_vol(filename);
image_file_data = spm_read_vols(image_file);
​% ​To visualize axial slice:
imagesc(squeeze(image_file_data(:, :, slice_number));  % squeeze not really needed 
​% ​To visualize coronal slice:
imagesc(squeeze(image_file_data(:, slice_number, :));
​% ​To visualize sagital slice:
imagesc(squeeze(image_file_data(slice_number, :, :));

To correctly view the images, I have found the following solutions:

1. Use flipud on the squeezed transposed matrix

2. Use rot90 on the squeezed matrix

3. To transpose the matrix and set the YDir property to be "normal"

My questions are:
1) is there a ubiquitous/preferred way of displaying the images correctly?

My preferred way is to display them in world space, so that the orientation used during acquisition does not affect the way the images are displayed, and you can easily display e.g. axial EPI images on top of sagittal structural images. You can get the XYZmm coordinate of each voxel in the image by writing

[image_file_data XYZmm]= spm_read_vols(image_file);

Now comes the challenge of displaying every image value in a world space XYZmm plane which you define. To to this you would either have to program on your own, or use the spm_check_registration and spm_orthviews functions which are very capable. For a quick guide on how to use these functions see my previous post https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=ind1611&L=SPM&P=R102819&I=-3&d=No+Match%3BMatch%3BMatches 


Best
Torben