Changeset 148


Ignore:
Timestamp:
Nov 3, 2010, 4:04:07 PM (7 years ago)
Author:
tjniskan
Message:
  • Added aedes_roifill.m for doing binary flood fill operation. This is

much slower than using the imfill-function, but does not dependend on
Image Processing toolbox. The goal is to make Aedes run with just the
base Matlab install. DICOM support will probably be the last obstacle
in achieving this, because it's going to be a great pain in the a to
code...

  • Fixed overwriting ROIs in aedes_roi_copy_gui.m and added additional

information in the ROI copy button tooltips.

  • Some further iterations to the new readvnmr-function.

M aedes_roi_copy_gui.m
M aedes_getmatlabversion.m
M aedes_readvnmr.m
M aedes.m
M aedes_helpabout.m
M aedes_readfid.m
M aedes_revision.m
A aedes_roifill.m

Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • aedes.m

    r147 r148  
    9898
    9999% Detect Matlab version
    100 Dat.MatlabVersion = aedes_getmatlabversion;
     100[Dat.MatlabVersion,Dat.isImageProc] = aedes_getmatlabversion;
    101101
    102102% Show license and warranty notification ----------------
     
    616616                           'separator','on',...
    617617                           'enable','off');
    618 H.UIROITOOLS_COPYSLICES = uimenu(H.UIROITOOLS_COPY,'Label','Copy ROI to slices',...
     618H.UIROITOOLS_COPYSLICES = uimenu(H.UIROITOOLS_COPY,'Label','Copy ROI to slices/volumes',...
    619619                                 'callback',@l_RoiCopy,...
    620620                                 'separator','off',...
     
    950950                             'CData',btn_cdata.cdata.copy_small,...
    951951                             'ClickedCallback',@l_RoiCopy,...
    952                               'TooltipString','Copy ROI to slices',...
     952                              'TooltipString','Copy ROI to slices/volumes',...
    953953                              'enable','off',...
    954954                              'separator','off');
     
    15801580                          'callback',@l_RoiCopy,...
    15811581                          'enable','off',...
    1582                           'tooltip','Copy ROI to slices');
     1582                          'tooltip','Copy ROI to slices/volumes');
    15831583tmp=get(H.ROIBTN_COPY,'position');
    15841584H.ROIBTN_DEL = uicontrol('parent',H.FIG,...
     
    79547954end
    79557955
    7956 
    7957 I=imfill(I,[x y],4);
     7956% Check if Image Processing toolbox is installed and we if could use imfill
     7957% function which is much faster than aedes_roifill for doing the flood fill
     7958% operation.
     7959try
     7960  if Dat.isImageProc
     7961    I=imfill(I,[x y],4);
     7962  else
     7963    I=aedes_roifill(I,[x y]);
     7964  end
     7965catch
     7966  % Fallback to aedes_roifill...
     7967  I=aedes_roifill(I,[x y]);
     7968end
     7969
    79587970ind=find(I);
    79597971tmp=false(size(I));
  • aedes_getmatlabversion.m

    r133 r148  
    1 function version_number = aedes_getmatlabversion()
     1function [version_number,isImProcToolbox] = aedes_getmatlabversion()
    22% AEDES_GETMATLABVERSION - Returns the numerical Matlab (main) version
    33%   
    44%
    55% Synopsis:
    6 %       version_number = aedes_getmatlabversion;
     6%       [version_number,isImProcToolbox] = aedes_getmatlabversion;
    77%
    88% Description:
    9 %       Returns the numerical Matlab (main) version (e.g. 7.6)
     9%       Returns the numerical Matlab (main) version. The number is converted
     10%       to a proper decimal format (e.g. Matlab 7.6 -> 7.06, Matlab 7.10 ->
     11%       7.1). The availability of Image Processing Toolbox is also
     12%       returned in isImProcToolbox.
    1013%
    1114% Examples:
    12 %       version_number = aedes_getmatlabversion;
     15%       [version_number,isImProcToolbox] = aedes_getmatlabversion;
    1316%
    1417% See also:
     
    3235
    3336version_str = version;
     37isImProcToolbox = false;
    3438ind = find(version_str=='.');
    3539major_ver = str2double(version_str(1:ind(1)-1));
    3640minor_ver = str2double(version_str(ind(1)+1:ind(2)-1));
    3741version_number = str2double(sprintf('%d.%02d',major_ver,minor_ver));
     42if nargout>1
     43  try
     44    s=ver;
     45    toolboxes = {s(:).Name};
     46    if any(strcmpi(toolboxes,'Image Processing Toolbox'))
     47      isImProcToolbox = true;
     48    end
     49  catch
     50    isImProcToolbox = false;
     51  end
     52end
  • aedes_helpabout.m

    r82 r148  
    167167                    'Biomedical NMR Group,',...
    168168                    'A. I. Virtanen Institute for Molecular Sciences,',...
    169                     'University of Kuopio, Finland'...
    170                     'Email: Juha-Pekka.Niskanen@uku.fi'},...
     169                    'University of Eastern Finland, Finland'...
     170                    'Email: Juha-Pekka.Niskanen@uef.fi'},...
    171171                      'fontsize',8,...
    172172                      'fontweig','bold',...
     
    181181                    'Biomedical NMR Group,',...
    182182                    'A. I. Virtanen Institute for Molecular Sciences,',...
    183                     'University of Kuopio, Finland'...
    184                     'Email: Juha-Pekka.Niskanen@uku.fi'},...
     183                    'University of Eastern Finland, Finland'...
     184                    'Email: Juha-Pekka.Niskanen@uef.fi'},...
    185185                  'fontsize',8,...
    186186                  'fontweig','bold',...
  • aedes_readfid.m

    r120 r148  
    15521552      kspace = reshape(kspace,procpar.np/2,procpar.nv/2+procpar.fract_ky,...
    15531553        ns,[]);
    1554       kspace(procpar.np/2,procpar.nv,1)=0;
     1554      if Dat.ZeroPadding~=0
     1555        kspace(procpar.np/2,procpar.nv,1)=0;
     1556      end
    15551557    else
    15561558      kspace = reshape(kspace,procpar.np/2,procpar.nv,...
  • aedes_readvnmr.m

    r139 r148  
    11201120% Check for arrayed acquisition
    11211121if isfield(procpar,'array') && ~isempty(procpar.array{1})
    1122   if length(procpar.array)==1 && ~iscell(procpar.array{1}) && ...
    1123       strcmp(procpar.array{1},'pad') && all(procpar.pad==0)
    1124     % Skip the array parsing if the array is a dummy "pad"-array...
    1125     isAcqArrayed = false;
    1126     ArrayLength = 1;
    1127   else
     1122  %if length(procpar.array)==1 && ~iscell(procpar.array{1}) && ...
     1123  %    strcmp(procpar.array{1},'pad') && all(procpar.pad==0)
     1124  %  % Skip the array parsing if the array is a dummy "pad"-array...
     1125  %  isAcqArrayed = false;
     1126  %  ArrayLength = 1;
     1127  %else
    11281128    isAcqArrayed = true;
    11291129    ArrayLength = [];
     
    11381138    end
    11391139    ArrayLength = prod(ArrayLength);
    1140   end
     1140  %end
    11411141else
    11421142  isAcqArrayed = false;
     
    11491149  % Reconstruct 1D data ...
    11501150elseif AcqType==2
     1151 
    11511152  % Reconstruct 2D data
    1152   if strcmpi(seqcon(2:3),'cs')
    1153     kspace = reshape(kspace,[np/2,etl,ArrayLength*ns,nRcvrs,nv/etl]);
    1154     kspace = permute(kspace,[1 2 5 3 4]);
     1153  if strcmpi(seqcon,'ncsnn')
     1154    kspace = reshape(kspace,[np/2,etl,ns,ArrayLength,nv/etl,nRcvrs]);
     1155    kspace = permute(kspace,[1 2 5 3 4 6]);
    11551156    kspace = reshape(kspace,[np/2,nv,ns*ArrayLength,1,nRcvrs]);
    1156   elseif strcmpi(seqcon(2:3),'sc')
    1157     %kspace = reshape(kspace,[np/2,ArrayLength*ns,nv,nRcvrs]);
    1158     kspace = reshape(kspace,[np/2,ns,nRcvrs,ArrayLength,nv]);
    1159     kspace = permute(kspace,[1 5 2 4 3]);
    1160     kspace = reshape(kspace,[np/2,nv,ns*ArrayLength,1,nRcvrs]);
    1161   elseif strcmpi(seqcon(2:3),'cc')
    1162     kspace = reshape(kspace,[np/2,nv,nRcvrs,ns*ArrayLength]);
    1163     kspace = permute(kspace,[1 2 4 3]);
     1157  elseif strcmpi(seqcon,'nscnn')
     1158    if isfield(procpar,'flash_converted')
     1159      kspace = reshape(kspace,[np/2,nRcvrs,ArrayLength,nv,ns]);
     1160      kspace = permute(kspace,[1 4 5 3 2]);
     1161      kspace = reshape(kspace,[np/2,nv,ns*ArrayLength,1,nRcvrs]);
     1162    else
     1163      kspace = reshape(kspace,[np/2,nRcvrs,nv,ArrayLength,ns]);
     1164      kspace = permute(kspace,[1 3 5 4 2]);
     1165      kspace = reshape(kspace,[np/2,nv,ns*ArrayLength,1,nRcvrs]);
     1166    end
     1167  elseif strcmpi(seqcon,'nccnn')
     1168    kspace = reshape(kspace,[np/2,etl,nRcvrs,ns,nv/etl,ArrayLength]);
     1169    kspace = permute(kspace,[1 2 5 4 6 3]);
    11641170    kspace = reshape(kspace,[np/2,nv,ns*ArrayLength,1,nRcvrs]);
    11651171  end
    11661172elseif AcqType==3
    11671173  % Reconstruct 3D data
    1168   if strcmpi(seqcon(2:4),'scs')
     1174  if strcmpi(seqcon,'nscsn')
    11691175    kspace = reshape(kspace,[np/2,etl,nv/etl,nRcvrs,ArrayLength*nv2]);
    11701176    kspace = permute(kspace,[1 2 3 5 4]);
     
    12311237    lpe2 = procpar.lpe2;
    12321238    lro = procpar.lro;
    1233     if lpe2==0
     1239    if AcqType==2
    12341240      % 2D data
    12351241      padSize = [procpar.np/2 ...
    12361242        procpar.np/2*(lpe/lro) ...
    12371243        size(kspace,3)];
    1238     else
     1244    elseif AcqType==3 && lpe2~=0
    12391245      % 3D data
    12401246      padSize = [procpar.np/2 ...
  • aedes_revision.m

    r147 r148  
    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 -
  • aedes_roi_copy_gui.m

    r80 r148  
    142142                     'position',[15 70 150 15],...
    143143                     'style','radio',...
    144                      'string','X direction',...'value',1,...
     144                     'string','X direction (slice)',...'value',1,...
    145145                     'backgroundcolor',GD.col.mainfig);
    146146tmp=get(H.XRADIO,'position');
     
    149149                     'position',[15 tmp(2)-20 150 15],...
    150150                     'style','radio',...
    151                      'string','Y direction',...'value',0,...
     151                     'string','Y direction (column)',...'value',0,...
    152152                     'backgroundcolor',GD.col.mainfig);
    153153tmp=get(H.YRADIO,'position');
     
    156156                     'position',[15 tmp(2)-20 150 15],...
    157157                     'style','radio',...
    158                      'string','Z direction',...'value',0,...
     158                     'string','Z direction (row)',...'value',0,...
    159159                     'backgroundcolor',GD.col.mainfig);
    160160tmp=get(H.ZRADIO,'position');
     
    163163                     'position',[15 tmp(2)-20 150 15],...
    164164                     'style','radio',...
    165                      'string','V direction',...'value',0,...
     165                     'string','V direction (volume)',...'value',0,...
    166166                     'backgroundcolor',GD.col.mainfig,...
    167167                                         'enable','off');
     
    195195                             'backgroundcolor',GD.col.mainfig);
    196196set(H.CPTYPEGRP,'SelectedObject',H.APPENDRADIO)
    197 if ~isMixedType
    198   set([H.APPENDRADIO,H.OVERWRITERADIO],'enable','off')
    199 end
     197%if ~isMixedType
     198%  set([H.APPENDRADIO,H.OVERWRITERADIO],'enable','off')
     199%end
    200200%% Slice selection btngroup
    201201tmp=get(H.CPTYPEGRP,'position');
     
    210210                       'position',[15 35 150 15],...
    211211                       'style','radio',...
    212                        'string','All slices',...
     212                       'string','All slices/volumes',...
    213213                       'backgroundcolor',GD.col.mainfig);
    214214tmp=get(H.ALLRADIO,'position');
Note: See TracChangeset for help on using the changeset viewer.

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