Changeset 129 for aedes.m


Ignore:
Timestamp:
Jun 10, 2010, 9:13:47 AM (9 years ago)
Author:
tjniskan
Message:
  • Added plugin for correlation mapping with filtering/other options
  • Added flipping of 3D ROIs in aedes.m
  • Added possibility of changing ROI color (in the ROI -uimenu)
  • Minor fixes/changes here and there...

M misclib/fmri_spm_volumes.m
M misclib/fmri_filter.m
M aedes_fitmaps.m
M aedes.m
M plugins/save_roi_as_mask.m
M plugins/calc_asl_cbf.m
A plugins/fmri_plugins/correlation_mapping.m
M plugins/fmri_plugins/resting_state_fc.m
M plugins/map_plugins/t1_inversion_recovery.m
M aedes_revision.m

File:
1 edited

Legend:

Unmodified
Added
Removed
  • aedes.m

    r126 r129  
    635635                       'checked','off',...
    636636                       'enable','off');
     637H.UIROISETCOLOR = uimenu(roi_tools_h,'Label','Set current ROI color',...
     638                       'callback',@l_RoiSetColor,...
     639                       'separator','off',...
     640                       'checked','off',...
     641                       'enable','off');                     
    637642
    638643H.UIROITOOLS_UNDO = uimenu(roi_tools_h,'Label','Undo draw (0)',...
     
    19661971                    H.UIROISHOWEDGES,...
    19671972                    H.UIROIRENAME,...
     1973                    H.UIROISETCOLOR,...
    19681974                    H.UIPUSH_STATS_ROI];
    19691975
     
    89738979end
    89748980
    8975 if ~Dat.isDataMixed
    8976   h=warndlg(['Volume ROI(s) cannot be flipped. Sorry...'],...
    8977             'Cannot flip ROIs','modal');
    8978   return
    8979 end
    89808981
    89818982% Get current ROI
     
    89848985% Add current ROI to undo buffer
    89858986l_RoiUndoBuffer('add_indices',currentRoi,[]);
    8986 
     8987 
    89878988% Loop over slices
    8988 for ii=1:length(ROI(currentRoi).voxels)
    8989   if strcmpi(opt,'flipud')
    8990         % FlipUD current ROI
    8991         ROI(currentRoi).voxels{ii} = flipud(ROI(currentRoi).voxels{ii});
    8992   elseif strcmpi(opt,'fliplr')
    8993         % FlipLR current ROI
    8994         ROI(currentRoi).voxels{ii} = fliplr(ROI(currentRoi).voxels{ii});
     8989if Dat.isDataMixed
     8990 
     8991  % Add current ROI to undo buffer
     8992  l_RoiUndoBuffer('add_indices',currentRoi,[]);
     8993 
     8994  for ii=1:length(ROI(currentRoi).voxels)
     8995    if strcmpi(opt,'flipud')
     8996      % FlipUD current ROI
     8997      ROI(currentRoi).voxels{ii} = flipud(ROI(currentRoi).voxels{ii});
     8998    elseif strcmpi(opt,'fliplr')
     8999      % FlipLR current ROI
     9000      ROI(currentRoi).voxels{ii} = fliplr(ROI(currentRoi).voxels{ii});
     9001    end
     9002  end
     9003else
     9004 
     9005  % Prompt for flip direction
     9006  if Dat.AxView==0
     9007    resp = questdlg('Select fliping plane', ...
     9008      'Flipping plane?', ...
     9009      'X', 'Y', 'Z', 'X');
     9010    if isempty(resp)
     9011      % Cancelled
     9012      return
     9013    end
     9014    FlipPlane = resp;
     9015  elseif Dat.AxView==1
     9016    if strcmpi(opt,'flipud')
     9017      FlipPlane='Y';
     9018    elseif strcmpi(opt,'fliplr')
     9019      FlipPlane='X';
     9020    end
     9021  elseif Dat.AxView==2
     9022    FlipPlane='Y';
     9023  else
     9024    FlipPlane='Z';
     9025  end
     9026 
     9027  if FlipPlane=='X'
     9028    if strcmpi(opt,'flipud')
     9029      ROI(currentRoi).voxels{1} = flipdim(ROI(currentRoi).voxels{1},1);
     9030    elseif strcmpi(opt,'fliplr')
     9031      ROI(currentRoi).voxels{1} = flipdim(ROI(currentRoi).voxels{1},2);
     9032    end
     9033  elseif FlipPlane=='Y'
     9034    if strcmpi(opt,'flipud')
     9035      ROI(currentRoi).voxels{1} = flipdim(ROI(currentRoi).voxels{1},1);
     9036    elseif strcmpi(opt,'fliplr')
     9037      ROI(currentRoi).voxels{1} = flipdim(ROI(currentRoi).voxels{1},3);
     9038    end
     9039  else
     9040    if strcmpi(opt,'flipud')
     9041      ROI(currentRoi).voxels{1} = flipdim(ROI(currentRoi).voxels{1},2);
     9042    elseif strcmpi(opt,'fliplr')
     9043      ROI(currentRoi).voxels{1} = flipdim(ROI(currentRoi).voxels{1},3);
     9044    end
    89959045  end
    89969046end
     
    93579407end
    93589408end % function l_ShowRoiEdges(h,
     9409
     9410%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     9411%%
     9412%% Set ROI color
     9413%%
     9414%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     9415  function l_RoiSetColor(h,evd)
     9416    try
     9417      if isempty(ROI)
     9418        return
     9419      end
     9420     
     9421      roi_ind = get(H.ROI_EDIT,'value');
     9422      str = get(H.ROI_EDIT,'string');
     9423      str = str{roi_ind};
     9424      old_color = ROI(roi_ind).color./255;
     9425     
     9426      % Prompt for color
     9427      C=uisetcolor(old_color,['ROI: ',str]);
     9428     
     9429      % Set the new color
     9430      ROI(roi_ind).color = round(C*255);
     9431     
     9432      % Redraw ROIs
     9433      l_RefreshRoi;
     9434    catch
     9435      aedes_errordump(lasterror);
     9436    end
     9437  end
    93599438
    93609439%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracChangeset for help on using the changeset viewer.

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