Changeset 198


Ignore:
Timestamp:
Mar 5, 2012, 9:27:52 AM (7 years ago)
Author:
tjniskan
Message:
  • Added Front/Back? option for unfolding data.
  • ROIs are now unfolded as well.

M aedes.m
M aedes_revision.m

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • aedes.m

    r191 r198  
    1033910339function l_UnfoldData(h,evd)
    1034010340try
    10341 %% Do not allow unfolding if ROIs exist
    10342 if ~isempty(ROI)
    10343   hh=warndlg(['Data cannot be unfolded while ROIs exist.',...
    10344              ' Please, remove all ROIs and try again.'],...
    10345              'Cannot unfold data','modal');
    10346   return
    10347 end
    1034810341
    1034910342%% Ask for confirmation
    10350 resp=questdlg({'Choose unfolding direction:','',...
    10351  ['Left/Right (current Y-position = ',num2str(Dat.Slices(2)),')'],...
    10352  'or',...
    10353  ['Up/Down (current Z-position = ',num2str(Dat.Slices(3)),')']},...
    10354               'Choose direction',...
    10355               'Left/Right','Up/Down','Cancel','Left/Right');
     10343if Dat.isDataMixed
     10344        resp=questdlg({'Choose unfolding direction:','',...
     10345                ['Left/Right (current Y-position = ',num2str(Dat.Slices(2)),')'],...
     10346                'or',...
     10347                ['Up/Down (current Z-position = ',num2str(Dat.Slices(3)),')']},...
     10348                'Choose direction',...
     10349                'Left/Right','Up/Down','Cancel','Left/Right');
     10350else
     10351        resp=questdlg({'Choose unfolding direction:','',...
     10352                ['Left/Right (current Y-position = ',num2str(Dat.Slices(2)),')'],...
     10353                '',...
     10354                ['Up/Down (current Z-position = ',num2str(Dat.Slices(3)),')'],...
     10355                '',...
     10356                ['Front/Back (current X-position = ',num2str(Dat.Slices(1)),')'],...
     10357                '','To cancel: close the dialog.',''},...
     10358                'Choose direction',...
     10359                'Left/Right','Up/Down','Front/Back','Left/Right');
     10360end
    1035610361if isempty(resp) || strcmpi(resp,'Cancel')
    1035710362  return
    1035810363elseif strcmpi(resp,'Left/Right')
    10359   FoldInd = [0 -Dat.Slices(2)];
     10364        if Dat.isDataMixed
     10365                FoldInd = [0 -Dat.Slices(2)];
     10366        else
     10367                FoldInd = [0 -Dat.Slices(2) 0];
     10368        end
    1036010369elseif strcmpi(resp,'Up/Down')
    10361   FoldInd = [-Dat.Slices(3) 0];
     10370        if Dat.isDataMixed
     10371                FoldInd = [-Dat.Slices(3) 0];
     10372        else
     10373                FoldInd = [-Dat.Slices(3) 0 0];
     10374        end
     10375elseif strcmpi(resp,'Front/Back')
     10376        FoldInd = [0 0 -Dat.Slices(1)];
    1036210377end
    1036310378
     
    1037110386end
    1037210387
     10388% Unfold ROI(s)
     10389if ~isempty(ROI)
     10390        for kk = 1:length(ROI)
     10391                if Dat.isDataMixed
     10392                        for ii=1:Dat.DataL
     10393                                ROI(kk).voxels{ii} = circshift(ROI(kk).voxels{ii},FoldInd);
     10394                        end
     10395                else
     10396                        ROI(kk).voxels{1} = circshift(ROI(kk).voxels{1},FoldInd);
     10397                end
     10398        end
     10399end
     10400
     10401
    1037310402% Refresh data
    1037410403l_DisplayData([],[])
     10404
     10405% Refresh ROIs
     10406l_RefreshRoi([],[])
     10407
    1037510408
    1037610409catch
  • aedes_revision.m

    r197 r198  
    9393% bash-script every time it is called so that this file "aedes_revision.m" is
    9494% always in the list of committed files. DO NOT EDIT THE NEXT LINE!!!
    95 % - SVN Hook -
     95% - Svn Hook -
Note: See TracChangeset for help on using the changeset viewer.

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