Changeset 120 for aedes_rot3d.m


Ignore:
Timestamp:
Apr 14, 2010, 5:03:43 PM (9 years ago)
Author:
tjniskan
Message:
  • Fixed an indexing bug in aedes_readfid when reading multireceiver

EPI data

  • Added EPIPhasedArrayData -property to aedes_readfid for manually

getting the data from individual coils from multireceiver EPI data

  • Fixed aedes_rot3d to work with n-D arrays
  • Added 18 new ROI colors and removed the ROI number limitation

M aedes_rot3d.m
M aedes.m
M aedes_readfid.m
M aedes_revision.m

File:
1 edited

Legend:

Unmodified
Added
Removed
  • aedes_rot3d.m

    r80 r120  
    3535end
    3636
    37 if ndims(A)>4 || ~( isnumeric(A) || islogical(A) )
     37if ~( isnumeric(A) || islogical(A) )
    3838  error('First input argument must be a numerical 3D (or 4D)-matrix!')
    3939end
     
    4343end
    4444
     45dim_inds = 1:ndims(A);
     46
    4547switch dim
    4648  case 1
     49    dim_inds(1:3)=dim_inds(3:-1:1);
    4750        if k==1 % Rotate 90 degrees along dim 1 (rows)
    48           B = flipdim(permute(A,[3 2 1 4]),1);
     51          B = flipdim(permute(A,dim_inds),1);
    4952        elseif k==2 % Rotate 180 degrees along dim 1 (rows)
    5053          B = flipdim(flipdim(A,3),1);
    5154    elseif k==3 % Rotate 270 degrees along dim 1 (rows)
    52           B = flipdim(permute(A,[3 2 1 4]),3);
     55          B = flipdim(permute(A,dim_inds),3);
    5356        elseif k==0 || k==4
    5457          B=A;
    5558        end
    5659  case 2
     60    dim_inds(2:3)=dim_inds(3:-1:2);
    5761        if k==1 % Rotate 90 degrees along dim 2 (cols)
    58       B = flipdim(permute(A,[1 3 2 4]),3);
     62      B = flipdim(permute(A,dim_inds),3);
    5963    elseif k==2 % Rotate 180 degrees along dim 2 (cols)
    6064      B = flipdim(flipdim(A,3),2);
    6165    elseif k==3 % Rotate 270 degrees along dim 2 (cols)
    62       B = flipdim(permute(A,[1 3 2 4]),2);
     66      B = flipdim(permute(A,dim_inds),2);
    6367    elseif k==0 || k==4
    6468      B=A;
    6569        end
    6670  case 3
     71    dim_inds(1:2)=dim_inds(2:-1:1);
    6772    if k==1 % Rotate 90 degrees along dim 3
    68       B = flipdim(permute(A,[2 1 3 4]),1);
     73      B = flipdim(permute(A,dim_inds),1);
    6974    elseif k==2 % Rotate 180 degrees along dim 3
    7075      B = flipdim(flipdim(A,2),1);
    7176    elseif k==3 % Rotate 270 degrees along dim 3
    72       B = flipdim(permute(A,[2 1 3 4]),2);
     77      B = flipdim(permute(A,dim_inds),2);
    7378    elseif k==0 || k==4
    7479      B=A;
Note: See TracChangeset for help on using the changeset viewer.

Powered by Trac 1.0.9.Copyright © Juha-Pekka Niskanen 2008